Algorithms Used for Exact Calculation of pH
same reason, the trial value should he chosen as a uositive
G. M. Muha
Rutgers University New Brunswick, NJ 08893 Although the various algorithms used for the iterative calculation (10-12) of the p H of a solution differ in their computational details, they have one step in common: the selection of a n initial numerical trial value to begin the calculation. Since a cuhic equation is involved, three roots are expected, only one of which can he the correct one. Thus the question: how does one choose the initial trial value to insure t h a t the calculation converges to the correct root? Kelter and Carr ( I I ) suggest that a large (numerical) value should be chosen hasing their recommendation on their observation t h a t the ". . . correct value always seems to he the highest possible of the three mathematically correct roots. . .". T h a t their conjecture is correct can he demonstrated as follows. If one examines the most general form of the cuhic equation defining the p H of a solution (131, it is ohserved that there is only one variation in sign among the polynomial coefficients, and hence by Descarte's Rule of Signs for Polynomials ( 1 4 ) ,the equation can have exactly one positive root. Since the remaining negative (or perhaps imaginary) roots are inadmissable on physical grounds, it is clear t h a t the correct root is indeed the largest in the algebraic sense. As concerns the choice of a trial value, if the Newton-Raphson algorithm is used ( I I ) , the initial value should he chosen so t h a t t h e desired root lies between it and the negative roots. T h e iteration scheme will then, as a matter of course, force the interception of the correct answer (and hence the termination of the calculation) before possible extraneous negative roots are reached. With other types of algorithms (10,12) and for the
to minimize the number of iteration cycles required to achieve convergence to a predetermined accuracy, the numerical value used for t h e initial trial should be chosen carefully using one of the standard schemes available (15). An additional remark may be appropriate: the general form of the equation determining the soluhility product equilibrium is also a cuhic equation with one variation in sign. Further, in hoth the p H and pK,, cases, the general form of the cuhic equations and their sign variations are unchanged if activity corrections are included (16).Hence the remarks given above a s concern the choice of a trial value apply in these instances also. Literature Cited
Merril1.d. R.. mdHughes, G r e g a ~ yP.,Amer. J. Phys., 39,1391 (1971). Hiour, Frank, ,I.CHEM.E ~ u c . 5 8 . 5 5 311981). Anderson,RobertH.. .I. CHEM.EDUC., 52.776 (1975). Gutowsky, H. S.,and Ho1m.R. H . J . Chrm Phyr ,25,1228 (1D561. Holdmorth D. K.. Chem tiduc.. m press. IThv relers to "Words and Numbers. A p ~ plicaiions of Aiphr~NumericCalulatnrs.") ~ hN ~ ~ ~ Psimb0ls ~ ~ a~ n idI ~ ~~ ~ ~m~ i fur n~ouse ~~~oin~schuul ~ ~, ssicnce:~he Associalion lor Science Education, Hatfield, England, 2nd ed., 1979. Dich0n.T. B., "Thecumputer and Chemistry," W. H.Freeman and C"..san Francisco, 1 9 6 8 , ~ 122; . Solbberg,L., Shak, A , Saber, J. C.. and Canty, E. T., "BASIC and Chemistry.((Houghton Miillin. Boston, 1976.p. iR6. Ke1ter.P. &and Carr, J. U.. J. CHEMBDUC.,57,620 (1980) Brsnd.M.L D.. J. CHEM. EDIIC., 53,771 I l V h l . Butler, J. N.. "Ionic Equilibrium.(( A d d i a ~ n ~ W ~ i lReading, ey, MA.1964, p. 116. Petennn,T. S., "CollegeAlgebra,"Harper and Row, New Yurk. 1 1 4 7 , ~ .176. Lancror. C., "Apnlied na1ysia.l. Pmntice~Hrll,Inc., Englowaod Cliffs, NJ, 1956, Chapter 1. I161 Muha, G. M., J CHEM.&DUC.. 68,242 (1981).
Interactive CHEM TIPS Now Available A user manual is available from the University of Wisconsin-Madison for the Interactive Teaching Information Processing System (ITIPS). This program, developed from the earlier TIPS' program, allows instructors to create large files of multiple-choice questions with appropriate messages and then to use the questions in weekly surveys for large numhers of students. ITIPS permits each student to take (and, if desired, re-take) eaeh survey while sitting at a computer terminal. Students can thus self-test their knowledge and skills on weekly topics without penalty to their grades. Students who score well on the surveys can he confident of their mastery of subject materials and can then move on to more challenging assignments. Students with lower scores are given assignments designed to help them master weak areas. Students with very poor scores can he identified immediately for remedial work or tutoring sessions. For instructors, a regular study of the file data permits easy identification of topics that students are finding difficult or of topics that need reinforcement. ITIPS not only presents students with problems, hut it also identifies concepts that students have not yet mastered, thus allowing instructors to evaluate their teaching techniques. The instructor or an assistant is responsihle for creating and maintaining student, question, message, and survey files. Student files are created at the heginning of each semester and can he modified throughout their existence. A student file contains information such as the name and identification number for eaeh person enrolled in the course. Question and message files are created once and maintained for an indefinite period. They can he used year after year, with modifications as the need arises. A question file contains the text of multiple-choice questions, the possihle responses, and the correct answers. A message file contains messages which may he associated with specific questions or groups of questions. For example, if a student misses two out of three questions on aparticular concept, a message would be printed containing information about the concept, appropriate pages in the textbook to he studied, and/or specificexercises to be worked
differ because of differences in the machines where these afferences occur. instructions for hoth the PDP and the Snerrv
'For a detailed description of CHEM TIPS, see B. Z. Shakhashiri, "CHEM TIPS: Individualized Instruction in Undergraduate Chemistry Courses," J. CHEM. EDUC.,52,588 (1975).
Volume 60
Number 1 January 1983
49