Professional Documents
Culture Documents
net/publication/296635855
CITATIONS READS
3 2,091
3 authors, including:
Some of the authors of this publication are also working on these related projects:
OPPORTUNITY (Activity and Context Recognition with Opportunistic Sensor Configurations) View project
Mobile health technologie for palliative care patients at the interface of in-patient to outpatient care View project
All content following this page was uploaded by Alberto Calatroni on 02 March 2016.
Chemistry Department, Bowdoin College, Brunswick, ME, 04011, USA, rdelevie@bowdoin.edu; European
School of Varese, Varese, Italy; and Politecnico of Milan, Milan, Italy
Received May 28, 2003. Accepted July 3, 2003.
Abstract: Starting from the general expression HC = 0 for any mixture of acids, bases, and salts we find the
pH as the root of this expression either by bisection or by using the Newton-Raphson or Levenberg-
Marquardt algorithms. All three are readily implemented on a spreadsheet.
© 2003 The Chemical Educator, S1430-4171(03)05718-0, Published on Web 8/21/2003, 10.1333/s00897030718a, 850298rd.pdf
Solving pH Problems on a Spreadsheet Chem. Educator, Vol. 8, No. 5, 2003 299
For the aqueous solution of the mixture of C M H3Cit plus Marquardt algorithm and can accommodate a number of
C" M NaOH we likewise obtain variables. Both are very useful general methods that students in
science should know anyway, and their implementation in
H
C = [H + ] − C [H 2 Cit − ] + 2C [HCit 2 − ] − 3C [Cit 3− ] − [OH − ] Excel is very straightforward and convenient. The only
problem students may encounter is that, for physically
[H + ]2 K a1 + 2[H + ]K a1 K a2 + 3K a1K a2 K a3 )} C Kw
= [H + ] − − C "− unrealizable values of [H+], complicated equations such as
[H + ]3 + [H + ]2 K a1 + [H + ]K a1K a2 + K a1K a2 K a3 [H + ] illustrated above often have additional real (i.e., nonimaginary)
(3) roots. While these are of no concern to chemists, the above
software can nonetheless home in on them, resulting in useless
as can again be found by inspection, simply by considering answers that might confuse the student. Below we will address
how many protons are gained or lost by the acid. The term C″ how one can usually avoid obtaining such incorrect answers.
represents the hydroxyl ions contributed by the fully Another method is bisection. Bisection is always constrained
dissociated strong base, while the term Kw/[H+] comes from the to a particular range of values of the independent variable and,
autodissociation of water. therefore, cannot lead to rogue answers outside that specified
For the aqueous buffer mixture of C M citric acid and C' M range. Bisection is also conceptually transparent, and we will,
orthophosphoric acid (which in a two-to-one concentration therefore, use it as our point of departure.
ratio can make a buffer with a near-linear pH as a function of
added NaOH between pH 2 and 7) plus C" M sodium The pH of an Aqueous Solution of Acetic Acid
hydroxide we have
We start with a spreadsheet, in which we reserve the top
H + −
C = [H ] − [H 2 Cit ] − 2[HCit ] − 3[Cit2− 3−
] − [H 2 PO 4− ] rows for a graph, then enter labels and values for the constants
involved: the total analytical concentration C of acetic acid, its
− 2[HPO 24 − ] − 3[PO34− ] − [OH − ]
acid dissociation constant Ka, and the water ionization product
([H + ]2 Ka1 + 2[H + ]K a1 Ka2 + 3K a1K a2 Ka3 ) C Kw. (In Figure 1 we have used 0.05 for C, =10^ñ4.76 for Ka,
= [H + ] −
[H + ]3 + [H + ]2 Ka1 + [H + ]Ka1Ka 2 + Ka1Ka 2 Ka3 and 1Eñ14 for Kw.) Below these we enter column headings for
H
([H + ]2 K a1 '+ 2[H + ]K a1 ' K a 2 '+ 3K a1 ' K a 2 ' K a 3 ') C ' Kw
C, pH, and [H+], and a starting value of, say, 0 for pH. We
− − C "− then complete the columns as specified in the first three
[H + ]3 + [H + ]2 K a1 '+ [H + ]K a1 ' K a 2 '+ K a1 ' K a 2 ' K a 3 ' [H + ]
instructions at the bottom of Figure 1 and plot HC versus pH.
(4) In order to illustrate the principle of bisection, we will here
use decasection. Look at the values computed for HC, which
where the Ka values for phosphoric acid are denoted as Ka′. for the constants shown in Figure 1 change sign between pH 3
In the above examples we see that the complexity of the and pH 4. We can now use linear interpolation to obtain a first
expressions for HC merely reflects those of the chemistry: for a estimate of the pH of the zero-crossing. We do this in a
simple chemical situation we find a rather simple expression separate cell with the instruction =(A20*C21ñ
such as eq 1, whereas a complicated mixture yields a C20*A21)/(A20ñA21), which yields pH = 3.02. (From hereon
complicated result for HC, as in eq 4. And while the derivation we will use the cell addresses corresponding to Figure 1; you
of such expressions is relatively straightforward once students are of course welcome to arrange the spreadsheet differently,
have familiarized themselves with the traditional acid-base but then the addresses must be adjusted accordingly.) To find a
formalism, numerically solving an expression as unwieldy as more precise answer, we repeat the process in columns D
eq 4 might frighten most students if we do not also give them through F starting with pH = 3 and using smaller increments,
the tools to do so. Fortunately, this is where the computer (as in this example ∆pH = 1. The root is indeed seen to lie
here demonstrated for the humble spreadsheet) comes to the between pH = 3.0 and 3.1 and linear interpolation yields pH =
rescue. 3.035, see cell F29 in Figure 1.
This approach is somewhat tedious, even though it quickly
Using a Spreadsheet leads to an estimate that is sufficiently precise for pH
measurements. The process can readily be automated by a
Many students already know how to use Excel, and many macro that will do the manipulations in the background. In
will even have it on their own computer, as part of the fact, it is most efficient for the computer to divide the interval
ubiquitous Microsoft Office; therefore, computing and plotting by two, look whether a sign change has occurred, on that basis
H
C as a function of pH = ñlog[H+] is not an impossible select that half of the data set that contains the sign change
assignment when the various K values are given. We will and, therefore, the sought root and repeat the process until
therefore focus here on finding the zero crossing in a table or some termination criterion is reached. The custom macro
graph, that is, on finding a root of a complicated equation. In RootFinder [12] will find the root after the area A17:B37 is
this case such a root must both exist and be real. Moreover, highlighted and the macro is called.
there can only be one such root within the range of physically Use of GoalSeek is equally simple, once it has been set
possible [H+] values, and a table or graph of HC versus pH will properly. Because Excel is primarily a business tool and
roughly indicate where to find that root. GoalSeek is mainly used for calculations in terms of dollars, its
Excel provides two aids in finding a real root: GoalSeek and default resolution is usually set to 0.001, too large for our
Solver. GoalSeek is an implementation of the Newtonñ purpose; therefore, go to Tools ⇒ Options, and under the
Raphson method, and can only handle functions of a single Calculation tab set the Maximum change to 0.000001.
variable x, but because that is the situation here, with x = [H+],
GoalSeek will do. Solver is based on the Levenbergñ
© 2003 The Chemical Educator, S1430-4171(03)05718-0, Published on Web 8/21/2003, 10.1333/s00897030718a, 850298rd.pdf
300 Chem. Educator, Vol. 8, No. 5, 2003 de Levie et al.
© 2003 The Chemical Educator, S1430-4171(03)05718-0, Published on Web 8/21/2003, 10.1333/s00897030718a, 850298rd.pdf
Solving pH Problems on a Spreadsheet Chem. Educator, Vol. 8, No. 5, 2003 301
© 2003 The Chemical Educator, S1430-4171(03)05718-0, Published on Web 8/21/2003, 10.1333/s00897030718a, 850298rd.pdf
302 Chem. Educator, Vol. 8, No. 5, 2003 de Levie et al.
accounting devices and, therefore, deal with number densities, Activity effects are a relatively minor but complicating
that is, concentrations. On the other hand, equilibrium factor and are best left out in a first discussion of pH, because
constants reflect energetics, and therefore involve activities, they require a quantitative grasp of ionic interactions, an
that is, the products of concentrations and activity coefficients. understanding of the difference between balance and
(2) A further complication is that what we measure as pH equilibrium expressions, and a knowledge of the various ways
depends on the type of measurement made. A potentiometric in which the pH can be measured. In a second encounter with
pH measurement (such as with a glass electrode and a the topic, these concepts can all be brought in. Even then,
reference electrode) yields a value closely resembling the activity corrections are best introduced after the pH is first
negative logarithm of the proton activity (as long as liquid computed without them; to do otherwise might force them,
junction potential differences are insignificant, as they often incorrectly, upon the mass and charge balance expressions and
are between pH 3 and 11), whereas a spectrometric pH might thereby lead to incorrect results. After all, the ionic
measurement (e.g., by using the visible spectrum of a color strength, the main determinant of activity effects in dilute
indicator) yields the negative logarithm of the proton solutions, is also based on ionic concentrations rather than
concentration. When one includes activity corrections, the activities.
question ìWhat is the pH?î therefore becomes somewhat more If we are after instilling insight in pH problems, the simple
complicated, because it can only be answered properly after derivation of HC = 0 plus a few specific examples such as
one specifies the model used for the correction as well as the shown here in eqs 1 through 4 will suffice, preferably in
type of pH measurement made. combination with logarithmic concentration diagrams that can
The actual mechanics of the activity correction are not that give the student an overview of the chemical speciation. If we
difficult and have been described explicitly in, for example, want to show students how HC = 0 is applied in practice, the
chapter 6 of reference 7; therefore, here we merely indicate the methods discussed here provide a powerful yet painless
protocol, which is easily implemented on a spreadsheet. illustration. Acidñbase problems present a rare example of a
situation in which the traditional approximations are more
(a) Given the pH calculated by the method used above (i.e.,
complicated and more limiting than using the exact, general
ignoring activity coefficients), compute the ionic strength.
result. Finally, if we want to introduce the students to the
(For the Davies model, this is all that is needed. For other
subtleties of ionic and other interactions, activity corrections
models, additional parameters may be required.)
can also be introduced at this point.
(b) Use the Davies equation (or whatever other model one
prefers) to estimate the activity coefficients of the ions
References and Notes
involved.
(c) Correct the equilibrium constants by incorporation of 1. H‰gg, G. Kemisk reaktionsl‰ra; Geber: Upsala; 1940; Die
these activity coefficients. theoretischen Grundlagen der analytischen Chemie; Birkh‰user:
(d) With the so-corrected equilibrium constants, recalculate Basel, 1950.
the pH. 2. Seel, F. Grundlagen der analytischen Chemie und der Chemie in
In principle, this is an iterative process, that is, steps (a) w‰ssrigen Systemen; Verlag Chemie: Weinheim, 1955.
through (d) should now be repeated until the pH shows no 3. SillÈn, L. G. In Treatise on Analytical Chemistry, part 1, vol. 1,
further significant change. In practice, such iteration is Kolthoff, I. M.; Elving, P. J.; Sandell, E. B, Eds.; Wiley: New York,
seldom if ever necessary in aqueous solutions. 1959.
(e) The pH obtained under (d) is still defined as ñlog[H+]. If 4. Butler, J. N. Ionic Equilibrium, a Mathematical Approach; Addison-
the calculated pH is to be compared with an Wesley: Reading, MA, 1964.
electrometrically measured value (but not if the 5. Fernando, Q.; Ryan, M. D. Calculations in Analytical Chemistry;
measurement is a spectrometric one), correct the pH to be Thomson: place of publication , 1982.
equal to ñlog{[H+]f} = ñlog [H+] ñlog f, where f is the 6. de Levie, R. Crit. Revs. Anal. Chem. 1997, 27, 51; H‰gg, G. Crit.
activity coefficient of a monovalent ion. Revs. Anal. Chem. 1997, 27, 76.
7. de Levie, R., Aqueous AcidñBase Equilibria and Titrations; Oxford
Discussion University Press: Oxford, England, 1999.
8. de Levie, R. Chem. Educator 2001, 6, 272ñ276; DOI
The combination of general expressions, such as HC = 0, and 10.1333/s00897010507a.
of general mathematical tools, such as bisection or the methods
9. Prideaux, E. B. R.; Ward, A. T. J. Chem. Soc. 1924, 125, 426ñ429.
of NewtonñRaphson or LevenbergñMarquardt, has several
advantages. First, it reduces the tedium of mathematical 10. Britten, H. T .S.; Robinson, R. A. J. Chem. Soc. 1931, 1456ñ1462.
operations and the distraction from chemistry that can result. 11. Ellis, D. A. Nature 1961, 191, 1099ñ1100.
Secondly, it avoids the need for approximations that, in many 12. Freely available from the author. Please address email requests to
practical situations, can generate incorrect results. And, last but RDELEVIE @ BOWDOIN.EDU.
not least, it demonstrates that one can use simple chemical 13. Debye, P.; H¸ckel, E. Phys. Z. 1923, 24, 185ñ206.
principles for solving rather complicated problems that are well 14. Davies, C. W. Ion Association; Butterworths: Washington, DC,
beyond the range of the traditional, more cumbersome 1962.
approach still advocated in most textbooks. The same methods 15. Robinson, R. A., Stokes, R. H., Electrolyte Solutions, 2nd ed.;
can of course be implemented in other programs; we have Butterworths: London, England, 1959.
illustrated them here for Excel because that software is easily 16. Kielland, J. J. Am. Chem. Soc. 1937, 59, 1675ñ1678.
learned and widely used.
© 2003 The Chemical Educator, S1430-4171(03)05718-0, Published on Web 8/21/2003, 10.1333/s00897030718a, 850298rd.pdf