Matrix analysis of metamorphic mineral assemblages and reactions: alternatives and extensions

5
Contrib Mineral Petrol (1990) 106:61-65 Contributions to Mineralogy and Petrology Springer-Verlag 1990 Matrix analysis of metamorphic mineral assemblages and reactions: alternatives and extensions Roger Powell Department of Geology, University of Melbourne, Parkville, Victoria 3052, Australia Received December 18, 1989/Accepted May 1, 1990 Abstract. Fisher (1989) advocated using the Singular Value Decomposition (SVD) of the composition matrix of a set of minerals for the determination of reactions between the minerals, and therefore of the compatibility relationships between mineral assemblages. The advan- tage of using the SVD for this is that an independent set of reactions, the left nullspace of the composition matrix, can be determined for a rank-deficient composi- tion matrix which is close to, or within error of, the observed matrix. The zero singular values in the SVD can be identified by propagating the measurement uncer- tainties through to the singular values, and saying that singular values are zero if they are within error of zero. Having obtained an independent set of reactions, the reactions in the independent set can be combined linearly to find the full set of reactions. Propagating the measure- ment uncertainties through to the left nullspace of the composition matrix, the uncertainties in the coefficients of the reactions in the independent set can be determined. From these uncertainties, the uncertainties in all of the reactions can be determined, allowing the identification of reactions which are degenerate within error. This is important because it allows the identification of ambigui- ties in the compatibility relationships between mineral assemblages. Introduction In George Fisher's paper, "Matrix analysis of metamor- phic mineral assemblages and reactions" in Contribu- tions to Mineralogy and Petrology (1989), the use of the Singular Value Decomposition (SVD) for certain pe- trological mixing problems is advocated. The SVD is a particularly powerful tool for looking at rank-deficient and nearly rank-deficient matrices (e.g. Golub and van Loan 1983). In this paper the approach of Fisher (1989) is ex- tended by using an error propagation approach in which uncertainties in the compositions of the minerals are pro- pagated through to uncertainties in the coefficients of the reactions between the minerals. This is worthwhile because it is possible for a reaction to indicate incompati- bility between mineral assemblages, whereas within error the reaction may be degenerate, and the assemblages compatible or incompatible. The error propagation approach involves, in some calculation y = f(x), where x and y are vectors and f is a vector of functions, propagating uncertainties in x, in the form of the covariance matrix of x, Cx, through to the covariance matrix in y, Cr (e.g. Mikhail 1976; Powell and Holland 1988). A covariance matrix has diagonal elements which are the squares of the standard devia- tions, a~, and the off-diagonal elements are the covari- ances, aij. The covariances are related to the correlation coefficients, pij, by a~=a~ajpij. Correlation coefficients are bounded: - 1 < Pij < 1; the geometrical relationships are shown in Powell and Holland (1988, Fig. 3). Cy is related to Cx via the error propagation equation: dy where dxx for vector, -dy 1 dx 1 dy dy z dx- dxl dy3 dx 1 is the Jacobian. For example, the Jacobian x, of length 2, and y, of length 3 would be: dyl- dx 2 dy2 dy3 dx2 In some problems, including the ones of interest here, the error propagation involves matrices, for example propagating uncertainties from the composition matrix of the minerals, X, through to reaction coefficients. The above equations may be used if we write x = vec X, where vec is an operator which makes a vector of X by stacking the columns of X one on another.

Transcript of Matrix analysis of metamorphic mineral assemblages and reactions: alternatives and extensions

Page 1: Matrix analysis of metamorphic mineral assemblages and reactions: alternatives and extensions

Contrib Mineral Petrol (1990) 106:61-65 C o n t r i b u t i o n s to Mineralogy and Petrology �9 Springer-Verlag 1990

Matrix analysis of metamorphic mineral assemblages and reactions: alternatives and extensions Roger Powell

Department of Geology, University of Melbourne, Parkville, Victoria 3052, Australia

