chemEquilibria
Class ChemEquilibria

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by chemEquilibria.ChemEquilibria
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class ChemEquilibria
extends java.applet.Applet

This applet provides a web page interface for the edu.davidson.chm.equilibria package. All references to objects are based upon labels (String). The chemical species H+, OH-, and H2O are predefined for convenience.

Applet Parameters

NAME Variable Type Default Description
IsIdeal boolean true If true, all activity coefficients are set to unity. If false, activity coefficients are calculated.
IsIsobaric boolean true If true, the pressures of all phases are set to the system pressure. The volume of gas phases are adjusted to obtain the specified pressure. If false, the volume of all gas phases are fixed and their pressure may vary.
IsReady String   JavaScript variable that will be set to true when applet has initialized. Must use MAYSCRIPT in APPLET tag to use this feature.
Pressure double 1.000 System pressure in atm. Significant only if isBaric is true.
Temperature double 298.15 System temperature in Kelvin

Version:
2.0 Copyright 2000, 2001, 2008
Author:
David N. Blauch
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ChemEquilibria()
           
 
Method Summary
 void addAcidBaseSpecies(java.lang.String _baseLabel, double _baseCharge, double _baseFW, int _n, java.lang.String _solutionLabel, double _moles)
          Creates a series of acid-base species and adds the species to a solution.
 void addComplexes(java.lang.String _metalLabel, double _metalCharge, double _metalFW, java.lang.String _ligandLabel, double _ligandCharge, double _ligandFW, int _n, java.lang.String _solutionLabel, double _moles)
          Creates a series of metal-ligand complexes and adds the species to a solution.
 void addDatum(double _Vt, double _pX)
          Adds a Vt, pX data point to the data set.
 void addDatum(double _Vt, double _pX, double _std)
          Adds a Vt, pX data point to the data set.
 boolean addHalfReaction(java.lang.String _label, java.lang.String _rxn, double _Eo)
          Creates a half-reaction and adds it to the chemical system.
 void addPar(java.lang.String _type, java.lang.String _label, java.lang.String _phaseLabel)
          Adds a parameter to be optimized in the curve-fitting procedure.
 boolean addReaction(java.lang.String _label, java.lang.String _rxn, double _K)
          Creates a chemical reaction and adds it to the chemical system.
 void addSpecies(java.lang.String _speciesLabel, double _charge, java.lang.String _phaseLabel, double _moles)
          Adds the specified amount of a ChemSpecies to a Phase.
 void addSpecies(java.lang.String _speciesLabel, java.lang.String _phaseLabel, double _moles)
          Adds the specified amount of a ChemSpecies to a Phase.
 void apply()
          Applies the best-fit parameters from the last curve-fitting procedure to the Reaction and Species objects.
 void calculate(double _finalVolume)
          Calculates a theoretical titration curve
 void clear()
          Clears the entire chemical system and resets the properties for a new calculation.
 void clearData()
          Clears the data to be fit in the curve-fitting procedure.
 void clearParameters()
          Clears the parameters to be optimized in the curve-fitting procedure.
 void createAqueousPhase(java.lang.String _solutionLabel, double _volume)
          Creates an aqueous solution phase.
 void createChemSpecies(java.lang.String _label, double _charge, double _fw)
          Creates a new ChemSpecies.
 void createGasPhase(java.lang.String _gasLabel, double _volume)
          Creates a gas phase containing no species (i.e., a vacuum).
 void createLiquidPhase(java.lang.String _liquidLabel, java.lang.String _speciesLabel, double _moles)
          Creates a liquid phase (pure substance).
 void createSolidPhase(java.lang.String _solidLabel, java.lang.String _speciesLabel, double _moles)
          Creates a solid phase (pure substance).
 void createSolutionPhase(java.lang.String _solutionLabel, java.lang.String _solventLabel, double _volume)
          Creates an aprotic solution phase.
 void createSolutionPhase(java.lang.String _solutionLabel, java.lang.String _solventLabel, double _Kauto, double _volume)
          Creates a protic solution phase.
 void createSolutionPhase(java.lang.String _solutionLabel, java.lang.String _solventLabel, java.lang.String _acidLabel, java.lang.String _baseLabel, double _Kauto, double _volume)
          Creates a protic solution phase.
 void createTitration(java.lang.String _titrantLabel, java.lang.String _sampleLabel)
          Create a Titration object using the current chemical system.
protected  void deleteChemSpecies(java.lang.String _label)
          Deletes the ChemSpecies
 void destroy()
           
 boolean fit()
          Performs the curve-fitting procedure for titration data.
 double getActivity(java.lang.String _speciesLabel, java.lang.String _phaseLabel)
          Returns the activity of the ChemSpecies in the Phase.
 double getAnalConc(java.lang.String _speciesLabel, java.lang.String _phaseLabel)
          Returns the analytical molar concentration of the ChemSpecies in the Phase.
 double getAnalMoles(java.lang.String _speciesLabel, java.lang.String _phaseLabel)
          Returns the analytical moles of the ChemSpecies in the Phase.
 java.lang.String getAppletInfo()
           
 java.lang.String getChargeBalance(java.lang.String _phaseLabel)
          Returns a string representing the charge balance equation for indicated phase.
