Java Security Settings:
      This web page employs Java, which requires specific security settings for correct operation.
      If the applets on this page do not run correctly, consult the Virtual Chemistry Experiments FAQ
      or the Physlet Physics web site for establishing the correct security settings.

The ChemEquilibria Applet

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-2014 All Rights Reserved

Current Version: 2.1

Archive: chemEquilibria.jar

Applet Deployment

The ChemEquilibria applet is deployed, in HTML 3.2 and earlier, using the <APPLET> tag, as shown below:

  CODEBASE = "."
  ARCHIVE  = "chemEquilibria.jar,equilibria.jar"
  CODE     = "chemEquilibria.ChemEquilibria.class"
  NAME     = "chemEquilibria"
  WIDTH    = "0"
  HEIGHT   = "0"
  HSPACE   = "0"
  VSPACE   = "0"
  ALIGN    = "middle"
<PARAM NAME = "permissions" VALUE = "sandbox">
<PARAM NAME = "IsIdeal" VALUE = "true">
<PARAM NAME = "IsIsobaric" VALUE = "true">
<PARAM NAME = "Pressure" VALUE = "1.000">
<PARAM NAME = "Temperature" VALUE = "298.15">

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.

Version History

1.0 First public release
2.0 Recompiled for Java 1.6
2.1 Jars are now signed.

Examples of Solving Equilibrium Problems

The ChemEquilibria and Equilibria packages can be used to solve an arbitrary equilibrium problem. A series of examples illustrate this process.



Activity Effects

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.

Automatic Charge Balance

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.

Class Organization

This software is written in Java. The edu.davidson.chm.equilibria is organized into the following object hierarchy.


The ChemSystem object describes the composition of the chemical system.


The Phase object describes the composition of a chemical phase. Each Phase object is associated with a specific ChemSystem object.


The 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.


The 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.


The Reaction object describes a chemical reaction.


The HalfReaction object describes a half-reaction.


The Equilibria object provides methods for analyzing a chemical system and providing the solution to the equilibrium problem.


The 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.

Extended Classes

Half-Reactions and Cell Potentials

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.

Library of ChemSpecies

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.

Mass-Balance and Charge-Balance Equations

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.

Parse Features

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.

Virtual Chemistry Experiments Home Page

ChemEquilibria.html version 2.1
© 2001-2014 David N. Blauch