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 Equilibria Package

Description | Documentation | Conditions of Use | Version History | Examples | Features


Description

The Equilibria package contains a collection of Java classes that define a chemical system including its reactivity and solve equilibrium problems.

Author: David N. Blauch, Copyright 2000-2014 All Rights Reserved

Current Version: 3.0

Archive: equilibria.jar

The ChemEquilibria Applet provides a web-based interface for using the Equilibria Package.


Version History

2.1 First public release
3.0 Compiled for Java 1.6
3.1 Jar file 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.


Features

Topics

  • Activity Effects
  • Automatic Charge Balance
  • Class Organization
  • Half-Reactions and Cell Potentials
  • Library of ChemSpecies
  • Mass-Balance and Charge-Balance Equations
  • Parse Features


  • 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, an object-oriented language. The edu.davidson.chm.equilibria is organized into the following object hierarchy.

    ChemSystem.class

    The ChemSystem object describes the composition of the chemical system.

    Phase.class

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

    Species.class

    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.

    ChemSpecies.class

    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.

    Reaction.class

    The Reaction object describes a chemical reaction.

    HalfReaction.class

    The HalfReaction object describes a half-reaction.

    Equilibria.class

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

    Titration.class

    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

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