You are on page 1of 12

# Chemical Engineering Numerical Method copyright PCS- FKKKSA, UTM

## Numerical Methods for Chemical Engineers

Chapter 4: System of Linear Algebraic Equation (Decomposition Method)

Saharudin Haron
Page 4 - 1

## Chemical Engineering Numerical Method copyright PCS- FKKKSA, UTM

LU Decomposition
[A ]{X } = {C } Decomposition [U ] [L ] [L ]{ D } = {C } {D } [U ] { X } = { D } {X }
Page 4 - 2

Back substitution

## Chemical Engineering Numerical Method copyright PCS- FKKKSA, UTM

Doolittle LU Decomposition
1) For matrices operation, [A ]{X } = {C }, [A] is decomposed into [L][U]: through nave gauss elimination on matrix A : factors to eliminate element a21, a31 and a32 is used to form matrix [L]
f 21 = a21 a11 f31 = a31 a11 = f32 a32 a22

a11 [U] = 0 0

a12 a22 0

## a13 a23 a33

So,

1 [L] = f 21 f 31

0 1 f 32

0 0 1
Page 4 - 3

## Chemical Engineering Numerical Method copyright PCS- FKKKSA, UTM

Doolittle LU Decomposition
2) Intermediate vector {D} is generated,
1 f 21 f 31 0 1 f 32 [L] 0 d1 c1 0 d 2 = c2 1 c3 d3 {D} {C}

d1 = c1

f21d1 + d2 = c2 d2 = c2 - f21d1

Page 4 - 4

## Chemical Engineering Numerical Method copyright PCS- FKKKSA, UTM

Doolittle LU Decomposition
3) Unknown elements, xn can be solved by back substitution on equation [U]{X} = {D},

## a11 a12 0 a 22 0 0 [U]

x3 = d 3 a33 x3 = d3 a33

## a13 x1 d1 x2 = d 2 a23 a33 x3 d 3 {X } {D}

a11 x1 + a12 x2 + a13 x3 = d1 x1 = d1 a12 x2 a13 x3 a11
Page 4 - 5

## Chemical Engineering Numerical Method copyright PCS- FKKKSA, UTM

Crout LU Decomposition
An alternative approach for the formation of matrices [L] and [U]. i.e. : n = 3, l11 0 [L] = l l 21 22 l31 l 32 0 0 l33 1 u12 [U] = 0 1 0 0 u13 u23 1

Matrices [L] and [U] are generated by sweeping through the matrix by columns and rows : a) Elements of column 1 matrix [L] : li,1 = ai,1 Elements of row 1 matrix [U] : u1,j = a1,j / l1,1 for i = 1, 2, .., n for j = 2, 3, .., n
Page 4 - 6

## Chemical Engineering Numerical Method copyright PCS- FKKKSA, UTM

Crout LU Decomposition
b) Elements of column 2 to n-1matrix [L] :
lij = aij
k = j 1 k =1

lik ukj

## Elements of row 2 to n-1matrix [U] :

u jk = a jk l ji uik
i =1 i = j 1

l jj

Page 4 - 7

## c) Element of column n matrix [L] :

lnn = ann lnk ukn
k =1 k = n 1

## l11 0 [L] = l l 21 22 l31 l 32

0 0 l33

d) Intermediate vector {D} is generated, [L ]{ D } = {C } e) Unknown elements, xn can be solved by back substitution on equation [U]{X} = {D}.
Page 4 - 8

## Chemical Engineering Numerical Method copyright PCS- FKKKSA, UTM

LU Decomposition
(assignment in class)

Use the Doolittle and Crout decomposition method to solve the following equations. 2x1 - 5x2 + x3 = 12 -x1 + 3x2 - x3 = -8 3x1 - 4x2 + 2x3 = 16
Page 4 - 9

## Chemical Engineering Numerical Method copyright PCS- FKKKSA, UTM

Cholesky Decomposition
A method use to decompose a symmetric matrix (aij = aji) The resulting matrices are the transpose of each other

i.e.

Page 4 - 10

## Chemical Engineering Numerical Method copyright PCS- FKKKSA, UTM

Cholesky Decomposition
Therefore,

[L]T

[A] where [L]

Page 4 - 11

## Chemical Engineering Numerical Method copyright PCS- FKKKSA, UTM

Cholesky Decomposition
Steps to decompose matrix [A],
j =i 1 j =1

## Example for 3 x 3 matrix,

l21 =
for i = 1, 2, .., k-1

lki =

l31 = l32 =

lkk = akk l
j =1

j =k 1

l11 = a11
kj
2 l22 = a11 l21

Page 4 - 12