protected  ChemSpecies getChemSpecies(java.lang.String _label)
          Returns the ChemSpecies
 double getChiSq()
          Returns the chi-square value for the last curve-fitting procedure.
 double getConc(java.lang.String _speciesLabel, java.lang.String _phaseLabel)
          Returns the molar concentration of the ChemSpecies in the Phase.
 double getDensity(java.lang.String _phaseLabel)
          Returns the density (in grams/mL) of the Phase.
 double getDerivative(int _n)
          Returns the derivative of an experimental titration curve at the _n-th point.
 double getDerivative2(int _n)
          Returns the second derivative of an experimental titration curve at the _n-th point.
 double getGoodnessOfFit()
          Returns the goodness-of-fit for the curve-fitting procedure.
 double getHalfReactionPotential(java.lang.String _rxnLabel)
          Returns the potential in volts for the half-reaction.
 double getIonicStrength(java.lang.String _phaseLabel)
          Returns the ionic strength of the phase in mole/L.
 double getK(java.lang.String _label)
          Returns the equilibrium constant for the reaction at the reference temperature
 double getK(java.lang.String _label, double _temperature)
          Returns the equilibrium constant for the reaction at the indicated temperature
 double getMass(java.lang.String _speciesLabel, java.lang.String _phaseLabel)
          Returns the actual mass (in grams) of ChemSpecies in the Phase.
 java.lang.String getMassBalance(int idx)
          Returns a string containing the mass balance equation
 java.lang.String[] getMessages()
          Returns an array of strings containing messages from the last analysis of the chemical system using the parse method.
 double getMinValue()
          Returns the minimum positive value for the moles of any species.
 double getMoles(java.lang.String _speciesLabel, java.lang.String _phaseLabel)
          Returns the actual moles of ChemSpecies in the Phase.
 int getNbrMassBalance()
          Returns the number of mass balance equations for the system
 int getNbrParseMessages()
          Returns the number of messages from the last parse operation
 int getNbrPoints()
          Returns the number of points in the calculated titration curve
 double getPar(int _idx)
          Returns the parameter with index _idx.
 java.lang.String getParameter(java.lang.String key, java.lang.String def)
           
 java.lang.String[][] getParameterInfo()
           
 java.lang.String getParseMessage(int _n)
          Returns message _n from the last analysis of the chemical system using the parse method.
 double getParStd(int _idx)
          Returns the standard deviation of parameter with index _idx.
 double getpH(java.lang.String _phaseLabel)
          Returns the pH of the phase.
 double getpK(java.lang.String _label)
          Returns pK for the reaction at the reference temperature
 double getpK(java.lang.String _label, double _temperature)
          Returns pK for the reaction at the indicated temperature
 double getpOH(java.lang.String _phaseLabel)
          Returns the pOH of the phase.
 double getPotential(java.lang.String _phaseLabel)
          Returns the potential in volts for the indicated electrode.
 double getPotential(java.lang.String _phase1Label, java.lang.String _phase2Label)
          Returns the potential in volts for the indicated cell.
 double getPressure(java.lang.String _phaseLabel)
          Returns the pressure (in atm) of the Phase.
 double getPressure(java.lang.String _speciesLabel, java.lang.String _phaseLabel)
          Returns the partial pressure (in atm) of the ChemSpecies in the Phase.
 double getStandardPotential(java.lang.String _label, double _temperature)
          Returns the standard potential for the half-reaction at the indicated temperature
 double getTemperature()
          Returns the absolute temperature of the system.
 double getTitrationValue(int _index)
          Gets the pX or E value in a calculated titration curve
 double getVolume(java.lang.String _phaseLabel)
          Returns the actual volume (in liters) of the phase.
 double getVolumeTitrant(int _index)
          Gets the volume (in mL) of titrant added in a calculated titration curve
 void init()
           
 void loadLibrary(java.lang.String _url)
          Creates all ChemSpecies defined in a library file.
 boolean parse()
          Parses the chemical system to identify possible problems.
protected  ChemSpecies parseLine(java.lang.String _data)
          Parses a line from the ChemSpecies library and returns a new ChemSpecies based upon the content of the line.
 void removeHalfReaction(java.lang.String _label)
          Removes the half-reaction from the chemical system
 void removePhase(java.lang.String _label)
          Removes the phase from the chemical system.
 void removeReaction(java.lang.String _label)
          Removes the reaction from the chemical system
 void removeSpecies(java.lang.String _speciesLabel, java.lang.String _phaseLabel)
          Removes the species from the phase.
 void setAnalConc(java.lang.String _speciesLabel, java.lang.String _phaseLabel, double _conc)
          Sets the analytical concentration (mole/L) of the ChemSpecies
 void setAnalMass(java.lang.String _speciesLabel, java.lang.String _phaseLabel, double _mass)
          Sets the analytical mass (in grams) of the ChemSpecies in the Phase.
 void setAnalMoles(java.lang.String _speciesLabel, java.lang.String _phaseLabel, double _moles)
          Sets the analytical moles of the ChemSpecies in the Phase.
 void setAnalPressure(java.lang.String _speciesLabel, java.lang.String _phaseLabel, double _pressure)
          Sets the analytical partial pressure of the ChemSpecies in the Phase.
 void setAutoChargeBalance(java.lang.String _phaseLabel, boolean _val)
          Sets the autoChargeBalance property for the indicated phase.
 void setDensity(java.lang.String _phaseLabel, double _density)
          Sets the density (in grams/mL) of the Phase.
 void setDisplayFitIterations(boolean _displayIterations)
          If true, the results of each iteration in the fit method are displayed on the Java console.
 void setDisplayFitResults(boolean _displayResults)
          If true, the final results of the fit method are displayed on the Java console.
 void setDisplayIterations(boolean _displayIterations)
          If true, the results of each iteration in the solve method are displayed on the Java console.
 void setDisplayLinearSystem(boolean _displayLinearSystem)
          If true, the linear system of equations are displayed on the Java console at each iteration of the solve method.
 void setDisplayResults(boolean _displayResults)
          If true, the final results of the solve method are displayed on the Java console.
 void setDisplayTime(boolean _displayTime)
          If true, the time (in seconds) required to solve the equilibrium problem is displayed on the Java console (but only if the calculation was successful).
 void setEquationTolerance(double _eqnTol)
          Sets the convergence tolerance for functions used in the solve method.
 void setFitChiSqTolerance(double _tol)
          Sets the relative tolerance for the minimization of chi-square in the curve-fitting procedure.
 void setFitTolerance(double _tol)
          Sets the relative tolerance for parameters (ln K or ln n) in the curve-fitting procedure.
 void setIonSize(java.lang.String _label, double _ionSize)
          Sets the ion-size parameter (used in the Extended Debye-Huckel Equation) for the chemical species.
 void setIsIdeal(boolean _isIdeal)
          Sets the isIdeal property.
 void setIsIsobaric(boolean _isIsobaric)
          Sets the isIsobaric property.
 void setK(java.lang.String _label, double _K)
          Sets the equilibrium constant for the reaction identified by the label.
 void setLambda(double _lambda)
          Sets the initial value of lambda, which controls the transition from the steepest-descent to Hessian methods in the Levenberg-Marquardt algorithm.
 void setLambdaScaleFactor(double _factor)
          Sets the lambda scaling factor.
 void setMaxCnt(int _maxCnt)
          Sets the maximum number of iterations to be used in solving the nonlinear system of equations in the solve method.
 void setMaxInc(double _maxInc)
          Sets the maximum amount a variable can change during a single iteration in the solve method.
 void setMonitor(java.lang.String _chemSpecies)
          Sets the species whose pX value is monitored during a titration
 void setMonitor(java.lang.String _label, java.lang.String _refLabel)
          Sets the electrodes whose potential is monitored during a titration.
 void setPressure(double _pressure)
          Sets the pressure (in atm) of the system.
 void setReferenceTemperature(double _temperature)
          Sets the reference potential for all reactions and half-reaction.
 void setReferenceTemperature(java.lang.String _label, double _temperature)
          Sets the reference potential for a reaction or half-reaction.
 void setStandardDeviation(double _std)
          Sets the standard deviation for pX values for the curve-fitting procedure.
 void setSVDThreshold(double _svdThreshold)
          Sets the threshold value in the solve method for setting the diagonal elements from svd to zero.
 void setTargetIncrement(double _target)
          Sets the target change for pX or E in a titration.
 void setTemperature(double _temperature)
          Sets the temperature (in Kelvin) of the system.
 void setTemperatureDependence(java.lang.String _rxnLabel, double _a, double _b)
          Sets the parameters controlling the temperature-dependence of the equilibrium constant for a reaction.
 void setTemperatureDependence(java.lang.String _rxnLabel, double _a, double _b, double _c)
          Sets the parameters used to determine the temperature-dependence of the standard potential for a half-reaction.
 void setTolerance(double _tol)
          Sets the relative tolerance in the solve method for convergence of the amounts of each species.
 void setUsePrevious(boolean _usePrevious)
          Sets the usePrevious property for the solve method.
 void setVolume(java.lang.String _phaseLabel, double _volume)
          Sets the volume (in liters) of the phase
 boolean solve()
          Solves the equilibrium problem.
 void start()
           
 void stop()
           
