• Aucun résultat trouvé

of Systems of Many Constituents

Dans le document Forum putation (Page 78-82)

STUART R. BRINKLEY, JR. ROBERT W. SMITH, JR.

U. S. Bureau of Mines

THE COMPOSITION of a system at chemical equilibrium is easily calculated when there is only a single reaction to be considered. In this case, the concentrations of each constituent can be related to a single variable, "the degree of reaction," and the solution of the mass-action equation is straightforward. Difficulties are encountered if this method is extended to a consideration of two simul-taneous equilibria, and when the number of such simulta-neous equilibria becomes large, the ordinary methods become very laborious.

There is need for a systematic procedure designed to provide a method for writing down the necessary relations in the form most appropriate for numerical computation.

When the number of constituents is large, the relations must usually be solved by an iterative procedure. In the course of an extended program of such calculations, it is usually necessary to formulate a number of computational procedures, in order to assure sufficiently rapid conver-gence. If the calculations are to be carried out by punched card methods, it is desirable that the smallest possible num-ber of arithmetical operations of different kinds be in-volved in order to minimize the number of different con-trol panels required. In a recent publication,! a systematic procedure for calculating the equilibrium composition of a system of many constituents was presented. This method presents a simple rule for formulating the work program of such calculations, with the result that very little time is required for setting up a particular problem. The sys-tematic nature of the computational procedure makes the method well-adapted to punched card methods. The method has been routinely employed in this laboratory in a long series of such calculations. The method is as easily applied to a mixture with a very large number of con-stituents as to a mixture with a small number of constitu-ents, although the time required to obtain the solution would be greater for the former case than for the latter.

In the publication cited, the method was developed for systems of a very general nature. In the present communi-cation, we restrict application of the method to the

calcu-77

lation of the equilibrium composition of mixtures consist-ing of a sconsist-ingle homogeneous gas phase, and we assume that the gas phase is adequately described by the ideal gas equation of state. By taking advantage of these restric-tions, we are able to formulate a computational method, applicable to these particular cases, which is substantially simpler and more systematic than the more general method. A large number of systems of industrial and academic importance is included in this category.

THE COMPONENTS

In a system containing many constituents, it is possible to select certain constituents which are sufficient to de-scribe the composition completely. By this it is meant that if the system is conceived to consist of the selected con-stituents only, its gross composition (in terms of the amounts of each chemical element present) is completely defined. The constituents thus sufficient to describe the composition are called the components of the system. An analytical criterion has been published2 for the choice of the components. In terms of this criterion, the conditions , for equilibrium may be written in a form which has a high degree of symmetry and is particularly well adapted for formulating a computational method for the calculation of the equilibrium composition.

The number of constituents of any system depends upon the accuracy with which it is desired to describe its com-position. The constituents to be considered must be chosen a priori, and this choice usually will imply the neglect of certain equilibria that may be expected to exert a negligi-ble effect on the composition of the system at equilibrium.

Consider a closed system containing s different sub-stances, which are assumed to be in chemical equilibrium.

The molecular formula of the £th substance may be repre-sented by

(1) i

=

1,2, ... s, where X(k) is the symbol of the kth element,

ail,; is the subscript (which may be zero) to this symbol in

78

the formula of the ith substance, and m is the total number of elements represented in the system. For every i, the array of sUbscripts ail., k

=

1, 2, ... , ln, may be said to define a vector

(2) which may be called the formula vector of substance i. If the rank of the matrix of the vector elements ail. is c, it follows from a well-known theorem of algebra that there are c linearly independent vectors, and if c<s there are (s-c) linearly dependent vectors which may be expressed as linear combinations of the independent vectors. It may be assumed that the independent vectors are designated by the values 1, 2, ... , c of their index. Then the dependent vectors may be expressed as linear combinations of the form

t

.1=1 VI, y, = YI , (3)

i = c

+

1, c

+

2, ... , s. To equation (3) there correspond (s-c) conceivable chemical reactions

2:

c 'Vij y(j) = Y(i) j = l

(4) resulting in the formation, from the c substances with linearly independent formula vectors, of the (s-c) sub-stances with linearly dependent formula vectors. It follows that the specification of c substances such that their for-mula vectors are linearly independent is sufficient for a description of the composition of the system. Therefore., the number of components of the system equals the rank c of the matrix of the subscripts to the symbols of the ele-ments in the formulas of the substances comprising the system. It may be noted that the choice of independent vectors is not, in general, unique and that, in consequence, the choice of c substances as components and the expres-sion of the remaining (s-c) substances as products of reactions involving only the chosen components is usually not unique.

This discussion has demonstrated the possibility of a choice of components which makes it possible to express each of the dependent constituents as products of reactions involving components only. Our computational procedure is based upon the possibility of writing down for the case of interest the reactions that are expressed by equations (4). In many cases, it is possible to write these reactions -immediately by intuition. In some cases, it may be neces-sary to formulate the reactions of equations (4) by apply-ing to the system under consideration the steps indicated by equations (1) to (3).

S C I E N T I F I C COMPUTATION

THE BASIC EQUATIONS

