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, All Rights Reserved
Current Version: 1.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. |
In HTML 4.0, the <APPLET> tag is deprecated and the <OBJECT> tag should be employed.
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, an object-oriented language. The edu.davidson.chm.equilibria is organized into the following object hierarchy.
ChemSystem.classCell 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.