protected  boolean submitData()
          Submits experimental data to a titration object
 void transferSolution(java.lang.String _solution1, java.lang.String _solution2, double _volume)
          Transfers a volume of Solution 1 to Solution 2.
 
Methods inherited from class java.applet.Applet
getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChemEquilibria

public ChemEquilibria()
Method Detail

getNbrMassBalance

public int getNbrMassBalance()
Returns the number of mass balance equations for the system


getNbrParseMessages

public int getNbrParseMessages()
Returns the number of messages from the last parse operation


getNbrPoints

public int getNbrPoints()
Returns the number of points in the calculated titration curve


getPar

public double getPar(int _idx)
Returns the parameter with index _idx. The parameters are numbered in the order defined, with reactions listed before species. The first parameter has index 0. For Reactions, the parameter is K and for Species the parameter is n.


getParStd

public double getParStd(int _idx)
Returns the standard deviation of parameter with index _idx. The parameters a numbered in the order defined, with reactions listed before species. The first parameter has index 0. For Reactions, the parameter is K and for Species the parameter is n.


getParameter

public java.lang.String getParameter(java.lang.String key,
                                     java.lang.String def)

init

public void init()
Overrides:
init in class java.applet.Applet

start

public void start()
Overrides:
start in class java.applet.Applet

stop

public void stop()
Overrides:
stop in class java.applet.Applet

destroy

public void destroy()
Overrides:
destroy in class java.applet.Applet

getAppletInfo

public java.lang.String getAppletInfo()
Overrides:
getAppletInfo in class java.applet.Applet

getParameterInfo

public java.lang.String[][] getParameterInfo()
Overrides:
getParameterInfo in class java.applet.Applet

addAcidBaseSpecies

public void addAcidBaseSpecies(java.lang.String _baseLabel,
                               double _baseCharge,
                               double _baseFW,
                               int _n,
                               java.lang.String _solutionLabel,
                               double _moles)
Creates a series of acid-base species and adds the species to a solution. The solution must have been previously created. The same amount of each of the chemical species is added to the solution. Most typically, one would add zero moles of each species and then use the addSpecies, setAnalConc, or setAnalMoles method to set the amount of the species actually added to the solution.

The _baseLabel is the label for the fully deprotonated base, and the _baseCharge is the charge on the fully deprotonated base. If _baseLabel = "base", _charge = -1, and _n = 3, four chemical species are created with labels "base-1", "Hbase", "H2base+1", and "H3base+2".

The method searches for pre-existing chemical species with the same label. If such a chemical species is found, the pre-existing chemical species is used.

Parameters:
_solutionLabel - label identifying the solution phase
_moles - analytical moles of each chemical species to be added
_baseLabel - label for the fully deprotonated base
_baseCharge - charge on the fully deprotonated base
_baseFW - formula weight of the fully deprotonated base
_n - number of acidic protons on fully protonated acid
See Also:
setAnalConc(java.lang.String, java.lang.String, double), setAnalMoles(java.lang.String, java.lang.String, double), addSpecies(java.lang.String, java.lang.String, double)

addComplexes

public void addComplexes(java.lang.String _metalLabel,
                         double _metalCharge,
                         double _metalFW,
                         java.lang.String _ligandLabel,
                         double _ligandCharge,
                         double _ligandFW,
                         int _n,
                         java.lang.String _solutionLabel,
                         double _moles)
Creates a series of metal-ligand complexes and adds the species to a solution. The solution must have been previously created. The same amount of each of the chemical species is added to the solution. Most typically, one would add zero moles of each species and then use the addSpecies, setAnalConc, or setAnalMoles method to set the amount of the species actually added to the solution.

If _metalLabel = "Cu", _metalCharge = +1, _ligandLabel = "L", _ligandCharge = -1, and _n = 4, six chemical species are created with labels "L-", "Cu+2", "CuL-", "Cu(L)2", "Cu(L)3-", and "Cu(L)4-2".