According to the phase rule of Gibbs, a system defined by c components existing as an homogeneous gas phase has (c

+

1) degrees of freedom. The thermodynamic state is defined by the specification of two state variables, the temperature and pressure being an appropriate choice. The gross composition is uniquely defined by the specification of (c - 1) composition variables, giving the relative amounts of each element available to the system.* We denote the gram-atom fraction of the kth element by Qk, and the number of moles of the i-component in the hypo-thetical mixture consisting of components only (the mole fractions of the dependent constituents being zero) by qj.

The conversation of each element requires that

(5) k

=

1,2, ... , c - 1, where ajk is the SUbscript to the sym-bol of the kth element in the molecular formula of the jth component. It will be convenient to employ the normaliza-tion relanormaliza-tion,

(6) Equations (5) and (6) consist of c independent, non-homogeneous, linear equations that can be solved for the quantities qj. The conservation of each element in the re-actions (4) for the formation of the dependent constitu-ents from the componconstitu-ents can be expressed in the form

8

Xj

+ 2:

VijXi

=

qiln , (7)

i=C+1

j = 1, 2, ... , c, where Xi and Xi are the mole fractions in the equilibrium mixture of the ith dependent constituent.

and the jth component respectively, Vij is the coefficient of the formula of the jth component in the equation for the reaction leading to the formation of the ith dependent constituent, and n is the total number of moles of gas in the equilibrium mixture corresponding to the normalized constants qj. In view of equation (4),

C 8

2: ~1:j + 2:

Vi Xi = lin, (8)

i = l i=C+1

*Since the composition of the system at eq!lilibri~m is expr~~sec;l in terms of the mole fraction of each constituent m the eqUIlIbrIum mixture the result is independent of the total size of the system, which ~ay be taken to be any convenient value. :from !he point of view of thermodynamics, the molecu!ar form m w~lch. the ele-ments are introduced to the system IS a matter of mdlfference.

where

C

Vi

= 2:

Vij

j = l

The mole fractions are subject to the identity relation

C 8

2:

Xj

+ 2:

''V'i = 1 .

j = l i=C+l

Therefore, equation (8) becomes

8

lin

=

1

+ 2:

(V'i - 1) Xi (9)

i=C+l

and equations (7) may be written

8

X j = q j -

2:

[ V i j - q j ( V i - 1) ] X i , (10)

i=C+1

J 1, 2, ... , c.

The conditions for chemical equilibrium in an ideal gas mixture obeying Dalton's law may be written in the form (11) where

ki

=

KiPVi- 1 ,

i

=

c

+

1, ... , s, and where p is the pressure and ki is the thermodynamic equilibrium constant for the reaction leading to the formation of the ith dependent constituent from the components. The equilibrium constants Ki are independent of the particular system under consideration and are functions of the temperature T only.

The computation of the equilibrium composition re-quires the simultaneous solution of equations (10) and

(11). If

Xi< <x

for all i and j, the solution may be car-ried out by the simple iteration method.3 An approximate set of values is chosen for the .t'j. (In the absence of any criteria for the choice of the initial set, one may take

Xj

=

qj.) Equations (11) are employed in the computation .of corresponding values of the ''Vi. These in turn are em-ployed with equations (10) for the determination of an improved set of values for the Xj. This iterative process is continued until the difference between successive approxi-mations to the Xj is less than the desired precision of the computation.

The c.onvergence of this simple iteration method is very slow for larger relative values of the X'i, and when the Xi

and Xj are of the same order of magnitude, this method may not converge at all for any choice of components.

A more powerful computati.onal procedure is provided by

the N ewton-Raphson method.4 Equations (10) may be written in the form

8

Pj

=

qj - .'Vj -

2:

[Vij - qj (Vi - 1)] Xi , (12)

,i=C+l

j

=

1,2, ... , c. We seek the solution of the equations Pj

=

0, subject to equations (11). If the functions Fj are expanded in Taylor series about an approximate set of values of the variables Xj with neglect of terms involving derivatives of second and higher orders, there results a set of c linear equations which can be compactly repre-sented in the notation of matrices by

[Aj?] [hjt)]

=

[Fy")] , (13) where the rth and (r

+

l)th approximations to the com-position are related by

