edu.davidson.chm.equilibria
Class HalfReaction

java.lang.Object
  extended by edu.davidson.chm.equilibria.HalfReaction
All Implemented Interfaces:
PhysicalConstants

public class HalfReaction
extends java.lang.Object
implements PhysicalConstants

This class contains the description of a half-reaction.

Copyright (c) David N. Blauch

Version:
1.0
Author:
David N. Blauch

Field Summary
 
Fields inherited from interface edu.davidson.chm.equilibria.PhysicalConstants
F, k, No, perm, qe, R, RJ
 
Constructor Summary
HalfReaction()
          The default constructor should not be used.
HalfReaction(Species[] _species, double[] _coef, double _Eo, double _nEquiv, Phase _phase)
          Constructs a HalfReaction based upon a list of species and their stoichiometric coefficients.
HalfReaction(java.lang.String _label, Species[] _species, double[] _coef, double _Eo, double _nEquiv, Phase _phase)
          Constructs a HalfReaction based upon a list of species and their stoichiometric coefficients.
 
Method Summary
 HalfReaction copyOf(ChemSystem _chemSystem)
          Returns a copy of the HalfReaction.
 double getCoefficient(Species _species)
          Returns the stoichiometric coefficient of the given species.
 double getCoefficient(java.lang.String _label)
          Returns the stoichiometric coefficient of the species with the given label.
 double[] getCoefficients()
          Returns an array of the stoichiometric coefficients for the species in the reaction
 java.lang.String getEquation()
          Returns a string representation of the half-reaction.
 double getEquivalents()
          Returns the number of equivalents (n)
 java.lang.String getInfo()
          Returns information about this class
 java.lang.String getLabel()
          Returns the label for the half-reaction
 Phase getPhase()
          Returns the phase of the electrode
 double getPotential()
          Returns the potential in volts for the half-reaction using the current activities of the reactants and products.
 double getReferenceTemperature()
          Returns the reference temperature for the standard potential
 Species[] getSpecies()
          Returns an array of the species involved in the reaction
 double getStandardPotential()
          Returns the standard potential in volts for the half-reaction at the reference potential
 double getStandardPotential(double _temperature)
          Returns the standard potential in volts for the half-reaction at the indicated temperature
 double[] getTemperatureDependence()
          Returns an array containing the parameters a, b, and c characterizing the temperature dependence of the HalfReaction
 void setReferenceTemperature(double _temperature)
          Sets the reference temperature (in Kelvin)
 void setStandardPotential(double _Eo)
          Sets the standard potential at the reference temperature
 void setTemperatureDependence(double _a, double _b, double _c)
          Sets the parameters used to determine the temperature-dependence of the standard potential.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HalfReaction

public HalfReaction()
The default constructor should not be used.


HalfReaction

public HalfReaction(java.lang.String _label,
                    Species[] _species,
                    double[] _coef,
                    double _Eo,
                    double _nEquiv,
                    Phase _phase)
Constructs a HalfReaction based upon a list of species and their stoichiometric coefficients. The list of species do not include the electron. The reaction must be written as a reduction. The phase "containing" the electrons must also be specified. This phase is essentially the electrode.

Parameters:
_species - array of species involved in reaction
_coef - array of stoichiometric coefficients, negative for reactants and positive for products
_Eo - standard potential at 298.15 K
_nEquiv - number of equivalents
_phase - electrode phase

HalfReaction

public HalfReaction(Species[] _species,
                    double[] _coef,
                    double _Eo,
                    double _nEquiv,
                    Phase _phase)
Constructs a HalfReaction based upon a list of species and their stoichiometric coefficients. The list of species do not include the electron. The reaction must be written as a reduction. The phase "containing" the electrons must also be specified. This phase is essentially the electrode.

Parameters:
_species - array of species involved in reaction
_coef - array of stoichiometric coefficients, negative for reactants and positive for products
_Eo - standard potential at 298.15 K
_nEquiv - number of equivalents
_phase - electrode phase
Method Detail

copyOf

public HalfReaction copyOf(ChemSystem _chemSystem)
Returns a copy of the HalfReaction. The method examines each Species in the HalfReaction and searches for a Phase in the new ChemSystem with the same label that contains the relevant ChemSpecies. If corresponding Species cannot be found, the method returns null. This method should be called after the composition of the new ChemSystem has been defined. The new HalfReaction returned by this method is NOT added to the ChemSystem. The user must add the HalfReaction to the ChemSystem, if desired.


getCoefficient

public double getCoefficient(Species _species)
Returns the stoichiometric coefficient of the given species. If the species does not participate in the reaction, zero is returned.


getCoefficient

public double getCoefficient(java.lang.String _label)
Returns the stoichiometric coefficient of the species with the given label. If the species does not participate in the reaction, zero is returned.


getCoefficients

public double[] getCoefficients()
Returns an array of the stoichiometric coefficients for the species in the reaction


getEquation

public java.lang.String getEquation()
Returns a string representation of the half-reaction.


getEquivalents

public double getEquivalents()
Returns the number of equivalents (n)


getInfo

public java.lang.String getInfo()
Returns information about this class


getLabel

public java.lang.String getLabel()
Returns the label for the half-reaction


getPhase

public Phase getPhase()
Returns the phase of the electrode


getPotential

public double getPotential()
Returns the potential in volts for the half-reaction using the current activities of the reactants and products. This method should be called after the equilibrium problem is solved.


getReferenceTemperature

public double getReferenceTemperature()
Returns the reference temperature for the standard potential


getSpecies

public Species[] getSpecies()
Returns an array of the species involved in the reaction


getStandardPotential

public double getStandardPotential()
Returns the standard potential in volts for the half-reaction at the reference potential


getStandardPotential

public double getStandardPotential(double _temperature)
Returns the standard potential in volts for the half-reaction at the indicated temperature

Parameters:
_temperature - absolute temperature

getTemperatureDependence

public double[] getTemperatureDependence()
Returns an array containing the parameters a, b, and c characterizing the temperature dependence of the HalfReaction


setReferenceTemperature

public void setReferenceTemperature(double _temperature)
Sets the reference temperature (in Kelvin)


setStandardPotential

public void setStandardPotential(double _Eo)
Sets the standard potential at the reference temperature


setTemperatureDependence

public void setTemperatureDependence(double _a,
                                     double _b,
                                     double _c)
Sets the parameters used to determine the temperature-dependence of the standard potential. The calculation employs the following formula:

E = Er + t (a + t ( b + t c))

where E is the standard potential at temperature T, Er is the standard potential at the reference temperature (Tref), t = T - Tref, and a, b, and c are the parameters set by this method.