The method searches for pre-existing chemical species with the same label. If such a chemical species is found, the pre-existing chemical species is used.

Parameters:
_solutionLabel - label identifying the solution phase
_moles - analytical moles of each chemical species to be added
_metalLabel - label for the free metal
_metalCharge - charge on the free metal
_metalFW - formula weight of the free metal
_ligandLabel - label for the free ligand
_ligandCharge - charge on the free ligand
_ligandFW - formula weight of the free ligand
_n - number of ligands on the fully complexed metal
See Also:
setAnalConc(java.lang.String, java.lang.String, double), setAnalMoles(java.lang.String, java.lang.String, double), addSpecies(java.lang.String, java.lang.String, double)

addDatum

public void addDatum(double _Vt,
                     double _pX)
Adds a Vt, pX data point to the data set. Vt is the volume of titrant added in mL. pX is -log10(activity) of the indicator species in the sample solution. The standard deviation for the pX value is the value set by the setStandardDeviation method (default is 0.03).


addDatum

public void addDatum(double _Vt,
                     double _pX,
                     double _std)
Adds a Vt, pX data point to the data set. Vt is the volume of titrant added in mL. pX is -log10(activity) of the indicator species in the sample solution. The standard deviation for the pX value is the value set by the setStandardDeviation method (default is 0.03).


addHalfReaction

public boolean addHalfReaction(java.lang.String _label,
                               java.lang.String _rxn,
                               double _Eo)
Creates a half-reaction and adds it to the chemical system. The species involved in the half-reaction must have been previously added to the chemical system. The half-reaction, which must be balanced with respect to charge, is described by a string containing the chemical equation in the format shown in the following example.

Ni+2 (aq) + 2 e- (Pt) = Ni (s)

The syntax rules are the same as those describe for the addReaction method, with the following additional considerations:

  • The equation must use "e-" to represent an electron.
  • The reaction may be written as either a reduction or an oxidation. In either event, the standard potential must apply to the reaction as written.
  • The phase associated with the electron identifies the electrode where this half-reaction occurs. If this phase is omitted, it will not be possible to get the potential of the electrode, though it will be possible to retrieve the potential for this half-reaction.

The standard potential is the value at the reference temperature. The program automatically adjusts this value for other temperatures using the standard entropy of reaction. By default the standard entropy of reaction is zero, which makes the standard potential independent of temperature.

Parameters:
_label - descriptive label used to identify the reaction
_rxn - string representation of the reaction
_Eo - standard potential in volts at the reference temperature
Returns:
true if operation is successful
See Also:
addReaction(java.lang.String, java.lang.String, double), setTemperatureDependence(java.lang.String, double, double)

addPar

public void addPar(java.lang.String _type,
                   java.lang.String _label,
                   java.lang.String _phaseLabel)
Adds a parameter to be optimized in the curve-fitting procedure. The argument _type describes the type of parameter being added.

_type = 'R' indicates a Reaction and _label is the label for the Reaction. The curve-fitting procedure optimizes the equilibrium constant for the Reaction. The _phaseLabel is not used, but a dummy value must be provided.

_type = 'S' indicates a Species (or ChemSpecies) in either the titrant or sample solution. The curve-fitting procedure optimizes the analytical moles of this species. The _label is the Species or ChemSpecies label and the _phaseLabel is the label for the phase containing the Species.


addReaction

public boolean addReaction(java.lang.String _label,
                           java.lang.String _rxn,
                           double _K)
Creates a chemical reaction and adds it to the chemical system. The species involved in the reaction must have been previously added to the chemical system. The reaction, which must be balanced with respect to charge, is described by a string containing the chemical equation in the format shown in the following example.

Ni+2 (aq) + 4 CN- (aq) = Ni(CN)4-2 (aq)

The following syntax rules apply:

  • The equilibrium arrows are represented by " = "; note there is a space on each side of the = sign.
  • Species on the same side of the equilibrium arrows are separated by " + "; note there is a space on each side of the + sign.
  • Each species term consists of a stoichiometric coefficient (optional), a species label, and a phase (optional).
  • If no stoichiometric coefficient is supplied, a value of one is used.
  • The format of the label is unimportant, except the label may not begin with a number nor may it contain a space.
  • The phase must be enclosed in parentheses with no enclosed spaces.
  • If a phase is supplied, the method attempts to locate a phase with this label. The method searches for a species with the appropriate label in this phase.
  • If no phase is supplied, the method searches for any species in the entire chemical system with the appropriate label. If multiple species have the same label (but presumably are in different phases), one must specify the phase in order to make sure the correct species is used. Alternatively one should avoid using duplicate species labels.

The thermodynamic equilibrium constant is the value at reference temperature. The program automatically adjusts this value for other temperatures using the standard enthalpy of reaction and standard heat capacity change for the reaction. By default these values are zero, which makes the equilibrium constant independent of temperature.

Parameters:
_label - descriptive label used to identify the reaction
_rxn - string representation of the reaction
_K - thermodynamic equilibrium constant at reference temperature
Returns:
true if operation is successful
See Also:
setTemperatureDependence(java.lang.String, double, double)

addSpecies

public void addSpecies(java.lang.String _speciesLabel,
                       java.lang.String _phaseLabel,
                       double _moles)
Adds the specified amount of a ChemSpecies to a Phase. The ChemSpecies and the Phase must have been previously created.

Parameters:
_phaseLabel - label identifying the phase
_speciesLabel - label identifying the species
_moles - moles of the species to be added
See Also:
createSolidPhase(java.lang.String, java.lang.String, double), createSolutionPhase(java.lang.String, java.lang.String, double), createGasPhase(java.lang.String, double), createLiquidPhase(java.lang.String, java.lang.String, double), createAqueousPhase(java.lang.String, double), createChemSpecies(java.lang.String, double, double)

addSpecies

public void addSpecies(java.lang.String _speciesLabel,
                       double _charge,
                       java.lang.String _phaseLabel,
                       double _moles)
Adds the specified amount of a ChemSpecies to a Phase. If a ChemSpecies with the given label exists, it will be added to the Phase. Otherwise a new ChemSpecies is created. In either case the Phase must have been previously created.