Received December 18, 1989/Accepted May 1, 1990

Abstract. Fisher (1989) advocated using the Singular Value Decomposition (SVD) of the composition matrix of a set of minerals for the determination of reactions between the minerals, and therefore of the compatibility relationships between mineral assemblages. The advan- tage of using the SVD for this is that an independent set of reactions, the left nullspace of the composition matrix, can be determined for a rank-deficient composi- tion matrix which is close to, or within error of, the observed matrix. The zero singular values in the SVD can be identified by propagating the measurement uncer- tainties through to the singular values, and saying that singular values are zero if they are within error of zero. Having obtained an independent set of reactions, the reactions in the independent set can be combined linearly to find the full set of reactions. Propagating the measure- ment uncertainties through to the left nullspace of the composition matrix, the uncertainties in the coefficients of the reactions in the independent set can be determined. From these uncertainties, the uncertainties in all of the reactions can be determined, allowing the identification of reactions which are degenerate within error. This is important because it allows the identification of ambigui- ties in the compatibility relationships between mineral assemblages.

Introduction

In George Fisher's paper, "Matrix analysis of metamor- phic mineral assemblages and reactions" in Contribu- tions to Mineralogy and Petrology (1989), the use of the Singular Value Decomposition (SVD) for certain pe- trological mixing problems is advocated. The SVD is a particularly powerful tool for looking at rank-deficient and nearly rank-deficient matrices (e.g. Golub and van Loan 1983).

In this paper the approach of Fisher (1989) is ex- tended by using an error propagation approach in which uncertainties in the compositions of the minerals are pro-

pagated through to uncertainties in the coefficients of the reactions between the minerals. This is worthwhile because it is possible for a reaction to indicate incompati- bility between mineral assemblages, whereas within error the reaction may be degenerate, and the assemblages compatible or incompatible.

The error propagation approach involves, in some calculation y = f(x), where x and y are vectors and f is a vector of functions, propagating uncertainties in x, in the form of the covariance matrix of x, Cx, through to the covariance matrix in y, Cr (e.g. Mikhail 1976; Powell and Holland 1988). A covariance matrix has diagonal elements which are the squares of the standard devia- tions, a~, and the off-diagonal elements are the covari- ances, aij. The covariances are related to the correlation coefficients, pij, by a~=a~ajp i j . Correlation coefficients are bounded: - 1 < Pij < 1; the geometrical relationships are shown in Powell and Holland (1988, Fig. 3). Cy is related to Cx via the error propagation equation:

dy where dxx

for vector,

-dy 1 dx 1

dy dy z d x - dxl

dy3 dx 1

is the Jacobian. For example, the Jacobian

x, of length 2, and y, of length 3 would be:

dyl- dx 2

dy2

dy3 dx2

In some problems, including the ones of interest here, the error propagation involves matrices, for example propagating uncertainties from the composition matrix of the minerals, X, through to reaction coefficients. The above equations may be used if we write x = vec X, where vec is an operator which makes a vector of X by stacking the columns of X one on another.

Page 2: Matrix analysis of metamorphic mineral assemblages and reactions: alternatives and extensions

62

With the development of the mathematics, a simple synthetic example is followed through. This involves 3 phases, A, B and C from one assemblage, and two phases from another, D and E. The underlying composition ma- trix involves each phase as columns, with specified reac- tion relationships, D = 2A + B and E = 2 B + C; the com- position matrix, X, is this matrix plus a perturbing ma- trix whose elements were chosen from the Gaussian dis- tribution, N [0, 0.02] :

0 3 2

~ 3 0 7 X= 1 2 3 +

2 1 2 1 0 9

