ActivityCoefficients Manual

An Example Notebook

Arnd Roth
Abteilung Zellphysiologie
Max-Planck-Institut fuer Medizinische Forschung
Postfach 10 38 20, D-69028 Heidelberg, Germany
roth@sunny.mpimf-heidelberg.mpg.de

This loads the package.

<<Miscellaneous`ActivityCoefficients`

?ActivityCoefficients

?Electrolytes

Electrolytes

This lists all occurrences of cesium ions in the database.

Select[Electrolytes,
       StringMatchQ[#, "Cs*"] &]

We now examine the use of our package for three example electrolytes. The first one is cesium chloride.

Example 1:  CsCl

Plot the experimental data points.

?ActivityData

ActivityData["CsCl"]

dataPlot =
ListPlot[ActivityData["CsCl"], PlotRange -> All,
         PlotStyle -> {PointSize[0.02]},
         AxesLabel -> {"c/M", "f"}, PlotLabel -> "CsCl"]

We use the following Ansatz for the mean activity coefficient as a function of ionic strength i,

	f[i_] := Exp[-zX zY A Sqrt[i] / (1 + B Sqrt[i]) + C i],

where zX and zY are the absolute values of the charges of the cation and anion, respectively, and A, B and C are parameters. Constant A is fixed at A = 0.5115*Log[10] M^(-1/2)  (Debye-Hueckel limiting law, 25 degrees celsius, value taken from table 3.4 in Bockris, Reddy, see below). Constants B and C are determined by fitting the tabulated values of activity coefficients. The terms involving B and C may be viewed as corrections to the Debye-Hueckel limiting law. B is a correction for finite ion radius, and C accounts for short range interactions of the ions.
See also Bockris, J.O'M., Reddy, A.K.N. (1970) Modern Electrochemistry, Vol. 1, (Plenum Press, New York) or other textbooks on electrochemistry.

The Debye-Hueckel theory gives the activity coefficient in terms of the concentration (molarity, in moles per liter of solution), not the molality (in moles per kilogram of solution). Therefore, with respect to fundamentals, it is wrong to identify molality and molarity when fitting these data. However, for practical purposes, bearing in mind that the Debye-Hueckel theory is based on many other approximations, we may neglect the difference as long as the concentration does not exceed 1 M.

Invoke the function for fitting the experimental data.

?ActivityCoefficient

ActivityCoefficient["CsCl", Concentration -> c]

For example, the activity coefficient for c = 0.15 M is

ActivityCoefficient["CsCl", Concentration -> 0.15]

This plots the fitted function.

fitPlot =
Plot[ActivityCoefficient["CsCl", Concentration -> c],
     {c, 0, 1}, PlotRange -> All,
     AxesLabel -> {"c/M", "f"}, PlotLabel -> "CsCl"]

Show[dataPlot, fitPlot]

The model seems to agree quite well with the experimental data.

Example 2:  CaCl2

Plot the experimental data points.

ActivityData["CaCl2"]

dataPlot =
ListPlot[ActivityData["CaCl2"], PlotRange -> All,
         PlotStyle -> {PointSize[0.02]},
         AxesLabel -> {"c/M", "f"}, PlotLabel -> "CaCl2"]

Now, concentration and ionic strength are not equal.

?IonicStrength

IonicStrength["CaCl2", c]

Invoke the function for fitting the experimental data.

ActivityCoefficient["CaCl2", Concentration -> c]

For example, the activity coefficient for c = 0.15 M is

ActivityCoefficient["CaCl2", Concentration -> 0.15]

This is, of course, equal to

ActivityCoefficient["CaCl2", IonicStrength -> 0.45]

This plots the fitted function.

fitPlot =
Plot[ActivityCoefficient["CaCl2", Concentration -> c],
     {c, 0, 1}, PlotRange -> All,
     AxesLabel -> {"c/M", "f"}, PlotLabel -> "CaCl2"]

Show[dataPlot, fitPlot]

Example 3:  KI

Plot the experimental data points for potassium iodide.

ActivityData["KI"]

dataPlot =
ListPlot[ActivityData["KI"], PlotRange -> All,
         PlotStyle -> {PointSize[0.02]},
         AxesLabel -> {"c/M", "f"}, PlotLabel -> "KI"]

Invoke the function for fitting the experimental data. For example, the activity coefficient for c = 0.15 M is

ActivityCoefficient["KI", Concentration -> 0.15]

This plots the fitted function.

fitPlot =
Plot[ActivityCoefficient["KI", Concentration -> c],
     {c, 0, 1}, PlotRange -> All,
     AxesLabel -> {"c/M", "f"}, PlotLabel -> "KI"]

Show[dataPlot, fitPlot]

How to add electrolytes to the database

The ActivityCoefficient[] function needs to know three things about an electrolyte:

?ActivityData

?CationCharge

?AnionCharge

Additionally, its name must be in the Electrolytes list. So this is how to proceed adding data on K4Fe(CN)6:

Unprotect[
Electrolytes, ActivityData, CationCharge, AnionCharge]

AppendTo[Electrolytes, "K4Fe(CN)6"];
ActivityData["K4Fe(CN)6"] =
{{0, 1}, {0.1, 0.139}, {0.2, 0.0993},
 {0.3, 0.0808}, {0.5, 0.0614}};
CationCharge["K4Fe(CN)6"] = 1;
AnionCharge["K4Fe(CN)6"] = 4;

Protect[
Electrolytes, ActivityData, CationCharge, AnionCharge]

ActivityCoefficient["K4Fe(CN)6", Concentration -> 0.4]