The HTML-based Virtual Titrator works by using interactive web
technology, specifically CGI, to solve a set of equations and
plot the result at the user's workstation using JAVA.
The basic steps are:
1) User input: This uses html "forms" to permit the user to select from a set of weak acids or input ka values. The information (acid name and dissociation constant(ka), and the concentrations) is then sent to the web server located on the computer hamers.chem.wisc.edu
2) Decoding and solution of numerical equations: The web server grabs the user's information through a "C++" program. Based on the acid name, ka, and concentration information, the computer solves the set of equations that describes the shape of the titration curve, alpha plot vs. pH or alpha plot vs. ml base. This data is written out to a temporary data file.
3) Plotting: Plotting of the data is performed through a JAVA applet. The same "C++" program that solves the numerical equations also launches the plotting JAVA applet. The applet is an executable program that is downloaded to the user's computer. The applet grabs the data file describing the curve and plots it at the user's workstation. All subsequent manipulation (re-scaling, etc.) is performed locally, with no further involvement from the web server.
I would like to thank William Shackleford at the National Institute for Science and Technology (NIST) for supplying the original JAVA applet used until July, 1997, for the Virtual Titrator.
Titration Curve
The mathematical equation describing the titration curve can be
readily generated using the "systematic method". In
this method, one writes equations describing the equilibrium
expressions, with additional expressions generated for mass
conservation and charge balance (overall electrical neutrality of
solution). This results in a single equation, with [H+]
as the unknown. However,the equation is a third-order equation
for a monoprotic weak acid, fourth order for a diprotic acid, and
fifth order for a triprotic acid. This method is explained in
detail here. While these equations
have 3, 4, or 5 roots, respectively, most of these roots will be
imaginary, complex, or negative real numbers. There can only be
one real, positive concentration of hydrogen ion. The
"C++" program that generates the titration curve finds all
the roots of the equations, and then picks out the real, positive
root. This is repeated for many volumes of added base, generating
a complete titration curve. Because no approximations are made in
the numerical solution, the resulting curve will be correct for
ANY concentration of weak acid, even in the dilute limit. The
routines for solving the complex, polynomial equations were taken
from "Numerical Recipes in C" and updated to a
"C++" version.
Alpha Plot
The equations describing the alpha plot is much simpler and can
be solved directly from the ka values and a given pH, unaffected
by concentrations. The alpha plot vs. pH simply feeds pH values
and returns alpha values. However, the alpha plot vs. ml base
first equates a pH from the addition of base using the titration
equations explained above, and then feeds this pH in order to
receive the alpha values for the addition of base.
More Explanations