0.0055 0 .0117 0.0039 0.0478~ 0.0152 0.0242 -0.0202 0.0269 0.0259[ 0.0066 0.0106 0 .0023 0.0039 0.0258[ 0.0005 0.0008 -0.0268 -0.0192 0.0057[ 0.0041 0.0287 -0.0332 0.0255 0.0132J

In the calculations, the covariance matrix of x, Cx, is taken to be diagonal with diagonal elements (0.02(Xij + 0.05)) 2. Thus, the compositions of the minerals are as- sumed to be uncorrelated. This assumption is discussed below.

M a t h e m a t i c s

In the SVD of a matrix X, USV r, the columns of U and V are composed of the left and right singular vectors of X corresponding to the singular values of X which form the diagonal elements of the square diagonal matrix S (e.g. Golub and van Loan 1983). U and V are both orthogonal so U r U = I and VrV =I , where I is the iden- tity matrix, a square diagonal matrix with ones on the diagonal. The dimension of S is the same as the smallest dimension of X, or the maximum possible rank of X. X is nearly rank-deficient matrix if any of the singular values are small, with the effective rank of X correspond- ing to the number of large singular values. A rank-defi- cient matrix near to X is found by setting the small singu- lar values to zero, and the left nullspace of X is then the columns of V corresponding to the zero singular values. The columns of the left nullspace of X constitutes an independent set of reactions between the minerals. The n e a r e s t rank-deficient matrix to X can be found only if X is weighted, by pre- and post-multiplication by weighting matrices, prior to calculation of the SVD (e.g. Golub and van Loan 1983; Fisher 1989). Such weighting is discussed below; without weighting, the development amounts to assuming that the elements of X involve simi- lar uncertainties.

To see if the singular values are zero within the uncer- tainties on X, the Jacobian, ds/dx, is required, denoting the diagonal values of S by s, and vec X by x. The ele- ments of this Jacobian can be derived by differentiating Xv = su with respect to an element of X, X~j . The expres-

sion, X v = s u , comes from post-multiplying both sides of X = U S V r by one right singular vector, v, and noting that because V r V = I , Vrv is a column of I; thus U S V r v = s u , in which u is the left singular vector and s the singular value corresponding to v. Differentiating X v = su with respect to X~j by parts:

j _ d v d u ds ijv+X - - = s - - + u (2)

dXi j d X i j d X i j

where Jij is a zero matrix of the same shape as X with a one in the i j th position. The orthogonality of U and

r dv r du V means that v - - = 0 and u - - = 0 from differen-

dXij dX~j tiating U r U = I and V rV = I with respect to Xij. Premul- tiplying both sides of (2) by u r and rearranging gives:

ds dXi j = ui vj. (3)

d s It is simple to build up the Jacobian, d~x' from these terms.

Evaluating Cs from the error propagation Eq. (1), the standard deviations on the singular values, ask, are:

k s k tTsk ~

1 15.63 0.12 0.76 2 5.964 0.085 1.42 3 3.150 0.045 1.43 4 0.02165 0.06020 278 5 0.007760 0.039280 506

As expected, two of the singular values, 4 and 5, are zero within error.

The right singular vectors corresponding to the zero singular values form a basis of the reaction space; all the reactions which can be written between the minerals can be found by linear combination of the columns of this basis. To find the uncertainties on the values which form this basis, it is necessary to determine the Jacobian, dv

In (2) it is impossible to separate the derivatives dx" of u and v; however, if we start with X rX v =s2 v , formed by pre-multiplying each side of X v = s u by X r, we have an expression not involving u. Differentiating XrXv =sZv with respect to X~j by parts:

(j/~X + Xrjij) r dv 2 dv ds v+X X ~ = s ~ + 2 v (4) . . . . dX i j "

Rearranging:

r 2 dv [ ds T T (X X--s I ) ~ = [ 2 ~ - - J i j X - X Jig)V. LI~ij k U-Ai j

Pre-multiplying both sides by the pseudoinverse of XTX-sZI, denoted ( X r X - s Z I ) +, and noting that this pseudoinverse is orthogonal to v because:

(X r X - s z I) + = V(S 2 - s 2 I) + Yr.

Page 3: Matrix analysis of metamorphic mineral assemblages and reactions: alternatives and extensions

Then:

dv dXi/ -V(S 2-s2I) +Vr(JrX+XrJq) v. (5)

du The Jacobian, d x ' can be built up from these terms.

The right singular values, the independent reactions, T, corresponding to the near zero singular values, in other words the 4 th and 5 th columns of V, are:

T1 T~ A 0.849968 0.172334 B - -0 .0226198 0.828371 C --0.220346 0.373761 D - -0 .423273 --0.0868966 E 0.222104 --0.369938

These independent reactions span reaction space; they can be combined linearly to generate all the reactions in that space. For example, the reaction not involving A, or I-A], is produced by combining the two reactions in T to give a zero reaction coefficient for A. In general, if there are a independent reactions then a - 1 reaction coefficients can be zeroed. Denoting by k the vector of indices, of length a - 1, of the coefficients to be zeroed, then Tk is the a - 1 rows of T corresponding to those coefficients to be zeroed. Denoting the coefficients by which the rows of T should be multiplied for a particular k by c, c can be found by solving the linear equations:

[Tk] c=[O1] or [Tk] 11-0] c=[ 1] [lJ'

The first row of this zeroes the k reaction coefficients; the second makes the elements of c sum to one (to make c closed). The resulting reaction has coefficients, r = T c . To illustrate, to find I-A] from T, a = 2 , k involves 1 index with k [ 1 ] = l , and therefore Tk=[0.8500.172] (after rounding to 3 decimal places). Then

c:[o.s 0 0.11721-1 [0]:[-0.254 ] [1] L 1.2541"

Thus I-A] is r = T c = -0 .254 T 1 + 1.254 T2, giving:

[~ 1.05 B r:l ~

D k 0523 E

or: 0.52 E + 0.001D = 1.05 B + 0.53 C. To find the uncertainties on the reaction coefficients,

Cr, which result from propagating composition uncer- tainties through the calculation of V, T and c, it is neces-

dr sary to determine the Jacobian, dxx" Differentiating r

- -Tc by parts:

dr dt de - c + T ~ x x . dx dx

63

dt . dv In this, t = v e c T, so ~ is composed of terms, d x ' (5),

de leaving dxx to be determined. Now:

dc de d t k

dx d t k dx

where tu=vec T k. The second term is also composed dv

of terms from dxx' (5); the first term can be found from

a general result: if y - - A - i x , then dy _ _ y r | dAij

where | is a Kronecker or outer product (e.g. Mikhail dr

1976). Thus d x can be determined.

As an example, the following are the reaction coeffi- cients, r, for [C], along with the uncertainties on the reaction coefficients, a~,.

r i (Tr i

A 0.599 0 B 0.294 0.018 D - 0.299 0.00778926 E 0.002529 0.00756889

In this, the reaction coefficient of A, rA, was fixed, and thus a~A = 0. Note that the reaction coefficient for E is within error of zero, so the resulting reaction is within error of the degenerate reaction 2 A + B = D . From a compatibility relationship point of view, with A-B-C in one assemblage and D-E in another, D is colinear with A-B within error so that the compatibility relationship of D is ambiguous; within error, D could be inside or outside A-B-C.

Discuss ion

The above approach provides a way of looking at all the reactions between a set of minerals, taking into ac- count the uncertainties on the compositions of the miner- als. If a reaction is within error of being degenerate, this has important implications for compatibility rela- tionships. Consider an effectively ternary system, i.e. one which has only three non-zero singular values within error, with one assemblage A-B-C (with A, B and C not colinear), and a mineral D, which may or may not be incompatible with the assemblage. If the reaction is within error of being degenerate, for example with 2 A + B = D , so that D is close to the A-B tie-line, then D may be compatible or incompatible with A-B-C. In general, if a mineral is involved in a degenerate reaction with minerals in an assemblage which define a boundary face of the composition volume defined by the minerals in the assemblage, then the mineral is within error of being compatible with the assemblage. If two phases in a second assemblage are involved in degenerate reactions with minerals in the first assemblage which define differ- ent boundary faces of the composition volume, then the two assemblages are incompatible. Clearly, non-degener-

Page 4: Matrix analysis of metamorphic mineral assemblages and reactions: alternatives and extensions

64

ate reaction relationships give unambiguous informa- tion.

In the calculations, uncertainties on the elements of the composition matrix are involved not only in the propagation of errors, but also in determining the near- est rank-deficient matrix to the composition matrix. In the above calculations, it was assumed that the composi- tions are uncorrelated, although this is not required by the code in the Appendix. Correlations may arise in many ways but these are usually small enough to be unimportant. From a geometrical point of view (see Pow- ell and Holland 1988), ]/1----/) 2 reflects how flattened the uncertainty ellipse is; for only 25% flattening, ~/ i - -p 2 =0.25, or [p[<0.66: large correlations are required to flatten the ellipse substantially. However, large correla- tions may arise, for example, if uncertainties in Fe 3+ estimated by charge balance are involved, with Fe 3+ being strongly correlated with Fe 2 + and Si.

Finding the nearest rank-deficient matrix to the com- position matrix involves weighting the composition ma- trix prior to calculating the SVD; Fisher (1989) provides a way of doing this. The determination of the weighting matrices effectively involves solution of a regression problem as there are more uncertainties to be included than diagonal elements of the weighting matrices, even in the uneorrelated case; if X is of dimension m by n, then, in general, there will be mn uncertainties to take into account, but only m + n diagonal elements of the weighting matrices. The best way of calculating the weighting matrices is currently under investigation; a method involving minimising the largest absolute residu- als on the uncertainties may be appropriate. It is worth observing that the rank-deficient matrix nearest the com- position matrix, calculated with weighting, is likely to be within the uncertainty bounds on the rank-deficient matrix calculated without weighting.

The matrix calculus results (3,5) presented here, which are new, have more general application, particu- larly in error propagation problems. For example, Eq. (5) provides a quite general way of determining the effective rank of a matrix whose elements are subject to uncer- tainty. For completeness, the derivatives of the left singu- lar vector are:

du _ (U(S 2 - s z I ) Ur) + ( x j r + j u X r ) u . (5) dXiy

Acknowledgements. I would like to thank George Fisher and Frank Spear for helpful reviews; of course, any remaining infelicities are my responsibility. The work was started when I held a Draper Fellowship at the University of Western Australia in 1980; the funding of the former and the hospitality of the latter are gratefully acknowledged.

Appendix

Mathemat ica T M code for the calculations

Mathematica T M (e.g. Wolfram 1988) provides an ideal environment for algorithmic development of the sort involved here, as well as for production work. The software was written on an Apple Macin- tosh; the directions for use are for that front end.

Generating the synthetic data

(* These lines generate a synthetic dataset with the structure of the example used in the text. It uses a function, gaussian, which generates random numbers from a gaussian distribution with mean, mean, and standard deviation, sd. If these lines are put in a Mathe- matica cell and entered, the code will be run; the variables which must be set for the code of the next section to run are the names of the phases, name; the composition matrix, x (with the phases forming the columns of x); and the covariance matrix, covx *)

gaussian[mear~: 0,sd_: 11:= Block[ {re = 1.7155278,x, u = Random[] ,v = Random[]},

While[x = fe(v-- 0.5)/u) ̂ 2 > -- 4 Log[u], u = Random[ ] ; v = Random[ I ] ; mean + sd x];

m = 5 ; n = 5 ; name = {"A","B','C","D","E"}; a = {1,2,1,0,4}; b = {0,3,1,2,1}; c = {3,0,2,1,0}; d = 2 a + b ; e = 2 b + c ; x = Transpose[{a,b,c,d,e}] + Array[gaussian[0,0.02] &,{m,n}] ; covx = DiagonalMatrix[((Flat ten[Transpose[x]l + 0.05)0.02) ^ 2] ;

The algorithm

(* This code, with data set up as in the previous section, generates all the reactions between the minerals, making degenerate reactions if possible. The correspondence between some of the important variables and expressions in the text and in the code is jacs is ds /dx; ir is T; covir is CT, lc is c, j j is dr /dx, and covr is C r. The code will not work with exactly rank-deficient matrices, or with matrices with n > m, because of the way Mathematica works. The function, gray, generates all the combinations involved in tak- ing m items from n, using an algorithm developed in Reingold et al. (1977, p 183); it is used in generating all the reactions from the reactions in the independent set. If these lines are put in a Mathematica cell and entered, the code will be run, producing the output given in the next section *)

gray[n_Integer , - 1 ] := { - 1}; gray[n_Integer,01 := {0}; gray[l~Integer,1] :=gray[n , l l =Par t i t ion[Range[n] , 11; gray[n_Integer,n_Integerl : = gray[n,n] - Range[n] ; gray[n_Integer,m_Integerl : = gray[n,m I =

Par t i t ion[F la t t en[{gray[n- l ,m,] ,Map[Append[ # ,n]&, g r a y [ n - 1 , m - 1]l}],m] ;

(* calculating the SVD of the composition matrix *)

{m,n} = Dimensions[x] ; {u,s,v} = Singular Values [N[x] ] ;

(* determining which singular values are zero within error *)

jacs = Array[Flat ten[Outer[Times,v[[ :~ ] ] ,u[ [ ~ ]111 &,{n}] ; sds = Array[Sqrt [(jacs.covx.TransposeEjacs])[[ # , # ]]]&,{n}]; p = F la t t en [Pos i t ion [ s - 2 sds,_Real?Negative]];

(* determining the independent reactions and the covariance matrix of the coefficients *) u = Transpose[u] ; v = Transpose[v] ; jacv = Flat ten[Map[(pl = # ; Transpose[Flat ten[Array[(

- - v.DiagonalMatr ix[Map[If[Abs[ # ] > 0,1/41= ,0]&, s " 2 -- s[[pl]] ^ 2]].

(s u [ [ ~ 111 v[ [~2 ,p l ] ] + s[[pl]] u [ [ ~ 1,pl]] v[[4#211)&, {m,n}],l]])&,p],l] ;

ir = Transpose[v i i [P] ] ; covir = jacv.covx.Transpose[jacv] ; nir = Length[ir] ;

Pr int ["number of system components = ",n - n i r ] ; Pr int ["number of independent reactions = ",nir] ; Pr int[] ; kk = 0; pp={}; (* determining all the reactions by linear combination of the inde- pendent set. fr is reaction coefficients; sdfr are uncertainties on reaction coefficients *)

Page 5: Matrix analysis of metamorphic mineral assemblages and reactions: alternatives and extensions

65

Scan[

(* do not look at a reaction, k, if it has already been done before *)

(If[k = 4t= ; nir > 0 & & App ly [P lus ,Map[ I f [ In t e r sec t ion [ 4t=, C o m p l e m e n t [ R a n g e E n ] , k ] ] = = 41= ,1,0]&,pp]] = = 0,

I f [n i r = = 1,

(* trivial case of one independen t react ion *)

kc = R a n g e [ n ] ; fr = F l a t t e n [ k ] ; sdfr = A r r a y [ S q r t [ cov i r [ [ 4t-, 41= ] ] ] &,n],

(* general case of m a n y independen t react ions *)

inva = Inverse [Jo in[Transpose[ i t ] I l k ] ] , { a r r a y [ 1 &,{nir}] }]]; r = Chop[Transpose [ J r ] .

(lc = inva . Jo in [Ar ray[0&,{n i r -- 1 }],{ 1 }])];

11 = R a n g e [ n i r - - 1]; 1 = Jo in[ l l ,{n i r}] ; 11 = F l a t t e n [ A r r a y [ k + n( ~ -- 1)&,{nir}]]; j ac = T r a n s p o s e [ F l a t t e n [ T r a n s p o s e [

Outer[Times, lc , inva[[l ,11]]],{ 1,3,2}],1]] ; jj = Transpose[Par t i t ion[ jacv ,n ] ,{3 ,1 ,2}] . l c -

Transpose[ i r ] . jac . jacv[ [ l l ] ] ;

covr = Chop[ j j . covx .Transpose[ j j ] ] ; sdr = Ar rayESqr t [ covr [ [ 41=, 4!= ] ] ] & , { L e n g t h [ c o v r ] } ] ; kc = C o m p l e m e n t [ R a n g e [ n ] , k ] ; pmin = So r t [T ranspose [{Abs [ r ] , Range [n ] }]] [ [ - 1,2]]; fr = r[Ekc]] ; sdfr = Sqrt [ChopEsdr [ [kc ] ] ~' 2 -

(covr [ [pmin ,kc ] ] / sd r [ [ p m i n ] ] ) " 2]] ] ;

(* de te rmin ing which react ion coefficients are zero within er ror *)

p = F l a t t en [Pos i t i on [Abs [ f r ] - 2 sdfr,_Real ?Posi t ive]] ; n a m e p = n a m e [ [ k c ] ] l i P ] ] ; (* the result ing reaction, divided t h r o u g h by smallest coefficient

and ro u n d ed *)

rr = R o u n d [ f r [ [ p ] ] / M i n [ A b s [ f r [ [ p ] ] ] ] ] ;

(* keeping the react ion so tha t it is no t repeated *)

A p p e n d T o [ p p , R a n g e [ n ] [ [kc ] ] [ [ p ] ] ] ;

(* organis ing react ion p r in tou t *)

pr = F la t t en[Pos i t ion[ r r ,_ In teger ?Posi t ive]] ; pl = C o m p l e m e n t [ R a n g e [ L e n g t h [ r r ] ] , p r ] ; co = M a p [ S t r i n g J o i n [ I f [ A b s [ r r [ [ 4+ ]]1 = = 1,'"',

T o S t r i n g [ A b s [ r r [ [ :~ ] ] ] ] ] , n a m e p [ [ 4t= ] ] ] &,Jo in[p l ,pr ] ] ; ss = M a p [{co [ [ 4t= ] ] ,Swi tch[ 41= ,Length[pl ] , " = " ,Length[p] ,

.... , _ , ' " ' ] }&,Range [Leng th [P i l l ; P r in t [ I f [Leng th [p ] = = n - n i r + 1," ","* "],

ApplyEStr ingJo in ,F la t ten[ss ] ] ] ]

) & , g r a y [ n , n i r - 1] ]

Results using the synthetic data

n u m b e r of system componen t s = 3 n u m b e r of independen t react ions = 2

* E = 2 B + C C + 2 D = 4 A + E

* D = 2 A + B

References

Fisher, G W (1989) Mat r ix analysis of me t amorph i c minera l assem- blages and reactions. Con t r ib Minera l Petrol 102:69-77

Golub, G, van Loan CF (1983) Mat r ix computa t ions . Johns Hop- kins Univers i ty Press, Balt imore, 476pp

Mikhai l , E M (1976) Observa t ions and least squares. IEP D u n - D o n - nelly, New York, 498pp

Powell, R, Hol land, TJB (1988) A n internal ly consis tent the rmody- namic datase t with uncer ta int ies and corre la t ions: 3: applica- t ion methods , worked examples and a compute r p rogram. J M e t a m o r p h i c Geol 6 :173-204

Reingold, EM, Nievergelt , J, Deo, N (1977) Combina to r i a l algo- r i thms: theory and practice. Prentice-Hall , New Jersey, 433 pp

Wolfram, S (1988) Ma thema t i ca : a system for doing ma themat ic s by computer . Addison-Wesley, 749pp

Edi tor ia l responsibil i ty: T. Grove