|
Equilibria |
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--edu.davidson.chm.equilibria.Titration
The Titration class describes a titration. The user supplies a ChemSystem and identifies a titrant and a sample solution. The class provides methods for generating a titration curve and for fitting experimental data by optimization of equilibrium constants and/or analytical concentrations.
Copyright 2001 David N. Blauch
| Constructor Summary | |
Titration()
|
|
Titration(ChemSystem _chemSystem,
java.lang.String _titrantLabel,
java.lang.String _sampleLabel)
The Titration object models a titration. |
|
| Method Summary | |
void |
addReaction(Reaction _rxn)
Adds a reaction to the collection of reactions whose equilibrium constants are to be determined by the curve-fitting procedure. |
void |
addSpecies(Species _species)
Adds a species to the collection of species whose analytical moles are to be determined by the curve-fitting procedure. |
void |
apply()
Applies the best-fit parameters to the original ChemSystem. |
double[] |
calc(double[] _Vt)
Calculates a titration curve at the titrant volumes contained in _Vt. |
double[][] |
calcCurve(double _finalVol)
Calculates the titration curve. |
void |
clearReactions()
Clears all reactions to be used in the curve-fitting procedure |
void |
clearSpecies()
Clears all species to be used in the curve-fitting procedure |
boolean |
fit()
Performs the curve-fitting procedures. |
double |
getChiSq()
Returns the chi-squared value |
double[][] |
getCovariance()
Returns the covariance matrix from the last execution of the fit method. |
double |
getDerivative(int _idx)
Returns the derivative of the titration curve at the indicated index. |
double |
getDerivative2(int _idx)
Returns the second derivative of the titration curve at the indicated index. |
double |
getGoodnessOfFit()
Returns the goodness-of-fit |
java.lang.String |
getInfo()
Returns information about this class |
double[] |
getPar()
Returns an array containing the current values of the parameters from the last execution of the fit method. |
double[] |
getParStd()
Returns an array containing the standard deviations of the parameters from the last execution of the fit method. |
void |
setChiSqTolerance(double _tol)
Sets the relative tolerance for chi-square. |
void |
setData(double[] _Vt,
double[] _Y)
Sets the experimental data to be fit. |
void |
setData(double[] _Vt,
double[] _Y,
double[] _std)
Sets the experimental data to be fit. |
void |
setDisplayIterations(boolean _val)
If true, the iteration results at each step of the curve-fitting procedure are displayed. |
void |
setDisplayResults(boolean _val)
If true, the final results of the curve-fitting procedure are displayed. |
void |
setEquilibriaTolerance(double _tol)
Sets the relative tolerance for equilibrium calculations. |
void |
setLambda(double _lambda)
Sets the initial value of lambda, the parameter that controls the transition from steepest-descent to Hessian method in the Levenberg-Marquardt algorithm. |
void |
setLambdaScaleFactor(double _factor)
Sets the lambda scaling factor. |
void |
setMaxIncrement(double _val)
Sets the maximum amount by which a parameter (ln K or ln n) may change during an iteration of the Levenberg-Marquardt algorithm. |
void |
setMinMaxIncrement(double _min,
double _max)
Sets the minimum and maximum volume increment for a titration calculation |
void |
setMonitor(java.lang.String _chemSpecies)
Sets the titration to monitor pX where X is the chemical species identified by the label _chemSpecies |
void |
setMonitor(java.lang.String _label,
java.lang.String _refLabel)
Sets the titration to monitor a half-cell or cell potential where _label identifies the phase whose potential is to be monitored. |
void |
setStandardDeviation(double _std)
Sets the standard deviation to be used for all pX or E values if the individual standard deviations are not defined. |
void |
setTargetIncrement(double _target)
Sets the target change in pX or E for a titration. |
void |
setTolerance(double _tol)
Sets the absolute tolerance for convergence of parameters. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public Titration()
public Titration(ChemSystem _chemSystem,
java.lang.String _titrantLabel,
java.lang.String _sampleLabel)
| Method Detail |
public void addReaction(Reaction _rxn)
public void addSpecies(Species _species)
public void apply()
public double[][] calcCurve(double _finalVol)
_finalVol - final volume of titrant added (in mL)public double[] calc(double[] _Vt)
public void clearReactions()
public void clearSpecies()
public boolean fit()
public double getChiSq()
public double[][] getCovariance()
public double getDerivative(int _idx)
setData(double[], double[])public double getDerivative2(int _idx)
setData(double[], double[])public double getGoodnessOfFit()
public java.lang.String getInfo()
public double[] getPar()
public double[] getParStd()
public void setChiSqTolerance(double _tol)
public void setData(double[] _Vt,
double[] _Y)
_Vt - array of titrant volumes in mL_Y - array of pX or E valuessetMonitor(java.lang.String)
public void setData(double[] _Vt,
double[] _Y,
double[] _std)
_Vt - array of titrant volumes in mL_Y - array of pX or E values_std - array of standard deviations for pX or Epublic void setDisplayIterations(boolean _val)
public void setDisplayResults(boolean _val)
public void setEquilibriaTolerance(double _tol)
Equilibria.setTolerance(double)public void setLambda(double _lambda)
public void setLambdaScaleFactor(double _factor)
public void setMaxIncrement(double _val)
public void setMinMaxIncrement(double _min,
double _max)
_min - minimum volume of titrant added in a step_max - maximum volume of titrant added in a steppublic void setMonitor(java.lang.String _chemSpecies)
public void setMonitor(java.lang.String _label,
java.lang.String _refLabel)
public void setStandardDeviation(double _std)
public void setTargetIncrement(double _target)
public void setTolerance(double _tol)
|
Equilibria |
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||