Sei sulla pagina 1di 5

Matrix Math is described in most Precalculus Texts, e.g., Precalculus, Larson, D.C.

Heath, p 617
Additional reference: Excel for Chemists, E J Billo, John Wiley, p 73 & 205
Solving Systems of Linear Equations using Matrix Operations:
Technologists, engineers and even business men are required to solve systems of linear
equations. Chemical applications include material balance problems and deconvolution of
overlapping UV/Vis spectra. For example, after taking measurements across a distillation
column, the following set of linear equations were generated.
0.75D + 0.02U = 12
0.25D + 0.98U = 88
where D = kg/hr Distillate, U = kg/hr Underflow
To solve for the values of D and U, the student may use the familiar process of rearranging one
equation in terms of one unknown, then substituting this unknown into the other equation to
obtain one equation in one unknown, which is solvable. This process is adequate for simple
problems, but for more complex systems of equations, involving numerous equations and
unknowns, matrix operations are often used.
In the chemistry lab a matrix is a multi-component chemical mixture/solution but in
mathematical terms, a matrix is simply a rectangular array of numbers. The coefficients and
constants of a set of linear equations are written in rectangular arrays (matrices). Then row-bycolumn multiplications are performed to solve for the variables (unknowns). These row-bycolumn operations (algorithms) are tedious when performed by hand, but are easily performed by
scientific calculators and computer software such as MS Excel. [An algorithm is simply an
explicit series of steps.]
General Procedure for Solving Linear Equations with Matrices:
1. Convert the system of equations into two matrices; a matrix of the coefficients of the
variables and a matrix of the constants, for example:
2x 2y = 4
3x + 5y = 14

2.

4
and

5
14
A
B

2
3

where [A] = [matrix of coefficients]


[B] = [matrix of constants]
x

Solve for [X], the matrix of the unknowns, i.e.,


[X] = [A]-1 [B]

using the following operation:

where [A]-1 is the inverse matrix of [A].

How to Multiply Matrices:


In algebra, binomial expressions are multiplied using the FOIL algorithm, e.g.,
(a + b) (c + d) = ac + ad + bc + bd).
With matrices, the algorithm for multiplication is a row by column operation, i.e., first in the
row by first in the column plus second in the row by second in the column and so on.

CH503 MATRIX APPLICATIONS

Page 1

For example, the product of two 2 2 matrices:


a
c

b A

d C

B
(aA bC)

D
(cA dC)

(bB bD)
(cB dD)

The Multiplicative Identity and the Inverse of a Square Matrix:


With real numbers, 1 is the multiplicative identity, i.e., 1 A = A.
1

1
C

With 2 2 matrices, 0 1 is the multiplicative identity matrix, i.e.,

A
C

D
0

With 3 3 matrices,

1
0

D
0
1
0

0
0

is the multiplicative identity matrix, and so on for n n

matrices. The multiplicative identity matrix is referred to with the letter I.


With real numbers, (1/A) is the inverse of A, i.e., A (1/A) = 1
With matrices, matrix A, when multiplied by its inverse matrix, A-1, equals the identity matrix, I.
That is: [A] [A-1] = I. The identity matrix has the following general form:

d
a b D
c d c

b
D 1 0 where: D = ab-bc and D 0
a 0 1
D is called the Determinant of a matrix.

It is beyond the scope of this course to spend time studying these or other matrix operations.
Fortunately, finding the inverse of a matrix of coefficients and multiplying it by a matrix of
constants is easily performed by MS Excel.
Solving Systems of Linear Equations using Matrix Operations in MS Excel:
It is necessary to obtain one independent equation for each unknown. This can be represented by
a square matrix. For example: 3 equations for 3 unknowns yields a 3 3 matrix, 4 equations
for 4 unknowns yields a 4 4 matrix, etc.
Independent equations relate different properties of a system. Multiplying an equation by a
constant produces a new equation but not an independent equation.
In general:

AX = B

where: A = a matrix of coefficients


B = a matrix of constants
X = a matrix of solutions, e.g., (x, y, z), etc.

Rearranging gives:

X=A-1B

where: A-1 is the inverse matrix of A, such that


AA-1 = I

CH503 MATRIX APPLICATIONS

Page 2

