This page illustrates the use of the Equilibria package and the ChemEquilibria applet in solving equilibrium problems.
The Haber Process is the industrial process for producing ammonia from hydrogen and nitrogen gases. The reaction is performed at high temperature (400 to 500 oC) and high pressure (300 to 1000 atm).
Use the createChemSpecies method to create the following chemical species:
|Chemical Species||Label||Charge||Formula Weight|
document.chemEquilibria.createChemSpecies("H2",0.0,2.0159); document.chemEquilibria.createChemSpecies("N2",0.0,28.0134); document.chemEquilibria.createChemSpecies("NH3",0.0,17.0306);
A useful feature of the ChemEquilibria applet is the ability to read a text file that defines chemical species. (See the loadLibrary method for ChemEquilibria in the documentation.) Such files are easy to create (one such file is inorganic_library.txt, which defines various inorganic species).
The gas phase, as created, is a vacuum; that is, it contains no chemical species. The three chemical species must thus be added to the gas phase. The addSpecies method adds a certain number of moles of a chemical species (identified by its label) to a phase (identified by its label). The first instruction below, for example, adds 3000.0 moles of the chemical species with label "H2" (that would be hydrogen) to the phase with label "g" (that would be the gas phase).
document.chemEquilibria.addSpecies("H2","g",3000.0); document.chemEquilibria.addSpecies("N2","g",1000.0); document.chemEquilibria.addSpecies("NH3","g",0.0);
Now that all chemical species and phases have been created, it is time to define the chemical reaction. The reaction is defined by submitting a string containing the chemical equation. " = " represents the equilibrium arrows. Species on the same side of the equilibrium arrows are separated by " + ". When the same chemical species exists in multiple phases, it is necessary to explicitly indicate the phase with the chemical species in the reaction. In this case, however, there is only one phase, so no ambiguity is introduced by omitting the phases from the chemical equation. The equilibrium constant employs pressure to calculate the activity of a gas and molar concentration to calculate the activity of a solute. Thus Kp rather than Kc must be supplied in this case.
document.chemEquilibria.addReaction("rxn","3 H2 + N2 = 2 NH3", 5.4E5); document.chemEquilibria.setTemperatureDependence("rxn",10035.7527,-3.7214);
In this process, the temperature of the reaction vessel may be varied, which in turn affects the equilibrium constant. A reference temperature is associated with each equilibrium constant; by default this value is 298.15 K. The edu.davidson.chm.equilibria package models the temperature-dependence of an equilibrium constant using the following equation:
The reference temperature is denoted by Tr (by default Tr = 298.15 K) and the equilibrium constant at the reference temperature by Kr. The parameters a and b are determined empirically.
One option for managing the effects of a change in temperature is to manually enter the equilibrium constant for the desired temperature. By default a = b = 0, thus a change in system temperature produces no change in equilibrium constants (or standard potentials).
Before solving the problem, various parameters describing the properties of the system must be set. In this problem, the system is assumed to behave ideally. The volume of the system is fixed and the pressure may vary as equilibrium is achieved or as other reagents are added; thus the system is not isobaric. Finally one must select the temperature (in this case 400 oC). These three parameters could be set in advance using the PARAM options in the APPLET tag.
document.chemEquilibria.setIsIdeal(true); document.chemEquilibria.setIsIsobaric(false); document.chemEquilibria.setTemperature(673.15); var solveState = document.chemEquilibria.solve();
The solve method first parses the chemical system to ensure certain types of errors do not exist. The problem is then solved. The solve method returns true if the solution was obtained and false if no solution was found. In the event no solution was found, check the Java console for information on the nature of the problem.
After the problem has been solved, the equilibrium properties of the various chemical species and phases can be obtained using the appropriate method. Examples are shown below.
To see the effect of the system temperature, enter a new temperature, solve the problem with the new temperature, and then get the properties for the new equilibrium state. In the same manner, the volume of the reactor can be altered.