E.
Haglund, D. Mess, a n d J. Flynn
Purdue University Campus at
Fort
Fort
Wavne
Wayne, Indiana
I
General Solution of
1 I
Ionic Equilibria Problems A Computer Program In equilibrium problems involving acids, X is equal to the hydrogen ion concentration and Y to the hy-
T h e availability of a computer and the inclusion of a course in computer operation in the curriculum of first semester engineering and science students led to the attempt to develop a general method of exact solution of ionic equilibria problems using a digital computer. A general method covering solubility, complex ion, and acid-base equilibria was not possible without needlessly complicating the program. However, a general method for acid-base equilibria was developed which gives exact solutions to the simple, as well as the more complex, type of acid-base equilibria such as triprotic acids, buffer solutions, mixtures of weak acids, and dihydroxy bases. The unique feature of this program is the fact that the general program is stored in the computer and solution of a great variety of problems can be obtained with very little time and effort. The only data required for the solution of a specific problem are related equilibrium constants and concentration values which are fed to the computer on punched cards. The entire solution of the more complex problems including the punching of data cards requires no more than five minutes, of which only 20-30 seconds are computer time. The program is an iterative solution of a set of simultaneous equations describing the system in equilibrium. Charge balance
X
2.
Water ionization
X Y = CZ
3. K ,
4. K3 5. Ks 6. Mass
balance
GENERAL SOLUTION O F I O N I C EQUILIBRIA PROBLEMS INYOLYING ACIDS. BASES AND HYDROLYSIS
PROBLEM.
MIXTURE O F 0.1
XS/R ST/#
=
XU/T
=
H ACETIC
CHARGE BAlANCE EQUATION. EQUILIBRIUM EQUATIONS.
MASS BALANCE EQUATION.
AND 0.1
H HYPOCHLOROUS A C I D S
--
X = Y + S + I T X'Y C2 XfSIR C3
X*T/S C4 X*U/T = C 5 R + S + T + U
+
-
3U
+
C1
C6
INPUT COEFFICIENTS C l = CHARGE BALANCE = C2 = KW =
----
C3 K l rn K2 =~ C4 K3 = C5 MASS BALANCE C6 C3 K1 = KZ = C4 C5 = K3 = C6 = MASS BALANCE
=
0.00E-99 1 .OOE-14 1.85~45 0.00E-99 O.0OE-99 1.00E-01 3.00s-08 0.00E-99 0.00E-99 I.OOE-01
SOLUTION = = = = = = = S =
1.35E-03 7.4OE-12 9.87E-02 1.35E-03 0.00E-99 0.00E-99 I.0OE-01 2.22E-06
T
0 ""F-QQ
X Y R S T U R
+ S + 2T + 3U + CI
Y
1.
=
S a n p i e Problem Sheer
C8 = C+
;
HYDROGEN HYOROXIOE ACETIC A C I D ACETATE
HYPOCHLOROUS A C I D HYPOCHLORITE
C4
R+S+T+U=Ca Values
M i x t u r e of 0.1 M acet,ic a n d M hypochlorous acids'
of
Coefficient
CI
Prohlem
0.1
lo-' 34 hydrochloric acid 1 0 - W acetie scidb 0.1 M phosphoric scidb 0.1 M sodium carbonate 0.2 M sodium bicarbonate 0.1 M disodium hydrogen phas-
.. . 1
-4
... ... x 10-1
CI 1
x
IOP
ib-14
1 x' 1 X lo-" 1 x 10-l4 1
x lo-"
Cords
for
Various
Type
Problems
G
(:a
1.8.5 x I O - ~ 3 . 0 X 10-
...
...
. ..
Ce
Cr
[IItl
...
1 . 0 X lo-' 1 . O X lo-'
1.35 X 10-'
... ...
1.76 x ' 1 0 F 7.52 x
1.62 ~ ' 1 0 - ' 1.0 X'IO-S 1.24 x lo-d 6.23 x ' 1 0 - ~ 2 . 2 x ' ~ o - ' ~ 1 . 0 x 10-1 8 . 9 4 x lo-'
1.5 x
4 . 8 X lo-"
...
3 . 0 x lo-'
9.62
x lo-"
phate
0.1M trisodiumphosphst@ 0.1 M o d i c acid' 0.1 M arsenic acid* 2.4 X lo-' M rnerouric hydroxided
-5 X lo-' . .. ...
1 X 1 W 1 V . Y 2X 10Y 1 x lo-" 5 . 9 0 X lo-* 1 x 10-1' 5.62 x 10-a
...
1 x 10-la
1 x lo-"
6.23 X 6 . 4 0 X lo-' 1.70 x lWi 1.2
x lo-1
2 . 2 X 111-"
2 . 0 X 1 0 F 3 . 7 8 X 10-" 1 . 0 x 10P 5.28 X l W 2 3.95 x ' l 0 - i 2 1 . 0 X 10F1 2.11 X 1OF
...
2 . 4 X lo-'
1 . 0 0 X 10-'
"Inorganic Chemistry of Qualitative Analysis," Prentice-Hall, Inc., Englewood Cliffs, X.J., 1961, p. 205. * T h e ionization constants wed are f r o m "Handbook of Chemistry a n d Physics," 45th Ed., The Chemical Rubber Co. T h e ionization constants used in this problem are the values given for the hydrolysis of the carbonate, Clifford, op. eit., p. 150. a
CLIFFORD,A. F., Ihid., p. 153.
droxide ion concentration. R is the unionized acid and S, T, and U are the anions from the first, second, and third ionization steps. In equilibrium problems involving bases, X is the hydroxide ion concentration, and Y is the hydrogen ion concentration. The unknowns, Y, R, S, T, and U , in equations 2-6 are solved for in terms of the six constants and X. A value for each of the unknowns, Y , R, S , T, and U , 1s then determined from the six constants and a set value of X. These values of the unknowns, Y, R, 8, T, and U , are then used in eq. (1) to determine a new value of X. The next set value of X is determined by the ratio X,. JX. I n this way successive values of X, Y , R, 8, T, and U are determined until the ratio, X,,,,/X, is sufficiently close to unity. The type of problem worked is controlled by the values of the coefficients as shown in the table. For a mixture of two acids, a second set of equations, 3-6, are used and four more coefficients are necessary.
The program is designed for a maximum of a mixture of three acids. This program with its optional features was designed on an IBM Model 1620 with 1443 Printer and 1311 Diskdrive. Because of the limited memory of the 1620, the program was put on the memory disc in two parts. Labels for the answers are contained on the coefficient computer cards for the equilibrium constants (C*, C8, Cn,C6) in such a way that these cards can be stored and used again in other problems involving the same acid or base. If the labels are not desired, these positions may be left blank. The authors will supply on request a copy of the complete Fortran program. Theauthorswish to thank Dr. D. A. Davenport and Dr. A. F. Clifford, Purdue University, Lsfayette, Ind., for their suggestions and help in the preparation of this paper.
Volume 43, Number 7 I , November 1966
/
583