The equation, X=A-1B, means that multiplying the inverse of a coefficient matrix (A-1) by the
constants matrix (B) yields the matrix of solutions for the unknowns (X), e.g., (x,y,z).
Creating an Inverse Matrix of a 33 Matrix in Excel:
With the coefficient matrix in cells A2:C4 and with the constants matrix in cells D2:D4,
select an array area of empty cells (33), then choose Insert, Function, Math & Trig,
MINVERSE, OK, click the collapse button, select the cells of the coefficients matrix,
Enter, CTRL + SHIFT + ENTER (instead of clicking OK, otherwise a single value
rather than a matrix of values will be returned).
Obtaining the Solution Matrix, i.e., X=A-1B:
Select an array area (3 1), Insert, Function, Math & Trig, MMULT, OK, click the
collapse button, select the A-1 array, click the collapse button for Array 2, select the array
of constants, Enter, CTRL + SHIFT, + ENTER
OR
Without displaying A-1, select an array area for the solution matrix, X (3 1).
In the formula bar type:
=MMULT(MINVERSE(A2:C4),D2:D4) Then CTRL + SHIFT + ENTER.
The syntax of this combined calculation derives from the syntax of the individual
functions:
MMULT(array1, array2) which multiplies two matrices and
MINVERSE(array) which returns the inverse of a matrix

Do: Industrial Chemistry Material Balance problems (set 2) numbers 1, 5 and 6.


Mixing and distillation (separation) problems are particularly easy to solve by matrix
inversion.
Once a solution is obtained, new solutions are instantly generated when any of the data cells
are changed (as for example correcting data inputs or even solving a new system of linear
equations.
Always check your solutions by substituting the values of the variables into an equation to
ensure the solutions work, i.e., left side = right side of the equation.
Note that these matrix operations only work for square matrices, 22, 33, 44, etc. Thus
matrix operations could not solve a system of equations in which there are more unknowns
than equations. However, bear in mind that unless at least one independent equation is
obtained for each unknown, the problem is not solvable by any algebraic method. If on the
other hand, one has more independent equations than unknowns, these matrix methods can
be applied. For example, if you have 4 independent equations and only 3 unknowns, then
only use 3 of the equations for the matrix solution.

CH503 MATRIX APPLICATIONS

Page 3

A plant engineer wishes to calibrate the flow meters in the Distillate and Underflow of a
distillation column that is used to purify methanol in a mixture of alcohols. He asks a chemical
technologist for assistance. The engineer sets the column Feed rate at 100 lb/min. The
technologist obtained samples from the Feed, Distillate and Underflow of the distillation column
and analyzed them by Gas Chromatography to determined the concentrations shown in the table
below. What are the flow rates of distillate and underflow? Solve this using matrices.
Feed

Distillate

Underflow

Methanol (%w)

50.0

96.0

38.5

Ethanol (%w)

30.0

2.0

37.0

1-Propanol (%w)

20.0

2.0

24.5

Answer: 20.0 lb/hr Distillate and 80.0 lb/hr Underflow.

CH503 MATRIX APPLICATIONS

Page 4

Analysis of Spectra of Mixtures: (Reference: Excel for Chemists, E J Billo, John Wiley, p343)
If the spectra of pure components are available/obtainable, the spectrum of a mixture of
components can be analyzed to determine the concentrations of the individual components. If
the mixture contains N components, then absorbance measurements at N suitable wavelengths
are needed to solve the set of N linear equations in N unknowns.
In spectrophometric analysis, we try to select a unique wavelength for each analyte. This is not
always possible. Impurities (not always removable) cause positive interference if they absorb at
the same wavelength as the analyte. It is not uncommon for a student to report a product
recovery of 110%. Clearly this is incorrect. It may be due to analytical error but is often due to
the presence of more than one compound absorbing at the chosen wavelength. Visible and UV
scans often reveal broad absorption bands and hence several bands may overlap. The absorbance
of overlapping bands are additive. The Beer-Lambert law (A = elc) provides the basis of our
calculation. We will use 1 cm cells so the term, l, can be dropped from the equation.
Consider the case of Co+2 and Ni+2. Co has max at 510 nm and Ni at 394 nm. Both species
produce broad absorption bands overlapping the others at both values of max. Since their visible
spectra overlap, the total absorbance measured at either max will be given by the following
equations:
Atotal = ACo + ANi
Atotal = eCoconc Co + eNiconc Ni
Note that there are 2 unknowns in this equation: conc Co and conc Ni, so we need a second
equation (2 equations for 2 unknowns).

The molar extinction coefficients (molar absorptivities), eCo and eNi, are calculated after
measuring the absorbance of prepared, single-component, standard solutions at both
wavelengths
The absorbance of the mixed solution (Atotal) is then read at both wavelengths. This will
provide data to generate 2 independent equations for the 2 unknowns (the concentrations
of Co and Ni in the mixture).
Write the 2 equations and their corresponding matrices and solve for the concentrations
of Co and Ni in the mixture by matrix inversion and matrix multiplication.
This can be applied to 3, 4, or more component systems as well. One good example is
that of m-nitroaniline, azobenzene and benzoic acid. Apply this to your organic lab and
show your work by handing in the spread sheet and scans with your lab report.

CH503 MATRIX APPLICATIONS

Page 5