Description | Documentation | Conditions of Use | Applet Deployment | Version History | Examples | Features
The ChemEquilibria applet provides a web interface for the Equilibria package, which is designed to define an arbitrary chemical system and solve the associated equilibrium problem.
Author: David N. Blauch, Copyright 2000-2001,2008 All Rights Reserved
Current Version: 2.0
Archive: chemEquilibria.jar
The ChemEquilibria applet is deployed, in HTML 3.2 and earlier, using the <APPLET> tag, as shown below:
<APPLET CODEBASE = "." ARCHIVE = "chemEquilibria.jar,equilibria.jar" CODE = "chemEquilibria.ChemEquilibria.class" NAME = "chemEquilibria" WIDTH = "0" HEIGHT = "0" HSPACE = "0" VSPACE = "0" ALIGN = "middle" > <PARAM NAME = "IsIdeal" VALUE = "true"> <PARAM NAME = "IsIsobaric" VALUE = "true"> <PARAM NAME = "Pressure" VALUE = "1.000"> <PARAM NAME = "Temperature" VALUE = "298.15"> </APPLET>
The ChemEquilibria applet does not create any graphics, so the size of the applet has been set a size of zero. The codebase indicates the directory containing the archive files. The parameters, which are optional, define certain properties of the chemical system.
| IsIdeal | If true, all activity coefficients are set to unity. Otherwise activity coefficients for solutes are computed using the extended Debye-Huckel equation. |
| IsIsobaric | If true, the pressure of all gas phases are maintained at the system pressure by varying the volume of the phase. If false, all gas phases have a fixed volume and the pressure of the gas can vary. |
| Pressure | This value is the system pressure in atm. |
| IsIdeal | This value is the system temperature in Kelvin. |
| 1.0 | First public release |
| 2.0 | Recompiled for Java 1.6 |
The ChemEquilibria and Equilibria packages can be used to solve an arbitrary equilibrium problem. A series of examples illustrate this process.
All computations are performed using species activities. If the isIdeal property of the ChemSystem is true, then all activity coefficients are set to unity. If the isIdeal property is false, the activity coefficients of all pure solid, pure liquid, or gas-phase species are set to unity. The activity coefficients of solutes, however, are estimated using the extended Debye-Huckel equation. The user may explicitly define the ion-size parameter for each ChemSpecies. The default value is 4.5 angstroms. The parameters in the extended Debye-Huckel equations are calculated from the solution dielectric constant and the system temperature using methods defined in the Phase class.
Each Solution object provides the option of automatically balancing charge in the solution. When the autoChargeBalance property is true, the parse method in the Equilibria object automatically balances the charge in the system by adding a generic counter-ion solute to the solution in an amount that achieves electroneutrality. The counter-ion is labeled "X+" or "X-", depending upon whether a cation or anion is required, and has a charge of +1 or -1. This feature reduces the number of ChemSpecies and Species that the user must define. Users should exercise caution in using this feature when activity corrections are being performed. The influence of a monovalent spectator ion on the ionic strength of a solution differs from that of a polyvalent spectator ion. (Note: The X+ and X- Species are defined when any Solution is created. It is therefore possible to set the Debye-Huckel ion-size parameter for these Species by retrieving the Species with the phase's getSpecies method and then employing the setIonSize method for the Species.)
The autoChargeBalance feature is not available for solid, liquid, or gas phases. Pure solids and pure liquids contain a single compound that must be electrically neutral. All gas-phase species must also be neutral.
This software is written in Java. The edu.davidson.chm.equilibria is organized into the following object hierarchy.
ChemSystem.classPhase.classThe ChemSystem object describes the composition of the chemical system.
- Properties
- temperature (The system is isothermal.)
- pressure (If the system is isobaric, all phases of the system experience this pressure.)
- isIsobaric (If true, the pressure of the system is held at the specified value by varying the volumes of the gas phases. If false, each gas phase is isochoric.)
- isIdeal (If true, all activity coefficients are set to unity; otherwise the extended Debye-Huckel equation is employed to calculate activity coefficients for solutes.)
- label (A descriptive label may be defined.)
- Phases
- The ChemSystem object contains one or more Phase objects.
- Reactions
- The ChemSystem object contains one or more Reaction objects.
- Half-Reactions
- The ChemSystem object contains one or more HalfReaction objects.
Species.classThe Phase object describes the composition of a chemical phase. Each Phase object is associated with a specific ChemSystem object.
- Properties
- label (A descriptive label is used to identify the phase.)
- physState (The physical state of the phase is 's' for a pure solid, 'l' for a pure liquid, 'g' for a gas, or 'd' for a solution.)
- density (The density is a fixed value, except for gases.)
- volume (The volume of the phase is calculated from the density of the phase and the mass of its components, except for a gas. If the ChemSystem is isobaric, the volume of the gas phase is adjusted to achieve the specified pressure. If the system is not isobaric, then the gas phase is isochoric with the volume specified by the user.)
- dielectricConstant (The dielectric constant is used to calculate parameters in the Extended Debye-Huckel equation.)
- isProtic (If a solution, this property indicates whether the solvent is protic or aprotic.)
- Species
- The Phase object contains one or more Species objects.
ChemSpecies.classThe Species object describes the properties of a chemical species as it exists within a specific phase. Each Species object is associated with a specific Phase object.
- Properties
- label (A descriptive label is used to identify the species. This label is identical to that of the ChemSpecies.
- chemSpecies (This object describes the intrinsic properties of the chemical species.)
- moles (The number of moles of the species in the phase.)
- analMoles (The analytical number of moles of the species in the phase.)
Reaction.classThe ChemSpecies object describes the intrinsic properties (i.e., those properties that are independent of the phase in which the chemical species exists) of a chemical species.
- Properties
- label (A descriptive label is used to identify the chemical species.)
- charge (The charge on the chemical species as a multiple of the electron charge.)
- fw (The formula weight of the chemical species.)
- ionSize (The ion-size parameter, in angstroms, as used by the Extended Debye-Huckel equation.)
HalfReaction.classThe Reaction object describes a chemical reaction.
- Properties
- label (A descriptive label is used to identify the Reaction.)
- K (The thermodynamic equilibrium constant uses the standard state of 1 mole/L concentration for solutes and and 1 atm partial pressures for gas-phase species.)
- refTemperature (The equilibrium constant is applicable at this reference temperature.)
- a and b (Parameters that characterize the temperature-dependence of the equilibrium constant.)
- Species
- The Reaction contains a collection of Species that are participants in the chemical reaction.
- Stoichiometric Coefficients
- A stoichiometric coefficient is associated with each Species. If the Species is a reactant, the stoichiometric coefficient is negative, otherwise the coefficient is positive.
Equilibria.classThe HalfReaction object describes a half-reaction.
- Properties
- label (A descriptive label is used to identify the HalfReaction.)
- Eo (The standard reduction potential uses the standard state of 1 mole/L concentration for solutes and and 1 atm partial pressures for gas-phase species.)
- refTemperature (The standard reduction potential is applicable at this reference temperature.)
- nEquiv (The number of equivalents for the reaction, i.e., the number of electrons transferred.)
- a, b, and c (Parameters that characterize the temperature-dependence of the standard potential.)
- Species
- The HalfReaction contains a collection of Species that are participants in the half-reaction.
- Stoichiometric Coefficients
- A stoichiometric coefficient is associated with each Species. If the Species is a reactant, the stoichiometric coefficient is negative, otherwise the coefficient is positive.
Titration.classThe Equilibria object provides methods for analyzing a chemical system and providing the solution to the equilibrium problem.
- Properties
- chemSystem (The ChemSystem object on which calculations are to be performed.)
Extended ClassesThe Titration object provides methods for analyzing an experimental titration curve and for calculating titration curves. The object includes methods for curve-fitting experimental titration data.
- Properties
- chemSystem (The chemSystem object that describes the system for the titration. With the exception of the apply method, the properties of the chemSystem are not altered by the Titration object.)
- titrantLabel (The label identifying the titrant, which must be a Solution object.)
- sampleLabel (The label identifying the sample solution, which must be a Solution object.)
- Aqueous.class extends Solution.class
- The Aqueous object describes an aqueous solution. The solvent H2O, solutes H+ and OH-, and the auto-dissociation reaction, including its temperature dependence, are automatically defined.
- Gas.class extends Phase.class
- The Gas object describes a gas phase.
- Hydrogen_Ion.class extends ChemSpecies.class
- The Hydrogen_Ion object describes the intrinsic chemical properties of H+.
- Hydroxide_Ion.class extends ChemSpecies.class
- The Hydroxide_Ion object describes the intrinsic chemical properties of OH-.
- Liquid.class extends Phase.class
- The Liquid object describes a pure liquid phase. It contains only one Species.
- Solid.class extends Phase.class
- The Solid object describes a pure solid phase. It contains only one Species.
- Solution.class extends Phase.class
- The Solution object describes a liquid solution. Support is provided for a protic solvent and the associated auto-dissociation reaction. The solvent is treated as a pure liquid, and the solution may contain multiple solutes.
- Water.class extends ChemSpecies.class
- The Water object describes the intrinsic chemical properties of H2O.
Cell potentials can be determined through the use of the HalfReation method. HalfReactions are not employed in the actual equilibrium calculations, because it is assumed that no charge is actually passed through the electrodes. If the equilibrium problem involves a redox reaction, the user should explicitly formulate the redox reaction as an ordinary chemical reaction (not a half-reaction) and define the redox reaction using the Reaction method. The HalfReaction object is only used to determine cell potentials.
A ChemSpecies, Species, and Phase should be defined for each electrode. For example, a platinum electrode is a pure solid phase that contains Pt as its component Species. The ChemSystem object has a getPotential method that returns the half-cell potential for an electrode or the cell potential for a pair of electrodes. The getPotential method should be called after the equilibrium problem is solved.
The ChemEquilibria applet can read a text file and use the definitions contained therein to generate a set of ChemSpecies. The text file must have the following format: label, charge, formula weight[, ion-size];
All information following the ; is disregarded. A library of common inorganic species, inorganic.library is provided.
The library is read using the loadLibrary method; the only argument for this method is the full URL (including http://) for the library file. Java applet security restrictions prevent the applet from reading files from the local hard drive. In fact, applets are only allowed to access files from the same computer that supplied the applet (determined either from the web page URL or the codebase URL).
ChemSpecies.class contains a static method named createChemSpecies that returns a ChemSpecies object created from the specifications containing in a String using the same syntax as the loadLibrary method described above.
The Equilibria object contains two methods, getMassBalance and getChargeBalance, that return text representations of the mass-balance and charge-balance equations, respectively. The getMassBalance method has no arguments and returns an String array describing all mass-balance equations for the chemical system. Any linear combination of mass-balance and/or charge-balance equations is also a valid mass-balance equation, so this collection of equations is not unique.
The getChargeBalance method requires a Phase as the argument and returns the charge-balance equation for that phase. A charge-balance equation is only available for protic solutions. The charge-balance is equation is essentially a substitute for a mass-balance equation that includes the solvent. Because the solvent is present in much larger amounts than the solutes, it is generally numerically desirable to omit the solvent in calculations (where possible).
These equations are written in moles of each Species and the mass-balance equations include the analytical amounts of material specified by the user.
The parse method in the Equilibria object examines the ChemSystem to determine if the description of the chemical system contains any inconsistencies. The method returns true if no problems are found. If problems are found, false is returned and a set of descriptive messages may be retrieved using the getMessages method.