Solution of mass action problems on a programmable calculator

Bits and pieces, 9. Using the Newton-Raphson method of determining equilibrium concentrations on a programmable calculator...
0 downloads 0 Views 2MB Size
Solution of Mass Action Problems on a Programmable Calculator

Example problem: to find the solubility of CaCOn in distilled water. First, write the six equilibrium equations (solubilityproduct, two acid dissociation, water dissociation, mass-balance and eharge-halance): K.,

=

[CaZ+] [COB-]

Brian W. Clare School of Mathematical and Physical Sciences Murdoch University Murdoch. Western Australia, 6150.

(1)

K I = [H+I[HCOiI/[HzCOs]

(2)

Kz = [H+][COf~]/[HCOiI

(3)

K , = [Ht] [OH-]

(4)

[Ca2+]= [H2C03]+ [HCOi] + [COB-]

(5)

+

(6)

2[CaZ+] [H+]= [OH-] + [HCOBI + 2[COf-I

the charge-balance and mass-balance equations,respectively, to arrive at an approximate solution. Combining the simplified equations yields the following nonlinear equation:

This can be solved by Newton-Raphson iteration (II ) using an SR-52. The answer (solubility = [CaZ+]= 1.27285 X lO-'M) was obtained in 17 iterations using [Ca2+]= 1.0M as the initial concentration. For an exact solution one would like to combine the six equations (1-6) into one equation involving only [CaZ+],which is equal to the solubility.When a di- or triprotic acid is involved, it is mathematically simpler to reduce the six equations to one equation containing only the [H+]term. The result is:

Two broad classes of calculation arise in the study of chemical equilibrium problems. The first is the determination of equilibrium constants, given data. The treatment of these by computer (12) and programmable calculator (13) has been described. The second class, determination of equililhrium concentrations, gives rise to systems of nonlinear equations. Solving these systems of equations by making chemically reasonable assumptions about which species can be safely neglected becomes unsatisfactory for large systems, as approximations differ in different concentration ranges, and in any case, does not always lead to a set of equations solvable by elementary techniques. The alternative is a direct attack on the unsimplified equations, as has been described by Needes (14), using the Newton-Raphson method, and by Feenstra (151, using a minimization techniaue. Both Needes and Feenstra used large computers. The N e k o n - ~ a p h s o nmethod can be modified to fit a small calculator such as the HP67 (16) or T159. The modified method requires some experimentation to obtain a form that converges. The minimization technique is unsuitable for such machines, as i t involves inversion of a large matrix. The recent introduction of the more powerful HP41C, however, permits the use of the full Newton-Raphson method on a machine that a significant number of students may -pos. sess. A specific example is a problem that arose in the development of the Parker process for copper hydrometallurgy: the need for separation of copper(1) from zinc(I1) in aqueous acetonitrile solutions containing sulfite. The stability constants and solubility products were determined essentially as described (131, and calculations were made on the solubility of the snlfites a t different initial composition. The general procedure is: ~

where A is defined as

The solubility can be obtained from the following equation Solubility = [CaZ+]= (K.,A)1/2

(10)

Where A is defined by eqn. (9).Equation (8) can be solved using the Newton-Raphsan iteration. However, the resulting equation is too complicated to be solved on a hand-held programmable calculator. Therefore, a program (in BASIC) was written to solve this iteration equatian. The Newton-Raphson method had difficulty converging if the initial guess for [H+]was not close to the correct value. Therefore, it was necessary to incorporate a scheme for improving the initial guess for [H+]into the program. The value off in eqn. (8) is determined far different values of [H+]starting with [Hi] = 1.0. The value of [Ht] is systematicallyreduced by a factor often until the value of f changes sign. The last value of [H+]thus obtained is then used as the starting value for [H'] in the Newton-Raphson iteration. The answer (solubility = [Ca2+]= 1.27285 X W4M)wasobtained in three iterations. For CaCOz the answers obtained by the two methods agree completely,illustrating the validity of the approximations. While the exact treatment riven above will work for all comoounds < c,n!.mm:: T L R ~ I < , ~ Iml . ; -.. nitm mi. the 1 1 p ~ r ~ ~ s will ~ ~ 1101 ~ ~ w,rk a t ~ ~ for \ e n ~z?~duhie nmt?ri9ls, e g., Cuq F,>rv ~ r , i n ~ ~ ~ l u!nwteri~I; l~lc one assumes that the values of [H'] and [OH-] are the same and equal to IOWM. In that case one obtains the followingequation (which does not require iteration) Solubility = [Cu2+]= (KgpA)l'P where A is defined bvean. (9) and lHtl

=

(11)

10-7M. Solvine this eaua-

tions. Programs (for the SR-52 as well as the basic version) are available from the author on request a t a cost of $1 to cover postage and handling. The check or money order should be made payable to the author.

1) Write a mass balance for each component of the system in terms of all the species present, and all precipitates; 2) Far each species in each equation, write a term giving the concentration af that species in terms of the components. 3) Add the solubility product relationship for each precipitate. A separate set of equations must he written and solved for each set of precipitates. For the case of the components copper@),zinc(II), and sulfite, with a zinc sulfite precipitate, the acid dissociation constants K1 and Kz for H ~ S O Jthe , stability constants /3:,& for CuSOi and Zn(SO& and the solubility product K s o have been measured. The three mass balance expressions are: CuT = [Cut]

+ f i [Cu+][SOE]

, ~ 1

where CuT, ZnT, and ST are the total concentrations of copper, zinc and sulfite, respectively. These are three nonlinear equations in the four variables [Cu+], [Znz+], [SO;-], and P, the amount of ZnSOa precipitated per litre. Since ZnSOs is present, a fourth equation is given by: [Zn2+][SO:-1 = Kso. All equilibrium problems can he reduced to equations by inspection in this manner. If pH were to be determined (instead of being fixed) [H+] would he a variable and an extra Volume 59

Number 2

February 1982

133

equation (a charge or proton balance) would have to be written, using K , = [Hf][OH-]. Activity effects are taken into account by converting thermodynamic constants to apparent constants, using the ionic strength and one of the semiempirical relationships available ( I 7). An HP41C program which solves systems of nonlinear equation by the Newton-Raphson method is available with documentation free from the author. A system with ten or more variables can he handled by the fully expanded HP41C and for a smaller number of components, a system with a hundred or more species can be treated. Documentation includes program listings, instructions for use, program barcode, and a full treatment of examples. The program will also he supplied on magnetic cards, on the supply of four blank Hewlett Packard magnetic cards.

Automated Conductimetric Rate Experiment Using the IEEE-488 Bus Gilberl F. Pollnow

University of Wisconsin-Oshkosh Oshkosh, Wisconsin 54901 This report summarizes the results obtained in following the rate of reaction of ethyl acetate with hydroxyl ion, using a Digital Equipment Corp. MINC-11 computer coupled via the IEEE-488-75 bus with a GenRad, Inc. 1658 Digibridge. Althoueh a comolete understandine of the IEEE standard entails about 80 and is beyond vwritnt.ni whivh could he exmilined in m e ur more laboratory periods would include the effect of changing electronegativity of various suhstituents on the methyl group of the ester and other esters. Other reactants which undergo similar changes in conductivity with the time might also he investieated. cop& of the program can be obtained from the author for $20. or for $30 the nroeram will he loaded on to the user's R X O formatted ~ diskette. The author acknowledges with pleasure the financial support of a University of WisconsinOshkosh CAS Curriculum Development Grant in connection with this work. This paper was presented to the Computers in Chemistry Division of the American Chemical Society, Houston, Texas, March 24,1980. A

a