If a new ChemSpecies is created, the formula weight is set to 100.0

Parameters:
_phaseLabel - label identifying the phase
_charge - charge on the ChemSpecies
_speciesLabel - label identifying the species
_moles - moles of the species to be added
See Also:
createSolidPhase(java.lang.String, java.lang.String, double), createSolutionPhase(java.lang.String, java.lang.String, double), createGasPhase(java.lang.String, double), createLiquidPhase(java.lang.String, java.lang.String, double), createAqueousPhase(java.lang.String, double), createChemSpecies(java.lang.String, double, double)

apply

public void apply()
Applies the best-fit parameters from the last curve-fitting procedure to the Reaction and Species objects.


calculate

public void calculate(double _finalVolume)
Calculates a theoretical titration curve

Parameters:
_finalVolume - final volume (in mL) of titrant to be added
See Also:
createTitration(java.lang.String, java.lang.String)

clear

public void clear()
Clears the entire chemical system and resets the properties for a new calculation. This method does not remove previously defined ChemSpecies.


clearData

public void clearData()
Clears the data to be fit in the curve-fitting procedure.


clearParameters

public void clearParameters()
Clears the parameters to be optimized in the curve-fitting procedure.


createAqueousPhase

public void createAqueousPhase(java.lang.String _solutionLabel,
                               double _volume)
Creates an aqueous solution phase. The chemical species H+, OH-, and H2O are already defined.

Parameters:
_solutionLabel - descriptive label for the solution phase
_volume - volume in liters of the solution
See Also:
createChemSpecies(java.lang.String, double, double)

createChemSpecies

public void createChemSpecies(java.lang.String _label,
                              double _charge,
                              double _fw)
Creates a new ChemSpecies. Because chemical species are identified by the label, it is important that no two species have the same label. If a ChemSpecies with the same label already exists, the properties of that ChemSpecies are changed to the values indicated.

Parameters:
_label - descriptive label used to identify the chemical species
_charge - species charge
_fw - species formula weight (g/mole)

createGasPhase

public void createGasPhase(java.lang.String _gasLabel,
                           double _volume)
Creates a gas phase containing no species (i.e., a vacuum).

Parameters:
_gasLabel - descriptive label used to identify the gas
_volume - volume of the phase (a fixed value if isIsobaric is false)
See Also:
createChemSpecies(java.lang.String, double, double)

createLiquidPhase

public void createLiquidPhase(java.lang.String _liquidLabel,
                              java.lang.String _speciesLabel,
                              double _moles)
Creates a liquid phase (pure substance). The ChemSpecies making up the solid must have been previously created.

Parameters:
_liquidLabel - descriptive label used to identify the phase
_speciesLabel - label of the ChemSpecies making up the liquid
_moles - analytical moles of liquid to be formed
See Also:
createChemSpecies(java.lang.String, double, double)

createSolidPhase

public void createSolidPhase(java.lang.String _solidLabel,
                             java.lang.String _speciesLabel,
                             double _moles)
Creates a solid phase (pure substance). The ChemSpecies making up the solid must have been previously created.

Parameters:
_solidLabel - descriptive label used to identify the phase
_speciesLabel - label of the ChemSpecies making up the solid
_moles - analytical moles of solid to be formed
See Also:
createChemSpecies(java.lang.String, double, double)

createSolutionPhase

public void createSolutionPhase(java.lang.String _solutionLabel,
                                java.lang.String _solventLabel,
                                double _volume)
Creates an aprotic solution phase. The ChemSpecies making up the solvent must have been previously created.

Parameters:
_solutionLabel - descriptive label for the solution phase
_solventLabel - label identifying the solvent species
_volume - volume in liters of the solution
See Also:
createChemSpecies(java.lang.String, double, double)

createSolutionPhase

public void createSolutionPhase(java.lang.String _solutionLabel,
                                java.lang.String _solventLabel,
                                double _Kauto,
                                double _volume)
Creates a protic solution phase. The ChemSpecies making up the solvent must have been previously created. The conjugate acid and base of the solvent are automatically created. If the solvent has label "solv", the conjugate acid species has label "acid_solv" and the conjugate base species has label "base_solv".

Parameters:
_solutionLabel - descriptive label for the solution phase
_solventLabel - label identifying the solvent species
_volume - volume in liters of the solution
_Kauto - autodissociation constant for the solvent
See Also:
createChemSpecies(java.lang.String, double, double)

createSolutionPhase

public void createSolutionPhase(java.lang.String _solutionLabel,
                                java.lang.String _solventLabel,
                                java.lang.String _acidLabel,
                                java.lang.String _baseLabel,
                                double _Kauto,
                                double _volume)
Creates a protic solution phase. The ChemSpecies making up the solvent and its conjugate acid and base must have been previously created.

Parameters:
_solutionLabel - descriptive label for the solution phase
_solventLabel - label identifying the solvent species
_acidLabel - label identifying the solvent conjugate acid species
_baseLabel - label identifying the solvent conjugate base species
_volume - volume in liters of the solution
_Kauto - autodissociation constant for the solvent
See Also:
createChemSpecies(java.lang.String, double, double)

createTitration

public void createTitration(java.lang.String _titrantLabel,
                            java.lang.String _sampleLabel)
Create a Titration object using the current chemical system. The user must identify the titrant and sample solution phases (which must be solutions based upon the same solvent).


fit

public boolean fit()
Performs the curve-fitting procedure for titration data. The user must have previously created the titration object and defined the parameters and data. This method does not return a value. The getPar and getParStd methods may be used to retrieve the results. Returns true if the curve-fitting procedure was successful.

See Also:
addDatum(double, double), addPar(java.lang.String, java.lang.String, java.lang.String), clearData(), clearParameters(), createTitration(java.lang.String, java.lang.String), setStandardDeviation(double)

getActivity

public double getActivity(java.lang.String _speciesLabel,
                          java.lang.String _phaseLabel)
Returns the activity of the ChemSpecies in the Phase. The equilibrium problem should be solved before calling this method.