.~1'+1) _ .,(1')(1

+

1(1'»

.x J - . t J I J ' (14)

and where the elements of the matrix are given by

8

Aji' = .'fj Sji'

+ 2:

Vii' [Vij - qj (Vi - 1)] Xi • i=C+1

(IS) The superscript r indicates that the designated quantity is to be evaluated with the rth approximation to the com-position of the system, and Sjj' is the Kronecker delta.

Criteria for the choice of components that results in the most rapid convergence of the iteration process can be developed from the remainders to the two-term Taylor series expansions of functions Fj • However, the resulting expressions are too cumbersome for practical utility, and in practice the convergence will be found to be satisfactory if the components are selected so as to minimize the quan-tities ki' i

=

c

+

1, ... , s.

NOTES ON COMPUTATIONAL PROCEDURE

In this present section we will describe in some detail the computational procedure based upon the basic equa-tions developed in the preceding secequa-tions. In this labora-tory an extensive program of such calculations is being carried out with punched card equipment which includes a Type 602 Calculating Punch. The calculations could be very easily performed utilizing a Type 604 Electronic Calculating Punch and programs similar to those described in another contribution to this Forum.* The procedure for setting up a particular problem will be found to be quite routine in nature. This procedure will involve the following steps:

*It may be noted that these methods have been successfully em-ployed in an extended series of computations performed by the Bureau of Mines on the Electronic Numerical Integrator and Calculator (ENIAC) at the Aberdeen Proving Ground.

80

1. Select a suitable set of components. This selection can usually be made by intuition. In some cases it may be necessary to follow the formal procedure previously out-lined. Subject to the requirement that the components be linearly independent in the sense defined above, it is usu-ally desirable to select those constituents that are most abundant in the equilibrium mixture.

2. Write the chemical equations in the form of equa-tions (4) which express the formation of the dependent constituents from the components. These equations can usually be written by inspection. In some cases it may be necessary to employ the formal methods previously de-veloped.

3. Construct a table of the coefficients of equations (4)

Vij; j = 1,2, ... , c; i =' c

+

1, c

+

2, ... , s. Tabulate

the quantities (Vi -1). If the solution is to be by the N ew-ton-Raphson method, form the products

Vij Vij' and Vij (Vi ~ 1); j, j' = 1, 2, ... , c; i = c

+

1,

c

+.

2, ... , s.

4. If the solution is to be by the iteration method, write the explicit form of equations (10) and (11) applicable to the problem under consideration, using the table of co-efficients. I f the solution is to be by the N ewton-Raphson method, write the explicit form of equations (11), (12), and (15) applicable to the problem under consideration, using the table of coefficients.

5. In the usual problem a relatively small number of different gross compositions is consi<lered and computa-tions are performed for a variety of different temperatures and pressures. Under these conditions the values of the stoichiometric constants qf are most easily obtained from the specifications of the problem by desk calculations based upon equations (5) and (6). If a large number of dif-ferent mixtures is to be considered, it may be desirable to formulate a routine involving punched card methods for these calculations.

The computational procedure that has been developed appears to be particularly well adapted to the application o"f punched card methods. The procedure involves several instances where a number of arithmetical operations of the same general kind are performed. In each instance, these operations can be performed with a single control panel that requires only modification of the factor wiring.

The notes that follow are based upon experience gained in this laboratory in calculating equilibrium composItion and are presented in the hope that they may be useful to other investigators confronted with the same type of problem.

1. Select a first approximate set of values of the mole fractions of the components Xj. In the absence of data by which a more precise set may be estimated, one can adopt the values .rj = qj for all j.

S C I E N T I F I C COMPUTAT10N 2. Compute the quantity,

The operations involved in this computation are peculiar to the specific problem at hand. The design of control panels for these steps is routine. The coefficients Vij are small integers or simple fractions.

3. Complete the calculation of the values of the mole fractions of the dependent consti~uents. Xi corresponding to the approximate values of the X'j by means of equation ( 11). For this purpose it is useful to sort the cards into groups according to the temperature and ,pressure and to file each such group behind a master card containing the equilibrium constants ki' which are employed as group multipliers. It is also useful to punch the answers Xi on trailer cards which contain a suitable identification code and are prepunched with the quantities

Vij, V'ij Vij', ( v i - I ) , Vij ( v i - I ) ; j,j'

=

1, 2, ... , c.

A separate set of these trailer cards is employed for each value of i. The appropriate set of trailer cards is inserted by means of the collator prior to the calculation of a par-ticular Xi and withdrawn by selection after the calculation.

4. Calculate the quantities Fj , j = 1, 2, . . . , c. For this purpose we rewrite equation (12) in.the form.

8 8

Fj = qj - Xj -

L.

VijXi

+

qj

L.

(Vi -1) X i · (16)

i=C+l i=C+l

In this calculation we have employed the control panel illustrated in Figure 1. The trailer cards from the previous step are sorted into groups with constant values of the qj, and each such group is filed behind a master card contain-ing theqj. The figure assumes that the cards containcontain-ing the Xi are identified by an X punch in position to be read by the fourth control brush, and the master cards are identified by an X punch in position to be read by the fifth control brush. Each group of the cards containing the Xi

is followed by an appropriately identified trailer card that contains the quantities Xj and an X punch which we here assume to be in position to be read by the first control brush. The quantity qj is read from the master card and held in the summary counter until the next master card is read. The master cards are ejected without punching.

For each card containing the XiJ the products Vij Xi and

(v'l-I) Xi are formed and accumulated in the left com-ponents counter. These cards are ejected without punch-ing. The computation is completed on the trailer card and F j is punched in this card.

Co ...

~

r: ~ ~«:-x-~ CO~NTR~OL ~_~~RE:DI~G;-~_~_~TR~_~_~lS~\E~

,,~~~""O ~ ~G ~ ~ S~L ~ oNo Co 0 ~ ~~ ~~~ 0 0 0 0 0 0 oCO

Dans le document Forum putation (Page 78-82)