Ind. Eng. Chem. Fundam., Vol. 17, No. 1, 1978
69
CORRESPONDENCE
Some Remarks on the Calculation of Complex Chemical Equilibria by General Methods Sir: In a paper with the above-standing title, Smith (1976) has discussed computation of restricted chemical equilibria. He meritoriously has drawn attention to a useful contribution by Schott (1964) which, like other contributions concerning restricted equilibria (compare Bjornbom, 1976), is excluded from the literature review by Zeleznik and Gordon (1968). However, some misunderstandings in Smith’s paper regarding Brinkley (1946) and Bjornbom (1975) must be cleared up. First, the formula for the number of independent reactions R = N - C is attributed to Brinkley, and Smith also states that fewer than R reactions can be allowed. All this is false. In fact, Jouguet’s (1921) and Brinkley’s results are mixed up. Jouguet found the generally valid formula R = N - C while Brinkley stated that the number of components C equals the rank p of the atom matrix, C = p. However, Brinkley neglected restricted equilibrium where C > p and R = N - C < N - p (Prigogine and Defay, 1947). Secondly, Smith states: “Bjornbom (1975) has suggested that free energy minimization methods cannot be used in such cases. This is false”. I would have made a big fundamental mistake if I had really written as Smith states since minimum of free energy is a necessary and sufficient condition for chemical equilibrium. As explained in the introduction to my paper, the problem discussed is not whether the free energy should be minimized or not but which constraints do properly account for the range of states over which the free energy should be minimized. In fact, Smith simply has made an improper reference to my paper. I have mentioned “. . . free energy minimization with element material balances constraints”. Smith himself implies that free energy minimization with element balance constraints fails in restricted equilibrium cases. His point is that the constraints can be substituted according to Schott’s method to be able to keep the general algorithm unchanged. Smith also states that “Bjornbom’s values . . . are slightly in error. . .”. However, in computing those values the itera-
tions were ceased when the equilibrium conditions were satisfied well within the limits of error set by the reading-precision of the free energy diagram used. Smith has driven the numerical solution to an extreme degree of convergence but cannot obtain more precise values than mine since the precision is determined by the errors in input data. I am afraid that a practice of excessive convergence should tend to significantly increase computation costs in the long run. Let us finally summarize the state of restricted equilibrium computation. I refer to Bjornbom (1975) regarding the definition of and the procedure to determine the independent reactions. In the restricted case the free energy must not be minimized with atom-balance constraints but the constraints must be defined by the independent reactions, notwithstanding that the minimization is carried out analytically (resulting in formulas with equilibrium constants) or numerically. Once the independent reactions are determined, Schott’s method allows expressing the constraints in a form analogous to the atom balances. This is a useful tool if one has only a computer program intended for atom-balance constraints available. An obvious disadvantage is that the computation becomes more complicated with Shott’s device while it becomes less complicated with other methods.
Sir: Bjornbom has raised some interesting points in his letter, to which I welcome the opportunity of replying. First, concerning the use of the term components, Bjornbom and I do not disagree. In my paper (Smith, 1976) I essentially used the rank of the system atom matrix as my definition of the term for the purposes of that paper. I signified this by writing “components (Brinkley, 1946),” intending to avoid the elaboration (unnecessary in that paper) which Bjornbom has correctly given above. Second, concerning the “failure” of general purpose complex chemical equilibrium algorithms in computing restricted equilibria, our only disagreement concerns the appropriateness of the word “fail” in this context. I believe it to be grossly inappropriate since I showed that these algorithms can still be used in such situations, subject to some very minor modi-
fication of the input data. Contrary to Bjornbom’s implication a t the conclusion of his letter, the method of modifying the atom-balance constraints I described (Smith, 1976) is trivially programmed on a computer and is in no sense “complicated”. Finally, Bjornbom raises an interesting point concerning the accuracy of equilibrium calculations. This really has two separate aspects, both of which are relevant to a broad range of numerical methods in chemical engineering, in addition to the chemical equilibrium algorithms under discussion here. These will hence be considered in some detail. The first aspect concerns Bjornbom’s fears of the practice of “excessive convergence” tending to significantly increase computing costs. Whether such fears are well founded or not depends upon the convergence properties of the given algo-
0019-7874/78/1017-0069$01.00/0
Literature Cited Bjornbom, P. H., Ind. Eng. Chern. Fundarn., 14, 102 (1975). Bjernbom, P. H.,AlChEJ., 22, 204 (1976). Brinkley, S. R., J. Chern. Phys., 14, 563 (1946). Jouguet, E., J. Ec. Polytech., Ser. 2, 21, 61 (1921). Prigogine, I., Defay, R., J. Chern. Phys., 15, 614 (1947). Schott, G.L., J. Chern. Phys., 40, 2065 (1964). Smith, W. R., Ind. Eng. Chern. Fundarn., 15, 227 (1976). Zeleznik, F. J., Gordon, S., Ind. Eng. Chern., 60 (6). 27 (1968).
Department of Chemical Technology Royal Institute of Technology S-100 44 Stockholm, Sweden
0 1978 American Chemical Society
Pehr H. Bjornbom
70
Ind. Eng. Chem. Fundam., Vol. 17, No. 1, 1978
rithm. It is well known that algorithms with second-order convergence properties (for example, Newton's method for solving nonlinear equations) roughly double the number of decimal places of accuracy on each iteration in the neighborhood of the solution. Thus, if one has achieved three places of accuracy after, say, 20 iterations and one further iteration will yield six places, the marginal cost of the increased accuracy is small. The Rand free-energy minimization algorithm (White et al., 19581,for example, is a second-order method and so it is thus not unreasonable to employ a reasonably stringent convergence criterion. The second aspect concerns the numerical accuracy of the solution which is justified by inaccuracies in the problem data. There are, in fact, two types of "accuracy" involved here. The first is the numerical accuracy of the solution to the given (mathematical) problem in a definite computational sense. This considers the input data to be exact and refers to errors in the solution, reflecting such things as the number of figures carried in the course of the calculation and the properties of the numerical algorithm used. The second type of accuracy refers to the effect of errors in the problem's input data on its solution. This might be referred to as the precision of the solution. The phrase accuracy ofthe solution can refer to either or both of these. Let us consider the hydrodealkylation of toluene example in Bjornbom (1975) to which Bjornbom refers in his above letter. If one wishes to compare the accuracy of the solutions obtained by Bjornbom (1975) and by myself (Smith, 1976) in the first (computational) sense only (treating the input data as exact) then my result is more accurate. However, Bjornbom has pointed out above that this numerical accuracy may not be justified by the errors in the standard free energy of formation data used. The effect of errors in problem data on the solution to a problem (the precision of the solution) is properly determined by a general mathematical technique known as sensitiuity analysis. I have discussed elsewhere (Smith, 1969) the details of this approach in the case of the chemical equilibrium problem. I will briefly illustrate its use in the case of the example problem under discussion. Changes in the species equilibrium mole numbers, 6n, are related, to first order, to changes in the species standard free energy data, &", by 6ni = ni u
+
m k=l
aik6.lrk
- 6(pio/RT)
I (i = 1, 2 , .
. , , N)
(1)
(aik)is the species atom matrix, m is the number of elements, N is the number of species, ni is the equilibrium solution for the given p o , R is the gas constant, T i s the temperature, and u and 6~ are determined from a set of linear equations (see
Smith (1969) for further details). Equation 1 can be used to determine the Jacobian matrix of 6n with respect to changes in each pjo as follows. 6(pj"/RT) is set to unity in the above procedure and all remaining 6 p k 0 are set to zero. Equation 1 then yields anila(pjo/RT);i = 1 , 2 , . . . , N. This is repeated for each j from 1to N until the entire matrix has been generated. The Jacobian matrix thus determined for the example problem is given in Table I. The (i,j)th entry gives the relative change 6nilni per unit change in pjOIRT. In order to use the Jacobian matrix to determine the precision of a calculation, one must know the individual accuracies of the pjo/RT. Then, an approximate upper bound for the precision of a solution is given by
Table I. The Jacobian Matrix (anj/dpj*)/ni Where p i * = p j " / R T at the Equilibrium Solution as Given in Smith (1976), for the Hydrodealkylation of Toluene Example"
-0.790 -0.006 0.877 0.267 -0.009 -0.991 -0.100 0.663 0.191 -0.014 -0.213 -0.054 0.011 0.018 -0.010 -0.016 i, j = 1,2,3,4correspond respectively to the species C6H&H3, H2, CsH6, CHI.
The data used by Bjornbom (1975) come from a graph (Hougen et al., 1962) which yields very approximate data a t best. I used standard free energies of formation of (77 000, 0, 63 000, 4000) cal mol-' for (C6H&h3, H2, C6H6, CHI), respectively, in computing the numerically accurate solution of (0.1183, 0.0787, 0.5439, 2.9081). Reasonable error bounds for the free energy data are (1000, 0, 1000, 150) cal mol-'. Using the Jacobian matrix of Table I and substitution in eq 2 yields a precision vector of (0.104,0.008, 0.115,0.035). We thus see that the free energy data used are probably grossly inaccurate for most purposes, except perhaps for estimating the amounts of H2 and CHI at equilibrium. Thus, Bjornbom's (1975) and my (Smith, 1976) equilibrium solutions for this problem are both equally "precise," given the errors in the data. However, the above sensitivity analysis has shown that our solutions should be highly suspect, especially the equilibrium amounts of CsHsCH3 and C6H6. It should be emphasized that the Jacobian matrix depends in a complex way on the problem data, and its calculation must be performed anew for each problem. Also, such a calculation can only be carried out if one has available a computationally accurate equilibrium solution for a given set of data. This is another reason for using a stringent convergence criterion in the initial equilibrium calculation. To summarize, restricted equilibrium calculations are readily performed using conventional general-purpose unrestricted equilibrium algorithms, provided the atom-balance constraints are appropriately modified by the method of Schott (1964),as described in Smith (1976). Provided one has a means of calculating numerically accurate equilibrium solutions, the determination of the effects of errors in problem input data on the solution may be determined by means of the sensitivity analysis procedure of Smith (1969). The matters raised in this correspondence, as well as other aspects of chemical equilibrium problems, will be discussed more thoroughly in a forthcoming review paper (Smith, 1978). Literature Cited Bjornbom, P. H.. hd. Eng. Chem. fundam., 14, 102 (1975). Brinkley. S.R., Jr., J. Chem. Phys., 14, 563 (1946). Hougen, 0. A,, Watson, K. M., Ragatz, R. A,, "Chemical Process Principles", Part 2, 2nd ed. p 989, Wiley. New York, N.Y., 1962. Smith, W. R., Can. J. Chem. Eng., 47, 95 (1969). Smith, W. R.. Ind. Eng. Chem. fundam., 15, 227 (1976). Smith, W. R., in "Theoretical Chemistry: Advances and Perspectives", H. Eyring and D. Henderson, Ed., Vol. 5 (to appear In 1978). Schott. G. L., J. Chem. Phys., 40, 2065 (1964). White, W. B., Johnson, S.M., Dantzig, G. 8..J. Chem. Phys., 28, 751 (1958).
Mathematics Department Dalhousie University Halifax, Nova Scotia, Canada B3H 4H8
William R. Smith