Parameters:
_phaseLabel - label identifying the phase
_speciesLabel - label identifying the species
See Also:
solve()

getAnalMoles

public double getAnalMoles(java.lang.String _speciesLabel,
                           java.lang.String _phaseLabel)
Returns the analytical moles of the ChemSpecies in the Phase.

Parameters:
_phaseLabel - label identifying the phase
_speciesLabel - label identifying the species

getAnalConc

public double getAnalConc(java.lang.String _speciesLabel,
                          java.lang.String _phaseLabel)
Returns the analytical molar concentration of the ChemSpecies in the Phase.

Parameters:
_phaseLabel - label identifying the phase
_speciesLabel - label identifying the species

getChargeBalance

public java.lang.String getChargeBalance(java.lang.String _phaseLabel)
Returns a string representing the charge balance equation for indicated phase. Returns null if the phase is not a solution or the phase does not exist.


getChiSq

public double getChiSq()
Returns the chi-square value for the last curve-fitting procedure.


getConc

public double getConc(java.lang.String _speciesLabel,
                      java.lang.String _phaseLabel)
Returns the molar concentration of the ChemSpecies in the Phase. The equilibrium problem should be solved before calling this method.

Parameters:
_phaseLabel - label identifying the phase
_speciesLabel - label identifying the species
See Also:
solve()

getDensity

public double getDensity(java.lang.String _phaseLabel)
Returns the density (in grams/mL) of the Phase. The equilibrium problem should be solved before calling this method for a gas phase if the gas phase has a fixed volume.

Parameters:
_phaseLabel - label identifying the phase
See Also:
solve()

getDerivative

public double getDerivative(int _n)
Returns the derivative of an experimental titration curve at the _n-th point.


getDerivative2

public double getDerivative2(int _n)
Returns the second derivative of an experimental titration curve at the _n-th point.


getGoodnessOfFit

public double getGoodnessOfFit()
Returns the goodness-of-fit for the curve-fitting procedure. This value is only meaningful if the standard deviations for the experimental points are accurate.


getHalfReactionPotential

public double getHalfReactionPotential(java.lang.String _rxnLabel)
Returns the potential in volts for the half-reaction. This method should be called after the equilibrium problem has been solved.

Parameters:
_rxnLabel - label identifying the half-reaction
See Also:
addHalfReaction(java.lang.String, java.lang.String, double), solve()

getIonicStrength

public double getIonicStrength(java.lang.String _phaseLabel)
Returns the ionic strength of the phase in mole/L.

Parameters:
_phaseLabel - label identifying the phase
See Also:
solve()

getK

public double getK(java.lang.String _label)
Returns the equilibrium constant for the reaction at the reference temperature


getK

public double getK(java.lang.String _label,
                   double _temperature)
Returns the equilibrium constant for the reaction at the indicated temperature


getMass

public double getMass(java.lang.String _speciesLabel,
                      java.lang.String _phaseLabel)
Returns the actual mass (in grams) of ChemSpecies in the Phase. The equilibrium problem should be solved before calling this method.

Parameters:
_phaseLabel - label identifying the phase
_speciesLabel - label identifying the species
See Also:
solve()

getMassBalance

public java.lang.String getMassBalance(int idx)
Returns a string containing the mass balance equation

Parameters:
idx - number of the mass balance equation

getMinValue

public double getMinValue()
Returns the minimum positive value for the moles of any species. If the equilibrium solution of a problem requires an amount closer to or smaller than this value, the solve method will not be able to find a solution.


getMoles

public double getMoles(java.lang.String _speciesLabel,
                       java.lang.String _phaseLabel)
Returns the actual moles of ChemSpecies in the Phase. The equilibrium problem should be solved before calling this method.

Parameters:
_phaseLabel - label identifying the phase
_speciesLabel - label identifying the species
See Also:
solve()

getParseMessage

public java.lang.String getParseMessage(int _n)
Returns message _n from the last analysis of the chemical system using the parse method.

See Also:
parse()

getMessages

public java.lang.String[] getMessages()
Returns an array of strings containing messages from the last analysis of the chemical system using the parse method.

See Also:
parse()

getPotential

public double getPotential(java.lang.String _phaseLabel)
Returns the potential in volts for the indicated electrode. This method should be called after the equilibrium problem has been solved.

Parameters:
_phaseLabel - label identifying the electrode phase
See Also:
solve()

getpH

public double getpH(java.lang.String _phaseLabel)
Returns the pH of the phase. Has no meaning unless the phase is a solution with a protic solvent. This method should be called after the equilibrium problem has been solved.

Parameters:
_phaseLabel - label identifying the phase
See Also:
solve()

getpK

public double getpK(java.lang.String _label)
Returns pK for the reaction at the reference temperature


getpK

public double getpK(java.lang.String _label,
                    double _temperature)
Returns pK for the reaction at the indicated temperature


getpOH

public double getpOH(java.lang.String _phaseLabel)
Returns the pOH of the phase. Has no meaning unless the phase is a solution with a protic solvent. This method should be called after the equilibrium problem has been solved.

See Also:
solve()

getPotential

public double getPotential(java.lang.String _phase1Label,
                           java.lang.String _phase2Label)
Returns the potential in volts for the indicated cell. The potential is the potential of electrode 1 minus that of electrode 2. This method should be called after the equilibrium problem has been solved.

Parameters:
_phase1Label - label identifying the electrode1 phase
_phase2Label - label identifying the electrode2 phase
See Also:
solve()

getPressure

public double getPressure(java.lang.String _phaseLabel)
Returns the pressure (in atm) of the Phase. The equilibrium problem should be solved before calling this method. If the species is not a gas, the system pressure is returned.

Parameters:
_phaseLabel - label identifying the phase
See Also:
solve()

getPressure

public double getPressure(java.lang.String _speciesLabel,
                          java.lang.String _phaseLabel)
Returns the partial pressure (in atm) of the ChemSpecies in the Phase. The equilibrium problem should be solved before calling this method. If the species is not a gas, the system pressure is returned.

Parameters:
_phaseLabel - label identifying the phase
_speciesLabel - label identifying the species
See Also:
solve()

getStandardPotential

public double getStandardPotential(java.lang.String _label,
                                   double _temperature)
Returns the standard potential for the half-reaction at the indicated temperature


getTemperature

public double getTemperature()
Returns the absolute temperature of the system.


getTitrationValue

public double getTitrationValue(int _index)
Gets the pX or E value in a calculated titration curve


getVolume

public double getVolume(java.lang.String _phaseLabel)
Returns the actual volume (in liters) of the phase. The equilibrium problem should be solved before calling this method.

Parameters:
_phaseLabel - label identifying the phase
See Also:
solve()

getVolumeTitrant

public double getVolumeTitrant(int _index)
Gets the volume (in mL) of titrant added in a calculated titration curve


loadLibrary

public void loadLibrary(java.lang.String _url)
Creates all ChemSpecies defined in a library file. If the library contains an entry for an existing ChemSpecies, the properties of the ChemSpecies are modified to be consistent with the library contents. Libraries should thus be loaded before user-defined ChemSpecies are created.

The library file is a text (ASCII) file in which each line describes the properties of a single ChemSpecies. The syntax is

label, charge, formula weight[, ion-size parameter];

All information after the ; is disregarded, and all spaces are disregarded.

Parameters:
_url - URL for the library

parse

public boolean parse()
Parses the chemical system to identify possible problems. Returns true if no problems are found.

See Also:
solve()

removeHalfReaction

public void removeHalfReaction(java.lang.String _label)
Removes the half-reaction from the chemical system

Parameters:
_label - label identifying the half-reaction

removePhase

public void removePhase(java.lang.String _label)
Removes the phase from the chemical system.

Parameters:
_label - label identifying the phase

removeReaction

public void removeReaction(java.lang.String _label)
Removes the reaction from the chemical system

Parameters:
_label - label identifying the reaction

removeSpecies

public void removeSpecies(java.lang.String _speciesLabel,
                          java.lang.String _phaseLabel)
Removes the species from the phase.

Parameters:
_phaseLabel - label identifying the phase
_speciesLabel - label identifying the species

setAnalConc

public void setAnalConc(java.lang.String _speciesLabel,
                        java.lang.String _phaseLabel,
                        double _conc)
Sets the analytical concentration (mole/L) of the ChemSpecies

Parameters:
_phaseLabel - label identifying the phase, which must be a solution
_speciesLabel - label identifying the chemical species
_conc - analytical concentration of species in solution in mole/L

setAnalMass

public void setAnalMass(java.lang.String _speciesLabel,
                        java.lang.String _phaseLabel,
                        double _mass)
Sets the analytical mass (in grams) of the ChemSpecies in the Phase.

Parameters:
_phaseLabel - label identifying the phase
_speciesLabel - label identifying the species
_mass - analytical mass in grams of species in phase

setAnalMoles

public void setAnalMoles(java.lang.String _speciesLabel,
                         java.lang.String _phaseLabel,
                         double _moles)
Sets the analytical moles of the ChemSpecies in the Phase.

Parameters:
_phaseLabel - label identifying the phase
_speciesLabel - label identifying the species
_moles - analytical moles of species in phase

setAnalPressure

public void setAnalPressure(java.lang.String _speciesLabel,
                            java.lang.String _phaseLabel,
                            double _pressure)
Sets the analytical partial pressure of the ChemSpecies in the Phase.

Parameters:
_phaseLabel - label identifying the phase
_speciesLabel - label identifying the species
_pressure - analytical partial pressure of species in phase

setAutoChargeBalance

public void setAutoChargeBalance(java.lang.String _phaseLabel,
                                 boolean _val)
Sets the autoChargeBalance property for the indicated phase. If true, the Equilibria object will automatically create a counter-ion species with the label "X+" or "X-" and analytical moles that results in an electrically neutral phase.

Parameters:
_phaseLabel - label identifying the phase

setDensity

public void setDensity(java.lang.String _phaseLabel,
                       double _density)
Sets the density (in grams/mL) of the Phase. The density of a gas phase cannot be directly altered, because it is a consequence of the gas volume and the amounts of material in the gas. Changing the density of condensed phases changes the volume without change the number of moles or mass.

Parameters:
_phaseLabel - label identifying the phase
_density - density in grams/mL of the phase

setDisplayFitIterations

public void setDisplayFitIterations(boolean _displayIterations)
If true, the results of each iteration in the fit method are displayed on the Java console. This method must be called after createTitration

See Also:
fit(), createTitration(java.lang.String, java.lang.String)

setDisplayFitResults

public void setDisplayFitResults(boolean _displayResults)
If true, the final results of the fit method are displayed on the Java console. This method must be called after createTitration

See Also:
fit(), createTitration(java.lang.String, java.lang.String)

setDisplayIterations

public void setDisplayIterations(boolean _displayIterations)
If true, the results of each iteration in the solve method are displayed on the Java console.

See Also:
solve()

setDisplayLinearSystem

public void setDisplayLinearSystem(boolean _displayLinearSystem)
If true, the linear system of equations are displayed on the Java console at each iteration of the solve method.

See Also:
solve()

setDisplayResults

public void setDisplayResults(boolean _displayResults)
If true, the final results of the solve method are displayed on the Java console.

See Also:
solve()

setDisplayTime

public void setDisplayTime(boolean _displayTime)
If true, the time (in seconds) required to solve the equilibrium problem is displayed on the Java console (but only if the calculation was successful).


setEquationTolerance

public void setEquationTolerance(double _eqnTol)
Sets the convergence tolerance for functions used in the solve method. This value is the "relative" uncertainty permitted when determining if the original system of equations are satisfied. The default is 1.0E-8

See Also:
solve()

setFitChiSqTolerance

public void setFitChiSqTolerance(double _tol)
Sets the relative tolerance for the minimization of chi-square in the curve-fitting procedure. Default is 0.001


setFitTolerance

public void setFitTolerance(double _tol)
Sets the relative tolerance for parameters (ln K or ln n) in the curve-fitting procedure. Default is 1E-5


setIonSize

public void setIonSize(java.lang.String _label,
                       double _ionSize)
Sets the ion-size parameter (used in the Extended Debye-Huckel Equation) for the chemical species.

Parameters:
_label - label of the chemical species
_ionSize - ion-size parameter in angstroms

setIsIdeal

public void setIsIdeal(boolean _isIdeal)
Sets the isIdeal property. If true, all activity coefficients are set to unity. If false, activity coefficients are calculated.


setIsIsobaric

public void setIsIsobaric(boolean _isIsobaric)
Sets the isIsobaric property. If true, the pressures of all gas phases are held at a constant value by adjusting the volumes of the gases. If false, the volumes of gas phases is fixed and the pressures may vary.


setK

public void setK(java.lang.String _label,
                 double _K)
Sets the equilibrium constant for the reaction identified by the label.


setLambda

public void setLambda(double _lambda)
Sets the initial value of lambda, which controls the transition from the steepest-descent to Hessian methods in the Levenberg-Marquardt algorithm. Default is 0.001


setLambdaScaleFactor

public void setLambdaScaleFactor(double _factor)
Sets the lambda scaling factor. When an improved solution is found, lambda is multiplied by this factor. When a poorer solution is found, lambda is divided by this factor. The smaller the factor, the more rapidly the Levenberg-Marquardt algorithm shifts to the standard Hessian method. The factor must satisfy 0 < _factor < 1.0. Default is 0.1


setMaxCnt

public void setMaxCnt(int _maxCnt)
Sets the maximum number of iterations to be used in solving the nonlinear system of equations in the solve method. The default is 50.

See Also:
solve()

setMaxInc

public void setMaxInc(double _maxInc)
Sets the maximum amount a variable can change during a single iteration in the solve method. The variable is the natural logarithm of the number of moles. The default is 10.

See Also:
solve()

setMonitor

public void setMonitor(java.lang.String _chemSpecies)
Sets the species whose pX value is monitored during a titration

Parameters:
_chemSpecies - label identifying the chemical species

setMonitor

public void setMonitor(java.lang.String _label,
                       java.lang.String _refLabel)
Sets the electrodes whose potential is monitored during a titration. The value of _label identifies the electrode (a phase) whose potential is to be monitored. And _refLabel identifies the electrode (a phase) that serves as the reference electrode. If _refLabel is null, only the half-cell potential is monitored.


setPressure

public void setPressure(double _pressure)
Sets the pressure (in atm) of the system.


setReferenceTemperature

public void setReferenceTemperature(double _temperature)
Sets the reference potential for all reactions and half-reaction.


setReferenceTemperature

public void setReferenceTemperature(java.lang.String _label,
                                    double _temperature)
Sets the reference potential for a reaction or half-reaction. Each reaction may have its own reference temperature. The method first searches for a reaction with the indicated label. If none is found, it then searches for a half-reaction.


setStandardDeviation

public void setStandardDeviation(double _std)
Sets the standard deviation for pX values for the curve-fitting procedure. If the standard deviation for a point is not explicitly defined in the setDatum method, this value is used. Default is 0.03


setSVDThreshold

public void setSVDThreshold(double _svdThreshold)
Sets the threshold value in the solve method for setting the diagonal elements from svd to zero. If the product of the svdThreshold and the matrix condition number exceeds unity, the smallest diagonal element is identified and set to zero. Rows for which the diagonal elements are zero are disregarded in solving the linear system. Default is 1E-30

See Also:
solve()

setTargetIncrement

public void setTargetIncrement(double _target)
Sets the target change for pX or E in a titration. This method must be called after the setMonitor method, which sets the target value to its default setting.


setTemperature

public void setTemperature(double _temperature)
Sets the temperature (in Kelvin) of the system. The system is isothermal.


setTemperatureDependence

public void setTemperatureDependence(java.lang.String _rxnLabel,
                                     double _a,
                                     double _b)
Sets the parameters controlling the temperature-dependence of the equilibrium constant for a reaction. The equilibrium constant at temperature T is K(T), which is given by

ln[K(T)/K] = a(1/T - 1/Tref) + b ln[T/Tref]

Tref is the reference potential

By default, a = b = 0, which produces a temperature-independent equilibrium constant.

Parameters:
_rxnLabel - label identifying the reaction
See Also:
addReaction(java.lang.String, java.lang.String, double)

setTemperatureDependence

public void setTemperatureDependence(java.lang.String _rxnLabel,
                                     double _a,
                                     double _b,
                                     double _c)
Sets the parameters used to determine the temperature-dependence of the standard potential for a half-reaction. 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.

Parameters:
_rxnLabel - label identifying the reaction
See Also:
addHalfReaction(java.lang.String, java.lang.String, double)

setTolerance

public void setTolerance(double _tol)
Sets the relative tolerance in the solve method for convergence of the amounts of each species. The default is 1E-5

See Also:
solve()

setUsePrevious

public void setUsePrevious(boolean _usePrevious)
Sets the usePrevious property for the solve method. If usePrevious is true, the existing amounts of each species are used as seed values in the current calculation. If usePrevious is false, the amounts of each species are set to their analytical values. In either case, values of zero are replaced with a nonzero starting value.

See Also:
solve()

setVolume

public void setVolume(java.lang.String _phaseLabel,
                      double _volume)
Sets the volume (in liters) of the phase


solve

public boolean solve()
Solves the equilibrium problem. Returns true if the solution was obtained; a value of false indicates a problem.


transferSolution

public void transferSolution(java.lang.String _solution1,
                             java.lang.String _solution2,
                             double _volume)
Transfers a volume of Solution 1 to Solution 2. The two solutions must have the same solvent. Homogeneous reactions in Solution 1 are also created for Solution 2, if necessary.


submitData

protected boolean submitData()
Submits experimental data to a titration object


getChemSpecies

protected ChemSpecies getChemSpecies(java.lang.String _label)
Returns the ChemSpecies


deleteChemSpecies

protected void deleteChemSpecies(java.lang.String _label)
Deletes the ChemSpecies


parseLine

protected ChemSpecies parseLine(java.lang.String _data)
Parses a line from the ChemSpecies library and returns a new ChemSpecies based upon the content of the line. If the line does not contain valid information, null is returned.