0% found this document useful (0 votes)
13 views46 pages

Lu Decomposition

This chapter explains LU decomposition, a method for solving simultaneous linear equations by decomposing a nonsingular matrix into lower and upper triangular matrices. It highlights the computational efficiency of LU decomposition compared to Gaussian elimination, particularly when finding the inverse of a matrix, as LU decomposition allows for repeated use of the same decomposition. The chapter also provides examples of how to perform LU decomposition and solve equations using this method.

Uploaded by

nadiasultanabmu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views46 pages

Lu Decomposition

This chapter explains LU decomposition, a method for solving simultaneous linear equations by decomposing a nonsingular matrix into lower and upper triangular matrices. It highlights the computational efficiency of LU decomposition compared to Gaussian elimination, particularly when finding the inverse of a matrix, as LU decomposition allows for repeated use of the same decomposition. The chapter also provides examples of how to perform LU decomposition and solve equations using this method.

Uploaded by

nadiasultanabmu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Chapter 04.

07
LU Decomposition

After reading this chapter, you should be able to:


1. identify when LU decomposition is numerically more efficient than Gaussian
elimination,
2. decompose a nonsingular matrix into LU, and
3. show how LU decomposition is used to find the inverse of a matrix.

I hear about LU decomposition used as a method to solve a set of simultaneous linear


equations. What is it?
We already studied two numerical methods of finding the solution to simultaneous linear
equations – Naïve Gauss elimination and Gaussian elimination with partial pivoting. Then,
why do we need to learn another method? To appreciate why LU decomposition could be a
better choice than the Gauss elimination techniques in some cases, let us discuss first what
LU decomposition is about.
For a nonsingular matrix [A] on which one can successfully conduct the Naïve Gauss
elimination forward elimination steps, one can always write it as
[A] = [L][U ]
where
[L] = Lower triangular matrix
[U ] = Upper triangular matrix
Then if one is solving a set of equations
[ A][ X ] = [C ] ,
then
[L][U ][X ] = [C ] as ([ A] = [L][U ])
Multiplying both sides by [L ] ,
−1

[L]−1 [L][U ][X ] = [L]−1 [C ]


[I ][U ][X ] = [L]−1 [C ] as ([L]−1 [L] = [ I ])
[U ][X ] = [L]−1 [C ] as ([I ][U ] = [U ])
Let
[L]−1 [C ] = [Z ]

04.07.1
04.07.2 Chapter 04.07

then
[L][Z ] = [C ] (1)
and
[U ][X ] = [Z ] (2)
So we can solve Equation (1) first for [Z ] by using forward substitution and then use
Equation (2) to calculate the solution vector [X ] by back substitution.
This is all exciting but LU decomposition looks more complicated than Gaussian
elimination. Do we use LU decomposition because it is computationally more efficient
than Gaussian elimination to solve a set of n equations given by [A][X]=[C]?
For a square matrix [ A] of n × n size, the computational time 1 CT |DE to decompose the [ A]
matrix to [ L][U ] form is given by
 8n 3 20n 
CT |DE = T  + 4n 2 − ,
 3 3 
where
T = clock cycle time 2.
The computational time CT |FS to solve by forward substitution [L][Z ] = [C ] is given by
CT |FS = T (4n 2 − 4n )
The computational time CT |BS to solve by back substitution [U ][ X ] = [Z ] is given by
CT |BS = T (4n 2 + 12n )
So, the total computational time to solve a set of equations by LU decomposition is
CT |LU = CT |DE + CT |FS + CT |BS
 8n 3 20n 
= T  + 4n 2 −  + T (4n 2 − 4n )+ T (4n 2 + 12n )
 3 3 
 8n 3 4n 
= T  + 12n 2 + 
 3 3 

Now let us look at the computational time taken by Gaussian elimination. The computational
time CT |FE for the forward elimination part,
 8n 3 32n 
CT |FE = T  + 8n 2 − ,
 3 3 

1
The time is calculated by first separately calculating the number of additions, subtractions,
multiplications, and divisions in a procedure such as back substitution, etc. We then assume
4 clock cycles each for an add, subtract, or multiply operation, and 16 clock cycles for a
divide operation as is the case for a typical AMD®-K7 chip.
http://www.isi.edu/~draper/papers/mwscas07_kwon.pdf
2
As an example, a 1.2 GHz CPU has a clock cycle of 1 /(1.2 × 109 ) = 0.833333 ns
LU Decomposition 04.07.3

and the computational time CT |BS for the back substitution part is
CT |BS = T (4n 2 + 12n )
So, the total computational time CT |GE to solve a set of equations by Gaussian Elimination
is
CT |GE = CT |FE + CT |BS
 8n 3 32n 
= T  + 8n 2 −  + T (4n 2 + 12n )
 3 3 
 8n 3 4n 
= T  + 12n 2 + 
 3 3 
The computational time for Gaussian elimination and LU decomposition is identical.

This has confused me further! Why learn LU decomposition method when it takes the
same computational time as Gaussian elimination, and that too when the two methods
are closely related. Please convince me that LU decomposition has its place in solving
linear equations!
We have the knowledge now to convince you that LU decomposition method has its
place in the solution of simultaneous linear equations. Let us look at an example where the
LU decomposition method is computationally more efficient than Gaussian elimination.
Remember in trying to find the inverse of the matrix [ A] in Chapter 04.05, the problem
reduces to solving n sets of equations with the n columns of the identity matrix as the RHS
vector. For calculations of each column of the inverse of the [ A] matrix, the coefficient
matrix [ A] matrix in the set of equation [A][X ] = [C ] does not change. So if we use the LU
decomposition method, the [A] = [L ][U ] decomposition needs to be done only once, the
forward substitution (Equation 1) n times, and the back substitution (Equation 2) n times.
Therefore, the total computational time CT |inverse LU required to find the inverse of a
matrix using LU decomposition is
CT |inverse LU = 1× CT |DE + n × CT |FS + n × CT |BS
 8n 3 20n 
= 1 × T  + 4n 2 −  + n × T (4n 2 − 4n )+ n × T (4n 2 + 12n )
 3 3 
 32n 3 20n 
= T  + 12n 2 − 
 3 3 
In comparison, if Gaussian elimination method were used to find the inverse of a matrix, the
forward elimination as well as the back substitution will have to be done n times. The total
computational time CT |inverse GE required to find the inverse of a matrix by using Gaussian
elimination then is
CT |inverse GE = n × CT |FE + n × CT |BS
 8n 3 32n 
= n × T  + 8n 2 −  + n × T (4n 2 + 12n )
 3 3 
04.07.4 Chapter 04.07

 8n 4 4n 2 
= T  + 12n 3 + 
 3 3 
Clearly for large n , CT |inverse GE >> CT |inverse LU as CT |inverse GE has the dominating terms of n 4
and CT |inverse LU has the dominating terms of n 3 . For large values of n , Gaussian elimination
method would take more computational time (approximately n / 4 times – prove it) than the
LU decomposition method. Typical values of the ratio of the computational time for
different values of n are given in Table 1.

Table 1 Comparing computational times of finding inverse of a matrix using LU


decomposition and Gaussian elimination.
n 10 100 1000 10000
CT |inverse GE / CT |inverse LU 3.28 25.83 250.8 2501

Are you convinced now that LU decomposition has its place in solving systems of equations?
We are now ready to answer other curious questions such as
1) How do I find LU matrices for a nonsingular matrix [ A] ?
2) How do I conduct forward and back substitution steps of Equations (1) and (2),
respectively?

How do I decompose a non-singular matrix [ A] , that is, how do I find [A] = [L][U ]?
If forward elimination steps of the Naïve Gauss elimination methods can be applied on a
nonsingular matrix, then [A] can be decomposed into LU as
 a11 a12  a1n 
a a 22  a2n 
[ A] =  21 
     
 
 a n1 an 2  a nn 
1 0  0 u11 u12
 u1n 
 1  u2 n 
 0  0 u22
=  21  
         

  
  n1  n2  1  0  unn 
0
The elements of the [U ] matrix are exactly the same as the coefficient matrix one obtains at
the end of the forward elimination steps in Naïve Gauss elimination.
The lower triangular matrix [L ] has 1 in its diagonal entries. The non-zero elements on the
non-diagonal elements in [L ] are multipliers that made the corresponding entries zero in the
upper triangular matrix [U ] during forward elimination.
Let us look at this using the same example as used in Naïve Gaussian elimination.
LU Decomposition 04.07.5

Example 1
Find the LU decomposition of the matrix
 25 5 1
[A] =  64 8 1
144 12 1
Solution
[A] = [L][U ]
1 0 0 u11 u12 u13 
=  21 1 0  0 u22 u23 
  
 31  32 1  0 0 u33 
The [U ] matrix is the same as found at the end of the forward elimination of Naïve Gauss
elimination method, that is
25 5 1 
[U ] =  0 − 4.8 − 1.56

 0 0 0.7 
To find  21 and  31 , find the multiplier that was used to make the a 21 and a 31 elements zero
in the first step of forward elimination of the Naïve Gauss elimination method. It was
64
 21 =
25
= 2.56
144
 31 =
25
= 5.76
To find  32 , what multiplier was used to make a32 element zero? Remember a 32 element
was made zero in the second step of forward elimination. The [A] matrix at the beginning of
the second step of forward elimination was
25 5 1 
 0 − 4.8 − 1.56 
 
 0 − 16.8 − 4.76
So
− 16.8
 32 =
− 4.8
= 3.5
Hence
 1 0 0
[L] = 2.56 1 0

5.76 3.5 1
Confirm [L][U ] = [A] .
04.07.6 Chapter 04.07

 1 00 25 5 1 
[L][U ] = 2.56 10  0 − 4.8 − 1.56
 
5.76 3.5 1  0 0 0.7 
 25 5 1
=  64 8 1
144 12 1

Example 2
Use the LU decomposition method to solve the following simultaneous linear equations.
 25 5 1  a1  106.8 
 64 8 1 a  = 177.2 
   2  
144 12 1  a 3  279.2
Solution
Recall that
[A][X ] = [C ]
and if
[A] = [L][U ]
then first solving
[L][Z ] = [C ]
and then
[U ][X ] = [Z ]
gives the solution vector [X ] .
Now in the previous example, we showed
[A] = [L][U ]
 1 0 0 25 5 1 
= 2.56 1 0  0 − 4.8 − 1.56
  
5.76 3.5 1  0 0 0.7 
First solve
[L][Z ] = [C ]
 1 0 0  z1  106.8 
2.56 1 0  z  = 177.2 
  2   
5.76 3.5 1  z 3  279.2
to give
z1 = 106.8
2.56 z1 + z 2 = 177.2
5.76 z1 + 3.5z 2 + z3 = 279.2
Forward substitution starting from the first equation gives
z1 = 106.8
LU Decomposition 04.07.7

z 2 = 177.2 − 2.56 z1
= 177.2 − 2.56 × 106.8
= −96.208
z3 = 279.2 − 5.76 z1 − 3.5z 2
= 279.2 − 5.76 × 106.8 − 3.5 × (− 96.208)
= 0.76
Hence
 z1 
[Z ] =  z 2 
 z 3 
 106.8 
= − 96.208
 0.76 
This matrix is same as the right hand side obtained at the end of the forward elimination steps
of Naïve Gauss elimination method. Is this a coincidence?
Now solve
[U ][X ] = [Z ]
25 5 1   a1   106.8 
 0 − 4.8 − 1.56 a  = − 96.208
   2  
 0 0 0.7   a3   0.76 
25a1 + 5a 2 + a3 = 106.8
− 4.8a 2 − 1.56a3 = −96.208
0.7 a3 = 0.76
From the third equation
0.7 a3 = 0.76
0.76
a3 =
0.7
= 1.0857
Substituting the value of a3 in the second equation,
− 4.8a 2 − 1.56a3 = −96.208
− 96.208 + 1.56a3
a2 =
− 4.8
− 96.208 + 1.56 × 1.0857
=
− 4.8
= 19.691
Substituting the value of a 2 and a3 in the first equation,
25a1 + 5a 2 + a3 = 106.8
106.8 − 5a 2 − a3
a1 =
25
04.07.8 Chapter 04.07

106.8 − 5 × 19.691 − 1.0857


=
25
= 0.29048
Hence the solution vector is
 a1  0.29048
a  =  19.691 
 2  
 a3   1.0857 
How do I find the inverse of a square matrix using LU decomposition?
A matrix [B ] is the inverse of [A] if
[A][B] = [I ] = [B][A].
How can we use LU decomposition to find the inverse of the matrix? Assume the first
column of [B ] (the inverse of [A] ) is
[b11 b12 ... ... bn1 ]T
Then from the above definition of an inverse and the definition of matrix multiplication
b11  1
b  0
[A] 21  =  
   
   
bn1  0
Similarly the second column of [B ] is given by
 b12  0
b  1
[A] 22  =  
   
   
bn 2  0
Similarly, all columns of [B ] can be found by solving n different sets of equations with the
column of the right hand side being the n columns of the identity matrix.

Example 3
Use LU decomposition to find the inverse of
 25 5 1
[A] =  64 8 1
144 12 1
Solution
Knowing that
[A] = [L][U ]
 1 0 0 25 5 1 
= 2.56 1 0  0 − 4.8 − 1.56
  
5.76 3.5 1  0 0 0.7 
LU Decomposition 04.07.9

We can solve for the first column of [ B] = [A] by solving for


−1

 25 5 1 b11  1
 64 8 1 b  = 0
   21   
144 12 1 b31  0
First solve
[L][Z ] = [C ] ,
that is
 1 0 0  z1  1
2.56 1 0  z  = 0
  2   
5.76 3.5 1  z 3  0
to give
z1 = 1
2.56 z1 + z 2 = 0
5.76 z1 + 3.5 z 2 + z 3 = 0
Forward substitution starting from the first equation gives
z1 = 1
z2 = 0 − 2.56 z1
= 0 − 2.56(1)
= −2.56
z 3 = 0 − 5.76 z1 − 3.5 z 2
= 0 − 5.76(1) − 3.5(− 2.56 )
= 3.2
Hence
 z1 
[Z ] =  z 2 
 z 3 
 1 
= − 2.56
 3.2 
Now solve
[U ][X ] = [Z ]
that is
25 5 1  b11   1 
 0 − 4.8 − 1.56 b  = − 2.56
   21   
 0 0 0.7  b31   3.2 
25b11 + 5b21 + b31 = 1
− 4.8b21 − 1.56b31 = −2.56
04.07.10 Chapter 04.07

0.7b31 = 3.2
Backward substitution starting from the third equation gives
3.2
b31 =
0.7
= 4.571
− 2.56 + 1.56b31
b21 =
− 4.8
− 2.56 + 1.56(4.571)
=
− 4.8
= −0.9524
1 − 5b21 − b31
b11 =
25
1 − 5(−0.9524) − 4.571
=
25
= 0.04762
Hence the first column of the inverse of [A] is
b11   0.04762 
b  = − 0.9524
 21   
b31   4.571 
Similarly by solving
 25 5 1 b12  0 b12  − 0.08333
 64 8 1 b  = 1 gives b  =  1.417 
   22     22   
144 12 1 b32  0 b32   − 5.000 
and solving
 25 5 1  b13  0 b13   0.03571 
 64 8 1 b  = 0 gives b  = − 0.4643
   23     23   
144 12 1 b33  1 b33   1.429 
Hence
 0.04762 − 0.08333 0.03571 
[A] = − 0.9524 1.417 − 0.4643
−1

 4.571 − 5.000 1.429 


Can you confirm the following for the above example?
[A][A]−1 = [I ] = [A]−1 [A]

Key Terms:
LU decomposition
Inverse
MULTIPLE CHOICE TEST: LU DECOMPOSITION: SIMULTANEOUS LINEAR EQUATIONS

Multiple Choice Test


LU Decomposition Method
Simultaneous Linear Equations

1. LU decomposition method is computationally more efficient than Naïve Gauss


elimination for solving
(A) a single set of simultaneous linear equations
(B) multiple sets of simultaneous linear equations with different coefficient
matrices and same right hand side vectors.
(C) multiple sets of simultaneous linear equations with same coefficient
matrix and different right hand side vectors.
(D) less than ten simultaneous linear equations.

2. The lower triangular matrix [L] in the [L][U] decomposition of matrix given below
⎡25 5 4 ⎤ ⎡ 1 0 0⎤ ⎡u11 u12 u13 ⎤
⎢10 8 16 ⎥ = ⎢l ⎥⎢ ⎥
⎢ ⎥ ⎢ 21 1 0⎥ ⎢ 0 u22 u23 ⎥
⎢⎣ 8 12 22⎥⎦ ⎢⎣l 31 l 32 1⎥⎦ ⎢⎣ 0 0 u33 ⎥⎦
is
⎡ 1 0 0⎤
(A) ⎢0.40000
⎢ 1 0⎥⎥
⎢⎣0.32000 1.7333 1⎥⎦

⎡25 5 4 ⎤
(B) ⎢ 0 6 14.400 ⎥
⎢ ⎥
⎢⎣ 0 0 − 4.2400⎥⎦

⎡ 1 0 0⎤
(C) ⎢10 1 0⎥
⎢ ⎥
⎢⎣ 8 12 0⎥⎦

⎡ 1 0 0⎤

(D) ⎢0.40000 1 0⎥⎥
⎢⎣0.32000 1.5000 1⎥⎦
3. The upper triangular matrix [U] in the [L][U] decomposition of matrix given below
MULTIPLE CHOICE TEST: LU DECOMPOSITION: SIMULTANEOUS LINEAR EQUATIONS

⎡25 5 4 ⎤ ⎡ 1 0 0⎤ ⎡u11 u12 u13 ⎤


⎢ 0 8 16 ⎥ = ⎢l
⎢ ⎥ ⎢ 21 1 0⎥⎥ ⎢⎢ 0 u22 u23 ⎥⎥
⎢⎣ 0 12 22⎥⎦ ⎢⎣l 31 l 32 1⎥⎦ ⎢⎣ 0 0 u33 ⎥⎦
is

⎡ 1 0 0⎤
(A) ⎢0.40000
⎢ 1 0⎥⎥
⎢⎣0.32000 1.7333 1⎥⎦

⎡25 5 4 ⎤
(B) ⎢ 0 6 14.400 ⎥
⎢ ⎥
⎢⎣ 0 0 − 4.2400⎥⎦

⎡25 5 4 ⎤
(C) ⎢ 0 8 16 ⎥
⎢ ⎥
⎢⎣ 0 0 − 2⎥⎦

⎡1 0.2000 0.16000⎤
(D) ⎢0
⎢ 1 2.4000 ⎥⎥
⎢⎣0 0 − 4.240 ⎥⎦

4. For a given 2000 × 2000 matrix [A], assume that it takes about 15 seconds to find the
inverse of [A] by the use of the [L][U] decomposition method, that is, finding the [L][U]
once, and then doing forward substitution and back substitution 2000 times using the
2000 columns of the identity matrix as the right hand side vector. The approximate time,
in seconds, that it will take to find the inverse if found by repeated use of Naive Gauss
Elimination method, that is, doing forward elimination and back substitution 2000 times
by using the 2000 columns of the identity matrix as the right hand side vector is
(A) 300
(B) 1500
(C) 7500
(D) 30000
MULTIPLE CHOICE TEST: LU DECOMPOSITION: SIMULTANEOUS LINEAR EQUATIONS

5. The algorithm in solving the set of equations [A][X] = [C], where [A] = [L][U]
involves solving [L][Z] = [C] by forward substitution. The algorithm to solve [L][Z]=[C]
is given by

(A) z1 = c1 / l11
for i from 2 to n do
sum = 0
for j from 1 to i do
sum = sum + l ij * z j
end do
zi = (ci – sum) / lii
end do

(B) z1 = c1 / l11
for i from 2 to n do
sum = 0
for j from 1 to (i-1) do
sum = sum + l ij * z j
end do
zi = (ci – sum) / lii
end do

(C) z1 = c1 / l11
for i from 2 to n do
for j from 1 to (i-1) do
sum = sum + l ij * z j
end do
zi = (ci – sum) / lii
end do

(D) for i from 2 to n do


sum = 0
for j from 1 to (i-1) do
sum = sum + l ij * z j
end do
zi = (ci – sum) / lii
end do
MULTIPLE CHOICE TEST: LU DECOMPOSITION: SIMULTANEOUS LINEAR EQUATIONS

6. To solve boundary value problems, finite difference method is used resulting in


simultaneous linear equations with tri-diagonal coefficient matrices. These are solved
using the specialized [L][U] decomposition method. The set of equations in matrix form
with a tri-diagonal coefficient matrix for
d2y
2
= 6 x − 0.5 x 2 , y(0) = 0 , y (12) = 0 ,
dx
using finite difference method with a second order accurate central divided difference
method and a step size of h = 4 is
⎡ 1 0 0 0 ⎤ ⎡ y1 ⎤ ⎡ 0 ⎤
⎢0.0625 0.125 0.0625
⎢ 0 ⎥⎥ ⎢⎢ y 2 ⎥⎥ ⎢⎢16.0⎥⎥
(A) =
⎢ 0 0.0625 0.125 0.0625⎥ ⎢ y 3 ⎥ ⎢16.0⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎣ 0 0 0 1 ⎦⎣ y4 ⎦ ⎣ 0 ⎦
⎡ 1 0 0 0 ⎤ ⎡ y1 ⎤ ⎡ 0 ⎤
⎢0.0625 − 0.125 0.0625 0 ⎥⎥ ⎢⎢ y 2 ⎥⎥ ⎢⎢16.0⎥⎥
(B) ⎢ =
⎢ 0 0.0625 − 0.125 0.0625⎥ ⎢ y3 ⎥ ⎢16.0⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎣ 0 0 0 1 ⎦ ⎣ y4 ⎦ ⎣ 0 ⎦
⎡ 1 0 0 0 ⎤ ⎡ y1 ⎤ ⎡ 0 ⎤
⎢ 0
⎢ 0 0 1 ⎥⎥ ⎢⎢ y 2 ⎥⎥ ⎢⎢ 0 ⎥⎥
(C) =
⎢0.0625 − 0.125 0.0625 0 ⎥ ⎢ y3 ⎥ ⎢16.0⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎣ 0 0.0625 − 0.125 0.0625⎦ ⎣ y 4 ⎦ ⎣16.0⎦
⎡ 1 0 0 0 ⎤ ⎡ y1 ⎤ ⎡ 0 ⎤
⎢ 0 0 0 1 ⎥⎥ ⎢⎢ y 2 ⎥⎥ ⎢⎢ 0 ⎥⎥
(D) ⎢ =
⎢0.0625 0.125 0.0625 0 ⎥ ⎢ y 3 ⎥ ⎢16.0⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎣ 0 0.0625 0.125 0.0625⎦ ⎣ y 4 ⎦ ⎣16.0⎦
Chapter 04.07
LU Decomposition – More Examples
Chemical Engineering
Example 1
A liquid-liquid extraction process conducted in the Electrochemical Materials Laboratory
involved the extraction of nickel from the aqueous phase into an organic phase. A typical set
of experimental data from the laboratory is given below.
Ni aqueous phase, a (g l ) 2 2.5 3
Ni organic phase, g (g l ) 8.57 10 12
Assuming g is the amount of Ni in the organic phase and a is the amount of Ni in the
aqueous phase, the quadratic interpolant that estimates g is given by
g = x1a 2 + x2 a + x3 , 2 ≤ a ≤ 3
The solution for the unknowns x1 , x2 , and x3 is given by
 4 2 1  x1  8.57 
6.25 2.5 1  x  =  10 
   2  
 9 3 1  x3   12 
Find the values of x1 , x2 , and x3 using LU decomposition. Estimate the amount of nickel
in the organic phase when 2.3 g l is in the aqueous phase using quadratic interpolation.
Solution
1 0 0 u11 u12 u13 

[A] = [L][U ] =  21 1 0  0 u 22 u 23 
 31  32 1  0 0 u 33 
The [U ] matrix is the same as the one found at the end of the forward elimination steps of the
naïve Gauss elimination method.
Forward Elimination of Unknowns
Since there are three equations, there will be two steps of forward elimination of unknowns.
 4 2 1
6.25 2.5 1
 
 9 3 1
First step
Divide Row 1 by 4 and multiply it by 6.25, that is, multiply it by 6.25 4 = 1.5625 . Then
subtract the result from Row 2.

04.07.1
04.07.2 Chapter 04.07

4 2 1 
Row 2 − (Row 1 × (1.5625)) = 0 − 0.625 − 0.5625

9 3 1 
Divide Row 1 by 4 and multiply it by 9 , that is, multiply it by 9 4 = 2.25 . Then subtract the
result from Row 3.
4 2 1 

Row 3 − (Row 1 × (2.25)) = 0 − 0.625 − 0.5625
0 − 1.5 0.1 
Second step
Now divide Row 2 by − 0.625 and multiply it by − 1.5 , that is, multiply it by
− 1.5 − 0.625 = 2.4 . Then subtract the result from Row 3.
4 2 1 

Row 3 − (Row 2 × (2.4 )) = 0 − 0.625 − 0.5625
0 0 0.1 
4 2 1 
[U ] = 0 − 0.625 − 0.5625

0 0 0.1 
Now find [L] .
1 0 0
[L] =  21 1 0

 31  32 1
From Step 1 of the forward elimination process
6.25
 21 = = 1.5625
4
9
 31 = = 2.25
4
From Step 2 of the forward elimination process
− 1.5
 32 = = 2.4
− 0.625
 1 0 0
[L] = 1.5625 1 0

 2.25 2.4 1
Now that [L ] and [U ] are known, solve [L ][Z ] = [C ] .
 1 0 0  z1  8.57 
1.5625 1 0  z  =  10 
  2   
 2.25 2.4 1  z 3   12 
gives
LU Decomposition-More Examples: Chemical Engineering 04.07.3

z1 = 8.57
1.5625 z1 + z 2 = 10
2.25 z1 + 2.4 z 2 + z 3 = 12
Forward substitution starting from the first equation gives
z1 = 8.57
z 2 = 10 − 1.5625 z1
= 10 − 1.5625 × 8.57
= −3.3906
z 3 = 12 − 2.25 z1 − 2.4 z 2
= 12 − 2.25 × 8.57 − 2.4 × (− 3.3906 )
= 0.855
Hence
 z1   8.57 
[Z ] =  z 2  = − 3.3906
 z 3   0.855 
Now solve [U ][ X ] = [Z ] .
4 2 1   x1   8.57 
0 − 0.625 − 0.5625  x  = − 3.3906
   2  
0 0 0.1   x3   0.855 
4 x1 + 2 x 2 + x3 = 8.57
− 0.625 x 2 + (−0.5625) x3 = −3.3906
0.1x3 = 0.855
From the third equation,

0.1x3 = 0.855
0.855
x3 =
0.1
= 8.55
Substituting the value of x3 in the second equation,
− 0.625 x 2 + (−0.5625) x3 = −3.3906
− 3.3906 − (−0.5625) x3
x2 =
− 0.625
− 3.3906 − (−0.5625) × 8.55
=
− 0.625
= −2.27
Substituting the value of x2 and x3 in the first equation,
4 x1 + 2 x 2 + x3 = 8.57
04.07.4 Chapter 04.07

8.57 − 2 x 2 − x3
x1 =
4
8.57 − 2 × (−2.27) − 8.55
=
4
= 1.14
The solution vector is
 x1   1.14 
 x  = − 2.27 
 2  
 x3   8.55 

The polynomial that passes through the three data points is then
g (a ) = x1 a 2 + x 2 a + x3
= 1.14a 2 + (− 2.27 )a + 8.55, 2 ≤ a ≤ 3
where g is the amount of nickel in the organic phase and a is the amount of nickel in the
aqueous phase.
When 2.3 g l is in the aqueous phase, using quadratic interpolation, the estimated amount of
nickel in the organic phase is
g (2.3) = 1.14 × (2.3) + (− 2.27 ) × (2.3) + 8.55
2

= 9.3596 g/l

SIMULTANEOUS LINEAR EQUATIONS


Topic LU Decomposition – More Examples
Summary Examples of LU decomposition
Major Chemical Engineering
Authors Autar Kaw
Date August 8, 2009
Web Site http://numericalmethods.eng.usf.edu
Chapter 04.07
LU Decomposition – More Examples
Civil Engineering
Example 1
To find the maximum stresses in a compound cylinder, the following four simultaneous
linear equations need to solved.
4.2857 × 10 7 − 9.2307 × 10 5 0 0   c1  − 7.887 × 10 3 
    
4.2857 × 10 − 5.4619 × 10 − 4.2857 × 10 5.4619 × 10 5  c 2  
7 5 7
0 
=
 − 6.5 − 0.15384 6.5 0.15384  c 3   0.007 
 5    
 0 0 4.2857 × 10 7
− 3.6057 × 10  c 4   0 

In the compound cylinder, the inner cylinder has an internal radius of a = 5 " , and an outer
radius c = 6.5 " , while the outer cylinder has an internal radius of c = 6.5 " and an outer
radius of b = 8 " . Given E = 30 × 10 6 psi, ν = 0.3 , and that the hoop stress in the outer
cylinder is given by
E   1 − ν 
σθ = c (1 + ν ) + c 4  2  ,
2  3
1 −ν   r 
find the stress on the inside radius of the outer cylinder.
Find the values of c1 , c 2 , c3 and c 4 using LU decomposition.
Solution
1 0 0 u11 u12 u13 u14 
0
 1 0  0 u 22 u 23 u 24 
0
[A] = [L][U ] =  21
 31  32 0  0
1 0 u 33 u 34 
  
 41  42  43
1  0 0 0 u 44 
The [U ] matrix is the same as the one found at the end of the forward elimination steps of the
naïve Gauss elimination method.
Forward Elimination of Unknowns
Since there are four equations, there will be three steps of forward elimination of unknowns.
4.2857 × 10 7 − 9.2307 × 10 5 0 0 
 
4.2857 × 10 − 5.4619 × 10 − 4.2857 × 10 5.4619 × 10 5 
7 5 7

 − 6.5 − 0.15384 6.5 0.15384 


 
 0 0 4.2857 × 10 7 − 3.6057 × 10 5 

04.07.1
04.07.2 Chapter 04.07

First step
Divide Row 1 by 4.2857 × 10 7 and multiply it by 4.2857 × 10 7 , that is, multiply Row 1 by
4.2857 × 10 7 4.2857 × 10 7 = 1 . Then subtract the result from Row 2.
4.2857 × 10 7 − 9.2307 × 10 5 0 0 
 5 
0 3.7688 × 10 5 − 4.2857 × 10 7 5.4619 × 10 
Row 2 − (Row 1 × (1)) = 
 − 6.5 − 0.15384 6.5 0.15384 
 
 0 0 4.2857 × 10 7 − 3.6057 × 10 5 

Divide Row 1 by 4.2857 × 10 7 and multiply it by − 6.5 , that is, multiply Row 1 by
− 6.5 4.2857 × 10 7 = −1.5167 × 10 −7 . Then subtract the result from Row 3.
4.2857 × 10 7 − 9.2307 × 10 5 0 0 
 
3.7688 × 10 5 − 4.2857 × 10 7 5.4619 × 10 5 
( (
Row 3 − Row 1 × − 1.5167 × 10 −7 )) =
0
 0 − 0.29384 6.5 0.15384 
 
 0 0 4.2857 × 10 7 − 3.6057 × 10 5 

Divide Row 1 by 4.2857 × 10 7 and multiply it by 0, that is, multiply Row 1 by


0 4.2857 × 10 7 = 0 . Then subtract the result from Row 4.
4.2857 × 10 7 − 9.2307 × 10 5 0 0 
 5 
0 3.7688 × 10 5
− 4.2857 × 10 7
5.4619 × 10 
Row 4 − (Row 1 × (0 )) = 
 0 − 0.29384 6.5 0.15384 
 
 0 0 4.2857 × 10 7 − 3.6057 × 10 5 
Second step
Divide Row 2 by 3.7688 × 10 5 and multiply it by − 0.29384 , that is, multiply Row 2 by
− 0.29384 3.7688 × 10 5 = −7.7966 × 10 −.7 . Then subtract the result from Row 3.
4.2857 × 10 7 − 9.2307 × 10 5 0 0 
 5 
3.7688 × 10 5 − 4.2857 × 10 7 5.4619 × 10 
( (
Row 3 − Row 2 × − 7.7966 × 10 −.7 )) =

0
0 0 − 26.914 0.57968 
 
 0 0 4.2857 × 10 7 − 3.6057 × 10 5 

Divide Row 2 by 3.7688 × 10 5 and multiply it by 0 that is, multiply Row 2 by


0 3.7688 × 10 5 = 0 . Then subtract the result from Row 4.
4.2857 × 10 7 − 9.2307 × 10 5 0 0 
 5 
0 3.7688 × 10 5 − 4.2857 × 10 7 5.4619 × 10 
Row 4 − (Row 2 × (0 )) = 
 0 0 − 26.914 0.57968 
 
 0 0 4.2857 × 10 7 − 3.6057 × 10 5 
LU Decomposition-More Examples: Civil Engineering 04.07.3

Third step
Divide Row 3 by − 26.914 and multiply it by 4.2857 × 10 7 that is, multiply Row 3 by
4.2857 × 10 7 − 26.914 = −1.5924 × 10 6 . Then subtract the result from Row 4.
4.2857 × 10 7 − 9.2307 × 10 5 0 0 
 5
3.7688 × 10 − 4.2857 × 10 7 5.4619 × 10 
( ( ))
5
0
Row 4 − Row 3 × − 1.5924 × 10 6 = 
 0 0 − 26.914 0.57968 
 
 0 0 0 5.6250 × 10 5 
The coefficient matrix after the completion of the forward elimination steps is
4.2857 × 10 7 − 9.2307 × 10 5 0 0 
 
3.7688 × 10 5 − 4.2857 × 10 7 5.4619 × 10 5 
[U ] = 
 0
0 0 − 26.9140 0.579684 
 
 0 0 0 5.62500 × 10 5 
Now find [L] .
1 0 0 0
 1 0 0
[L] =  21

 31  32 1 0
 
 41  42  43 1
From the first step of forward elimination,
4.2857 × 10 7
 21 = =1
4.2857 × 10 7
− 6.5
 31 = = −1.5167 × 10 −7
4.2857 × 10 7

0
 41 = =0
4.2857 × 10 7
From the second step of forward elimination,
− 0.29384
 32 = = −7.7966 × 10 −7
3.7688 × 10 5

0
 42 = =0
3.7688 × 10 5
From the third step of forward elimination,
4.2857 × 10 7
 43 = = −1.5294 × 10 6
− 26.914
Hence
 1 0 0 0
 1 1 0 0
[L] = 
− 1.5167 × 10 −7
− 7.7966 × 10 −7
1 0
 
 0 0 − 1.5924 × 10 6 1
Now that [L] and [U ] are known, solve [L ][Z ] = [C ]
04.07.4 Chapter 04.07

 1 0 0 0  z1  − 7.887 × 10 3 
 

 1 1 0 0  z 2   0 
=
− 1.5167 × 10 −7 − 7.7966 × 10 −7
1 0  z 3   0.007 
    
 0 0 − 1.5924 × 10 6 1  z 4   0 
to give
z1 = −7.887 × 10 3
z1 + z 2 = 0
− 1.5167 × 10 −7 z1 + (− 7.7966 × 10 −7 )z 2 + z 3 = 0.007
− 1.5924 × 10 6 z 3 + z 4 = 0
Forward substitution starting from the first equation gives
z1 = −7.887 × 10 3
z 2 = − z1
(
= − − 7.887 × 10 3 )
= 7.887 × 10 3
z 3 = 0.007 − (− 1.5167 × 10 −7 )z1 − (− 7.7966 × 10 −7 )z 2
( ) ( ) (
= 0.007 − − 1.51667 × 10 −7 × − 7.887 × 10 3 − − 7.79662 × 10 −7 × 7.887 × 10 3 ) ( )
= 1.1953 × 10 −2
z 4 = −(− 1.5924 × 10 6 )z 3
( ) (
= − − 1.5924 × 10 6 × 1.1953 × 10 −2 )
= 19034
Hence
 z1  − 7.887 × 10 3 
z   3 
[Z ] =  2  =  7.887 × 10 −2 
 z 3  1.1953 × 10
   
 z 4   19034 
Now solve
[U ][C ] = [Z ]
4.2857 × 10 7 − 9.2307 × 10 5 0 0   c1  − 7.887 × 10 3 
 5 c   3 
 0 3.7688 × 10 5 − 4.2857 × 10 7 5.4619 × 10   2  =  7.887 × 10 
 0 0 − 26.914 0.57968  c3  1.1953 × 10 − 2 
     
 0 0 0 5.6250 × 10 5  c 4   19034 

( )
4.2857 × 10 7 c1 + − 9.2307 × 10 5 c 2 + (0 )c3 + (0 )c 4 = −7.887 × 10 3
3.7688 × 10 c 2
5
+ (− 4.2857 × 10 )c
7
3 + 5.4619 × 10 5 c 4 = 7.887 × 10 3
− 26.914c3 + 0.57968c 4 = 1.1953 × 10 −2
5.6250 × 10 5 c 4 = 19034
LU Decomposition-More Examples: Civil Engineering 04.07.5

From the fourth equation,


5.6250 × 10 5 c 4 = 19034
19034
c4 =
5.6250 × 10 5
= 3.3837 × 10 −2
Substituting the value of c 4 into the third equation,
− 26.914c3 + 0.57968c 4 = 1.1953 × 10 −2
1.1953 × 10 −2 − 0.57968c 4
c3 =
− 26.9140
1.1953 × 10 −2 − 0.57968 × (3.3837 × 10 −2 )
=
− 26.9140
−4
= 2.8469 × 10
Substituting the values of c3 and c 4 into the second equation,
( )
3.7688 × 10 5 c 2 + − 4.2857 × 10 7 c3 + 5.4619 × 10 5 c 4 = 7.887 × 10 3

c2 =
( )
7.887 × 10 3 − − 4.2857 × 10 7 c3 − 5.4619 × 10 5 c 4
3.7668 × 10 5
=
( ) ( ) (
7.887 × 10 3 − − 4.2857 × 10 7 × 2.84687 × 10 −4 − 5.4619 × 10 5 × 3.3838 × 10 −2 )
3.7688 × 10 5
−3
= 4.2615 × 10
Substituting the values of c 2 , c3 and c 4 into the first equation,
( )
4.2857 × 10 7 c1 + − 9.2307 × 10 5 c 2 + (0 )c3 + (0 )c 4 = −7.887 × 10 3

c1 =
(
− 7.887 × 10 3 − − 9.2307 × 10 5 c 2 )
4.2857 × 10 7
=
( ) (
− 7.887 × 10 3 − − 9.2307 × 10 5 × 4.2615 × 10 −3 )
4.2857 × 10 7
= 9.2244 × 10 −5
The solution vector is
 c1  − 9.2244 × 10 −5 
c   −3 
 2  =  4.2615 × 10 
c3   2.8469 × 10 − 4 
   −2 
c 4   3.3837 × 10 
The stress on the inside radius of the outer cylinder is then given by
E   1 − ν 
σθ = c (1 + ν ) + c 4  2 
2  3
1 −ν   r 

30 × 10 6 − 2  1 − 0.3  
2.8469 × 10 (1 + 0.3) + 3.3837 × 10  6.5 2 
−4
=
1 − 0.3 2
  
= 30683 psi
Chapter 04.07
LU Decomposition – More Examples
Computer Engineering
Example 1
To infer the surface shape of an object from images taken of a surface from three different
directions, one needs to solve the following set of equations.
 0.2425 0 − 0.9701  x1  247

 0 0.2425 − 0.9701  x 2  =  248
− 0.2357 − 0.2357 − 0.9428  x3   239
The right hand side values are the light intensities from the middle of the images, while the
coefficient matrix is dependent on the light source directions with respect to the camera. The
unknowns are the incident intensities that will determine the shape of the object.

Find the values of x1 , x 2 , and x3 using LU decomposition.


Solution
1 0 0 u11 u12 u13 

[A] = [L][U ] =  21 1 0  0 u 22 u 23 
 31  32 1  0 0 u 33 
The [U ] matrix is the same as the one found at the end of the forward elimination steps of the
naïve Gauss elimination method.

Forward Elimination of Unknowns


Since there are three equations, there will be two steps of forward elimination of unknowns.
 0.2425 0 − 0.9701

 0 0.2425 − 0.9701
− 0.2357 − 0.2357 − 0.9428

First step
Divide Row 1 by 0.2425 and multiply it by 0, that is, multiply it by 0 0.2425 = 0 . Then
subtract the result from Row 2.
 0.2425 0 − 0.9701

Row 2 − (Row 1 × (0 )) =  0 0.2425 − 0.9701
− 0.2357 − 0.2357 − 0.9428

04.07.1
04.07.2 Chapter 04.07

Divide Row 1 by 0.2425 and multiply it by − 0.2357 , that is, multiply it by


− 0.2357 0.2425 = −0.97196 . Then subtract the result from Row 3.
0.2425 0 − 0.9701

Row 3 − (Row 1 × (− 0.2357 )) =  0 0.2425 − 0.9701
 0 − 0.2357 − 1.8857 
Second step
Now divide Row 2 by 0.2425 and multiply it by − 0.2357 , that is, multiply it by
− 0.2357 0.2425 = −0.97196 . Then subtract the result from Row 3.
0.2425 0 − 0.9701

Row 3 − (Row 2 × (− 0.2357 )) =  0 0.2425 − 0.9701
 0 0 − 2.8286
The coefficient matrix after the completion of the forward elimination steps is
0.2425 0 − 0.9701
[U ] =  0 0.2425 − 0.9701

 0 0 − 2.8286
Now find [L]
1 0 0
[L] =  21 1 0

 31  32 1
From Step 1 of the forward elimination process
0
 21 = =0
0.2425
− 0.2357
 31 = = −0.97196
0.2425
From Step 2 of the forward elimination process
− 0.2357
 32 = = −0.97196
0.2425
 1 0 0

[L] =  0 1 0
− 0.97196 − 0.97196 1
Now that [L] and [U ] are known, solve [L ][Z ] = [C ]
 1 0 0  z1  247 

 0 1 0  z 2  =  248
− 0.97196 − 0.97196 1  z 3  239
to give
z1 = 247
z 2 = 248
LU Decomposition-More Examples: Computer Engineering 04.07.3

(− 0.97196)z1 + (− 0.97196)z 2 + z 3 = 239


Forward substitution starting from the first equation gives
z1 = 247
z2 = 248
z 3 = 239 − (− 0.97196 )z1 − (− 0.97196 )z 2
= 239 − (− 0.97196 ) × 247 − (− 0.97196 ) × 248
= 720.12
Hence
 z1   247 
[Z ] =  z 2  =  248 
 z 3  720.12
Now solve [U ][ X ] = [Z ] .
0.2425 0 − 0.9701  x1   247 
 0
 0.2425 − 0.9701  x 2  =  248 
 0 0 − 2.8286  x3  720.1196
0.2425 x1 + (− 0.9701)x3 = 247
0.2425 x 2 + (− 0.9701)x3 = 248
− 2.8286 x3 = 720.12
From the third equation,
− 2.8286 x3 = 720.12
720.12
x3 =
− 2.8286
= −254.59
Substituting the value of x3 in the second equation,
0.2425 x 2 + (− 0.9701)x3 = 248
248 − (− 0.9701)x3
x2 =
0.2425
248 − (− 0.9701) × (− 254.59 )
=
0.2425
= 4.2328
Substituting the value of x 2 and x3 in the first equation,
0.2425 x1 + (− 0.9701)x3 = 247
247 − (− 0.9701)x3
x1 =
0.2425
247 − (− 0.9701) × (− 254.59 )
=
0.2425
= 0.10905
The solution vector is
04.07.4 Chapter 04.07

 x1   0.10905 
 x  =  4.2328 
 2  
 x3  − 254.59

SIMULTANEOUS LINEAR EQUATIONS


Topic LU Decomposition – More Examples
Summary Examples of LU decomposition
Major Computer Engineering
Authors Autar Kaw
Date August 8, 2009
Web Site http://numericalmethods.eng.usf.edu
Chapter 04.07
LU Decomposition – More Examples
Electrical Engineering
Example 1
Three-phase loads are common in AC systems. When the system is balanced the analysis can
be simplified to a single equivalent circuit model. However, when it is unbalanced the only
practical solution involves the solution of simultaneous linear equations. In one model the
following equations need to be solved.
0.7460 − 0.4516 0.0100 − 0.0080 0.0100 − 0.0080  I ar   120 
0.4516 0.7460 0.0080 0.0100 0.0080 0.0100   I   0.000 
   ai   
0.0100 − 0.0080 0.7787 − 0.5205 0.0100 − 0.0080  I br  − 60.00
   = 
0.0080 0.0100 0.5205 0.7787 0.0080 0.0100   I bi   − 103.9 
0.0100 − 0.0080 0.0100 − 0.0080 0.8080 − 0.6040  I cr  − 60.00
    
0.0080 0.0100 0.0080 0.0100 0.6040 0.8080   I ci   103.9 
Find the values of I ar , I ai , I br , I bi , I cr , and I ci using LU decomposition.
Solution
1 0 0 0 0 0 u11 u12 u13 u14 u15 u16 

 21 1 0 0 0 0  0 u 22 u 23 u 24 u 25 u 26 
  32 1 0 0 0  0 0 u 33 u 34 u 35 u 36 
[A] = [L][U ] =  31  
 41  42  43 1 0 0  0 0 0 u 44 u 45 u 46 
 51  52  53  54 1 0  0 0 0 0 u 55 u 56 
  
 61  62  63  64  65 1  0 0 0 0 0 u 66 
The [U ] matrix is the same as the one found at the end of the forward elimination steps of the
naïve Gauss elimination method.
Forward Elimination of Unknowns
Since there are six equations, there will be five steps of forward elimination of unknowns.
First step
Divide Row 1 by 0.7460 and multiply it by 0.4516, that is, multiply Row 1 by
0.4516 0.7460 = 0.60536 .
Row 1 × (0.60536 ) =
[0.4516 − 0.27338 0.0060536 − 0.0048429 0.0060536 − 0.0048429] [72.643]
Subtract the result from Row 2 to get

04.07.1
04.07.2 Chapter 04.07

0.7460 − 0.4516 0.0100 − 0.0080 0.0100 − 0.0080   I ar   120 


 0 1.0194 0.0019464 0.014843 0.0019464 0.014843  I  − 72.643
  ai   
0.0100 − 0.0080 0.7787 − 0.5205 0.0100 − 0.0080   I br   − 60.00 
   = 
0.0080 0.0100 0.5205 0.7787 0.0080 0.0100   I bi   − 103.9 
0.0100 − 0.0080 0.0100 − 0.0080 0.8080 − 0.6040   I cr   − 60.00 
     
0.0080 0.0100 0.0080 0.0100 0.6040 0.8080   I ci   103.9 

Divide Row 1 by 0.7460 and multiply it by 0.0100, that is, multiply Row 1 by
0.0100 0.7460 = 0.013405 .
Row 1 × (0.013405) =
[0.0100 − 0.0060536 0.00013405 − 0.00010724 0.00013405 − 0.00010724] [1.6086]
Subtract the result from Row 3 to get
0.7460 − 0.4516 0.0100 − 0.0080 0.0100 − 0.0080   I ar   120 
 0
 1.0194 0.0019464 0.014843 0.0019464 0.014843   I ai   − 72.643
 0 − 0.0019464 0.77857 − 0.52061 0.0098660 − 0.0078928  I br  − 61.609
   = 
 0 .0080 0 . 0100 0 .5205 0 .7787 0 .0080 0 .0100   I bi   − 103.9 
0.0100 − 0.0080 0.0100 − 0.0080 0.8080 − 0.6040   I cr   − 60.00 
    
0.0080 0.0100 0.0080 0.0100 0.6040 0.8080   I ci   103.9 

Divide Row 1 by 0.7460 and multiply it by 0.0080, that is, multiply Row 1 by
0.0080 0.7460 = 0.010724 .
Row 1 × (0.010724 ) =
[0.0080 − 0.0048429 0.00010724 − 8.5791 × 10 −5 0.00010724 − 8.5791 × 10 −5 ] [1.2869]
Subtract the result from Row 4 to get
0.7460 − 0.4516 0.0100 − 0.0080 0.0100 − 0.0080   I ar   120 
 0
 1.0194 0.0019464 0.014843 0.0019464 0.014843   I ai   − 72.643
 0 − 0.0019464 0.77857 − 0.52061 0.0098660 − 0.0078928  I br  − 61.609
   = 
 0 0 . 014843 0 .52039 0 . 77879 0 . 0078928 0 . 010086   I bi   − 105.19 
0.0100 − 0.0080 0.0100 − 0.0080 0.8080 − 0.6040   I cr   − 60.00 
    
0.0080 0.0100 0.0080 0.0100 0.6040 0.8080   I ci   103.9 

Divide Row 1 by 0.7460 and multiply it by 0.0100, that is, multiply Row 1 by
0.0100 0.7460 = 0.013405 .
Row 1 × (0.013405) =
[0.0100 − 0.0060536 0.00013405 − 0.00010724 0.00013405 − 0.00010724] [1.6086]
Subtract the result from Row 5 to get
LU Decomposition-More Examples: Electrical Engineering 04.07.3

0.7460 − 0.4516 0.0100 − 0.0080 0.0100 − 0.0080   I ar   120 


 0 1.0194 0.0019464 0.014843 0.0019464 0.014843   I   − 72.643
  ai   
 0 − 0.0019464 0.77857 − 0.52061 0.0098660 − 0.0078928  I br  − 61.609
   = 
 0 0.014843 0.52039 0.77879 0.0078928 0.010086   I bi   − 105.19 
 0 − 0.0019464 0.0098660 − 0.0078928 0.80787 − 0.60389   I cr  − 61.609
     
0.0080 0.0100 0.0080 0.0100 0.6040 0.8080   I ci   103.9 

Divide Row 1 by 0.7460 and multiply it by 0.0080, that is, multiply Row 1 by
0.0080 0.7460 = 0.010724 .
Row 1 × (0.010724 ) =
[0.0080 − 0.0048429 0.00010724 − 8.5791 × 10 −5 0.00010724 − 8.5791 × 10 −5 ] [1.2869]
Subtract the result from Row 6 to get
0.7460 − 0.4516 0.0100 − 0.0080 0.0100 − 0.0080   I ar   120 
 0
 1.0194 0.0019464 0.014843 0.0019464 0.014843   I ai   − 72.643
 0 − 0.0019464 0.77857 − 0.52039 0.0098660 − 0.0078928  I br  − 61.609
   = 
 0 0.014843 0.52039 0.77879 0.0078928 0.010086   I bi   − 105.19 
 0 − 0.0019464 0.0098660 − 0.0078928 0.80787 − 0.60389   I cr  − 61.609
    
 0 0.014843 0.0078928 0.010086 0.60389 0.80809   I ci   102.61 

Second step
Divide Row 2 by 1.0194 and multiply it by −0.0019464, that is, multiply Row 2 by
− 0.0019464 1.0194 = −0.0019094 .
Row 2 × (− 0.0019094 ) =
[0 − 0.0019464 − 3.7164 × 10 −6 − 2.8341 × 10 −5 − 3.7164 × 10 −6 − 2.8341 × 10 −5 ] [0.13870]
Subtract the result from Row 3 to get
0.7460 − 0.4516 0.0100 − 0.0080 0.0100 − 0.0080   I ar   120 
 0
 1.0194 0.0019464 0.014843 0.0019464 0.014843   I ai   − 72.643
 0 0 0.77857 − 0.52036 0.0098697 − 0.0078644  I br  − 61.747 
   = 
 0 0.014843 0.52039 0.77879 0.0078928 0.010086   I bi   − 105.19 
 0 − 0.0019464 0.0098660 − 0.0078928 0.80787 − 0.60389   I cr  − 61.609
    
 0 0.014843 0.0078928 0.010086 0.60389 0.80809   I ci   102.61 

Divide Row 2 by 1.0194 and multiply it by 0.014843, that is, multiply Row 2 by
0.014843 1.0194 = 0.014561 .
Row 2 × (0.014561) =
[0 0.014843 2.8341 × 10 −5 0.00021612 2.8341 × 10 −5 0.00021612 ] [− 1.0577]
Subtract the result from Row 4 to get
04.07.4 Chapter 04.07

0.7460 − 0.4516 0.0100 − 0.0080 0.0100 − 0.0080   I ar   120 


 0 1.0194 0.0019464 0.014843 0.0019464 0.014843   I   − 72.643
  ai   
 0 0 0.77857 − 0.52036 0.0098697 − 0.0078644  I br  − 61.747 
   = 
 0 0 0.52036 0.77857 0.0078644 0.0098697   I bi   − 104.13 
 0 − 0.0019464 0.0098660 − 0.0078928 0.80787 − 0.60389   I cr  − 61.609
     
 0 0.014843 0.0078928 0.010086 0.60389 0.80809   I ci   102.61 

Divide Row 2 by 1.0194 and multiply it by −0.0019464, that is, multiply Row 2 by
− 0.0019464 1.0194 = −0.0019094 .
Row 2 × (− 0.0019094 ) =
[0 − 0.0019464 − 3.7164 × 10 −6 − 2.8341 × 10 −5 − 3.7164 × 10 −6 − 2.8341 × 10 −5 ] [0.13870]
Subtract the result from Row 5 to get
0.7460 − 0.4516 0.0100 − 0.0080 0.0100 − 0.0080   I ar   120 
 0
 1.0194 0.0019464 0.014843 0.0019464 0.014843   I ai   − 72.643
 0 0 0.77857 − 0.52036 0.0098697 − 0.0078644  I br  − 61.747 
   = 
 0 0 0.52036 0.77857 0.0078644 0.0098697   I bi   − 104.13 
 0 0 0.0098697 − 0.0078644 0.80787 − 0.60386   I cr  − 61.747 
    
 0 0.014843 0.0078928 0.010086 0.60389 0.80809   I ci   102.61 

Divide Row 2 by 1.0194 and multiply it by 0.014843, that is, multiply Row 2 by
0.014843 1.0194 = 0.014561 .
Row 2 × (0.014561) =
[0 0.014843 2.8341 × 10 −5 0.00021612 2.8341 × 10 −5 0.00021612 ] [− 1.0577]
Subtract the result from Row 6 to get
0.7460 − 0.4516 0.0100 − 0.0080 0.0100 − 0.0080   I ar   120 
 0
 1.0194 0.0019464 0.014843 0.0019464 0.014843   I ai   − 72.643
 0 0 0.77857 − 0.52036 0.0098697 − 0.0078644  I br  − 61.747 
   = 
 0 0 0 . 52036 0 .77857 0 . 0078644 0 . 0098697   I bi   − 104.13 
 0 0 0.0098697 − 0.0078644 0.80787 − 0.60386   I cr  − 61.747 
    
 0 0 0.0078644 0.0098697 0.60386 0.80787   I ci   103.67 

Third step
Divide Row 3 by 0.77857 and multiply it by 0.52036, that is, multiply Row 3 by
0.52036 0.77857 = 0.66836 .
Row 3 × (0.66836) =
[0 0 0.52036 − 0.34779 0.0065965 − 0.0052563] [− 41.269]
Subtract the result from Row 4 to get
LU Decomposition-More Examples: Electrical Engineering 04.07.5

0.7460 − 0.4516 0.0100 − 0.0080 0.0100 − 0.0080   I ar   120 


 0 1.0194 0.0019464 0.014843 0.0019464 0.014843   I   − 72.643
  ai   
 0 0 0.77857 − 0.52036 0.0098697 − 0.0078644  I br  − 61.747 
   = 
 0 0 0 1.1264 0.0012679 0.015126   I bi  − 62.860
 0 0 0.0098697 − 0.0078644 0.80787 − 0.60386   I cr  − 61.747 
     
 0 0 0.0078644 0.0098697 0.60386 0.80787   I ci   103.67 

Divide Row 3 by 0.77857 and multiply it by 0.0098697, that is, multiply Row 3 by
0.0098697 0.77857 = 0.012677 .
Row 3 × (0.012677 ) =
[0 0 0.0098697 − 0.0065965 0.00012511 − 9.9695 × 10− 5 ]
[− 0.78275]
Subtract the result from Row 5 to get
0.7460 − 0.4516 0.0100 − 0.0080 0.0100 − 0.0080   I ar   120 
 0
 1.0194 0.0019464 0.014843 0.0019464 0.014843   I ai   − 72.643
 0 0 0.77857 − 0.52036 0.0098697 − 0.0078644  I br  − 61.747 
   = 
 0 0 0 1.1264 0.0012679 0.015126   I bi  − 62.860
 0 0 0 − 0.0012679 0.80774 − 0.60376   I cr   − 60.965
    
 0 0 0.0078644 0.0098697 0.60386 0.80787   I ci   103.67 

Divide Row 3 by 0.77857 and multiply it by 0.0078644, that is, multiply Row 3 by
0.0078644 0.77857 = 0.010101 .
Row 3 × (0.010101) =
[0 0 0.0078644 − 0.0052563 9.9695 × 10− 5 − 7.9439 × 10− 5 ]
[− 0.62372]
Subtract the result from Row 6 to get
0.7460 − 0.4516 0.0100 − 0.0080 0.0100 − 0.0080   I ar   120 
 0
 1.0194 0.0019464 0.014843 0.0019464 0.014843   I ai   − 72.643
 0 0 0.77857 − 0.52036 0.0098697 − 0.0078644  I br  − 61.747 
   = 
 0 0 0 1.1264 0.0012679 0.015126   I bi  − 62.860
 0 0 0 − 0.0012679 0.80774 − 0.60376   I cr   − 60.965
    
 0 0 0 0.015126 0.60376 0.80795   I ci   104.29 

Fourth step
Divide Row 4 by 1.1264 and multiply it by −0.0012679, that is, multiply Row 4 by
− 0.0012679 1.1264 = −0.0011257 .
Row 4 × (− 0.0011257 ) =
[0 0 0 − 0.0012679 − 1.4273 × 10− 6 − 1.7027 × 10− 5 ] [0.070761]
04.07.6 Chapter 04.07

Subtract the result from Row 5 to get


0.7460 − 0.4516 0.0100 − 0.0080 0.0100 − 0.0080   I ar   120 
 0
 1.0194 0.0019464 0.014843 0.0019464 0.014843   I ai   − 72.643
 0 0 0.77857 − 0.52036 0.0098697 − 0.0078644  I br  − 61.747 
   = 
 0 0 0 1.1264 0.0012679 0.015126   I bi  − 62.860
 0 0 0 0 0.80775 − 0.60375   I cr   − 61.035
    
 0 0 0 0.015126 0.60376 0.80795   I ci   104.29 

Divide Row 4 by 1.1264 and multiply it by 0.015126, that is, multiply Row 4 by
0.015126 1.1264 = 0.013429 .
Row 4 × (0.013429) =
[0 0 0 0.015126 1.7027 × 10− 5 0.00016196 ][− 0.67308]
Subtract the result from Row 6 to get
0.7460 − 0.4516 0.0100 − 0.0080 0.0100 − 0.0080   I ar   120 
 0
 1.0194 0.0019464 0.014843 0.0019464 0.014843   I ai   − 72.643
 0 0 0.77857 − 0.52036 0.0098697 − 0.0078644  I br  − 61.747 
   = 
 0 0 0 1 . 1264 0. 0012679 0 . 015126   I bi  − 62.860
 0 0 0 0 0.80775 − 0.60375   I cr   − 61.035
    
 0 0 0 0 0.60375 0.80775   I ci   104.97 

Fifth step
Divide Row 5 by 0.80775 and multiply it by 0.60375, that is, multiply Row 5 by
0.60375 0.80775 = 0.74745 .
Row 5 × (0.74741) =
[0 0 0 0 0.60375 − 0.45127] [− 45.621]
Subtract the result from Row 6 to get
0.7460 − 0.4516 0.0100 − 0.0080 0.0100 − 0.0080   I ar   120 
 0
 1.0194 0.0019464 0.014843 0.0019464 0.014843   I ai   − 72.643
 0 0 0.77857 − 0.52036 0.0098697 − 0.0078644  I br  − 61.747 
   = 
 0 0 0 1.1264 0.0012679 0.015126   I bi  − 62.860
 0 0 0 0 0.80775 − 0.60375   I cr   − 61.035
    
 0 0 0 0 0 1.2590   I ci   150.76 

The coefficient matrix after the completion of the forward elimination steps is the [U ]
matrix.
LU Decomposition-More Examples: Electrical Engineering 04.07.7

0.7460 − 0.4516 0.0100 − 0.0080 0.0100 − 0.0080 


 0 1.0194 0.0019464 0.014843 0.0019464 0.014843 

 0 0 0.77857 − 0.52036 0.0098697 − 0.0078644
[U ] =  
 0 0 0 1.1264 0.0012679 0.015126 
 0 0 0 0 0.80775 − 0.60375 
 
 0 0 0 0 0 1.2590 
Now find [L] .
1 0 0 0 0 0

 21 1 0 0 0 0
  1 0 0 0
[L] =  31 32 
 41  42  43 1 0 0
 51  52  53  54 1 0
 
 61  62  63  64  65 1
From Step 1 of the forward elimination process
0.4516
 21 = = 0.60536
0.7460
0.01
 31 = = 0.013405
0.7460
0.008
 41 = = 0.010724
0.7460
0.01
 51 = = 0.013405
0.7460
0.008
 61 = = 0.010724
0.7460
From Step 2 of the forward elimination process
− 0.0019464
 32 = = −0.0019094
1.0194
0.014843
 42 = = 0.014561
1.0194
− 0.0019464
 52 = = −0.0019094
1.0194
0.014843
 62 = = 0.014561
1.0194
From Step 3 of the forward elimination process
0.52036
 43 = = 0.66836
0.77857
0.0098697
 53 = = 0.012677
0.77857
04.07.8 Chapter 04.07

0.0078644
 63 = = 0.01010
0.77857
From Step 4 of the forward elimination process
− 0.0012679
 54 = = −0.0011257
1.1264
0.015126
 64 = = 0.013429
1.1264
From Step 5 of the forward elimination process
0.60375
 65 = = 0.74745
0.80775
Hence
 1 0 0 0 0 0
 0.60536
 1 0 0 0 0
0.013405 − 0.0019094 1 0 0 0
[L] =  
0.010724 0.014561 0.66836 1 0 0
0.013405 − 0.0019094 0.012677 − 0.0011257 1 0
 
0.010724 0.014561 0.01010 0.013429 0.74745 1
Now that [L ] and [U ] are known, solve [L ][Z ] = [C ]
 1 0 0 0 0 0  z1   120 
 0.60536
 1 0 0 0 0  z2   0.000 
0.013405 − 0.0019094 1 0 0 0  z3  − 60.00
   =  
 0 .010724 0 .014561 0 .66836 1 0 0   z4   − 103.9 
0.013405 − 0.0019094 0.012677 − 0.0011257 1 0  z5  − 60.00
    
0.010724 0.014561 0.01010 0.013429 0.74745 1  z6   103.9 
This provides the six equations
z1 = 120
0.60536 z1 + z2 = 0.000
0.013405 z1 + (− 0.0019094 )z2 + z3 = −60.00
0.010724 z1 + 0.014561z2 + 0.66836z 3 + z4 = −103.9
0.013405 z1 + (− 0.0019094 )z2 + 0.012677 z3 + (− 0.0011257 )z4 + z5 = −60.00
0.010724 z1 + 0.014561z2 + 0.01010 z3 + 0.013429 z4 + 0.74745 z5 + z6 = 103.9
Forward substitution starting from the first equation gives
z1 = 120
Substituting the value of z1 into the second equation,
z 2 = −0.60536 z1
= −0.60536(120 )
= −72.643
LU Decomposition-More Examples: Electrical Engineering 04.07.9

Substituting the values of z1 and z 2 into the third equation,


z3 = −60.00 − 0.013405 z1 − (− 0.0019094 )z2
= −60.00 − 0.013405(120 ) − (− 0.0019094 )(− 72.643)
= −61.747
Substituting the values of z1 , z 2 , and z 3 into the fourth equation,
z4 = −103.9 − 0.010724 z1 − 0.014561z2 − 0.66836 z3
= −103.9 − 0.010724(120 ) − 0.014561(− 72.643) − 0.66836(− 61.747 )
= −62.860
Substituting the values of z1 , z 2 , z 3 , and z 4 into the fifth equation,
z 5 = −60.00 − 0.013405 z1 − (− 0.0019094 )z 2 − 0.012677 z 3 − (− 0.0011257 )z 4
= −60.00 − 0.013405(120 ) − (− 0.0019094 )(− 72.643)
− 0.012677(− 61.747 ) − (− 0.0011257 )(− 62.860)
= −61.035
Substituting the values of z1 , z 2 , z 3 , z 4 , and z 5 into the sixth equation,
z6 = 103.9 − 0.010724 z1 − 0.014561z2 − 0.01010 z3 − 0.013429 z4 − 0.74745 z5
= 103.9 − 0.010724(120 ) − 0.014561(− 72.643) − 0.01010(− 61.747 )
− 0.013429(− 62.860 ) − 0.74745(− 61.035)
= 150.76
Hence
 z1   120 
 z   − 72.643
 2  
 z3  − 61.747
[Z ] =   =  
 z4  − 62.860
 z5   − 61.035
   
 z6   150.76 
Now solve [U ][I ] = [Z ] .
0.7460 − 0.4516 0.0100 − 0.0080 0.0100 − 0.0080   I ar   120 
 0
 1.0194 0.0019464 0.014843 0.0019464 0.014843   I ai   − 72.643
 0 0 0.77857 − 0.52036 0.0098697 − 0.0078644  I br  − 61.747
  = 
 0 0 0 1 . 1264 0 . 0012679 0 . 015126   I bi  − 62.860
 0 0 0 0 0.80775 − 0.60375   I cr   − 61.035
    
 0 0 0 0 0 1.2590   I ci   150.76 
This provides the six equations for [I ] .
0.7460 I ar + (− 0.4516)I ai + 0.0100 I br + (− 0.0080)I bi + 0.0100 I cr + (− 0.0080)I ci = 120
1.0194 I ai + 0.0019464 I br + 0.014843I bi + 0.0019464 I cr + 0.014843I ci = −72.643
04.07.10 Chapter 04.07

0.77857 I br + (− 0.52036 )I bi + 0.0098697 I cr + (− 0.0078644 )I ci = −61.747


1.1264 I bi + 0.0012679 I cr + 0.015126 I ci = −62.860
0.80775 I cr + (− 0.60375)I ci = −61.035
1.2590 I ci = 150.76
From the sixth equation
1.2590 I ci = 150.76
150.76
I ci =
1.2590
= 119.74
Substituting the value of I ci into the fifth equation,
0.80775 I cr + (− 0.60375)I ci = −61.035
− 61.035 − (− 0.60375)I ci
I cr =
0.80775
= 13.940
Substituting the values of I cr and I ci into the fourth equation,
1.1264 I bi + 0.0012679 I cr + 0.015126 I ci = −62.860
− 62.860 − 0.0012679 I cr − 0.015126 I ci
I bi =
1.1264
= −57.432
Substituting the values of I bi , I cr , and I ci into the third equation,
0.77857 I br + (− 0.52036 )I bi + 0.0098697 I cr + (− 0.0078644 )I ci = −61.747
− 61.747 − (− 0.52036 )I bi − 0.0098697 I cr − (− 0.0078644 )I ci
I br =
0.77857
= −116.66
Substituting the values of I br , I bi , I cr , and I ci into the second equation,
1.0194 I ai + 0.0019464 I br + 0.014843I bi + 0.0019464 I cr + 0.014843I ci = −72.643
− 72.643 − 0.0019464 I br − 0.014843I bi − 0.0019464 I cr − 0.014843I ci
I ai =
1.0194
= −71.973
Substituting the values of I ai , I br , I bi , I cr , and I ci into the first equation,
0.7460 I ar + (− 0.4516)I ai + 0.0100 I br + (− 0.0080)I bi + 0.0100 I cr + (− 0.0080)I ci = 120
120 − (− 0.4516 )I ai − 0.0100 I br − (− 0.0080 )I bi − 0.0100 I cr − (− 0.0080 )I ci
I ar =
0.7460
= 119.33

The solution vector is


LU Decomposition-More Examples: Electrical Engineering 04.07.11

 I ar   119.33 
 I  − 71.973
 ai   
 I br   − 116.66 
 = 
 I bi  − 57.432
 I cr   13.940 
   
 I ci   119.74 

SIMULTANEOUS LINEAR EQUATIONS


Topic LU Decomposition – More Examples
Summary Examples of LU decomposition
Major Electrical Engineering
Authors Autar Kaw
Date August 8, 2009
Web Site http://numericalmethods.eng.usf.edu
Chapter 04.07
LU Decomposition – More Examples
Industrial Engineering
Example 1
To find the number of toys a company should manufacture per day to optimally use their
injection-molding machine and the assembly line, one needs to solve the following set of
equations. The unknowns are the number of toys for boys, x1 , the number of toys for girls,
x 2 , and the number of unisexual toys, x3 .
0.3333 0.1667 0.6667   x1   756 
0.1667 0.6667 0.3333  x  = 1260
  2   
 1.05 − 1.00 0.00   x3   0 
Find the values of x1 , x 2 , and x3 using naïve Gauss elimination.
Solution
1 0 0 u11 u12 u13 
[A] = [L][U ] =  21 1 0  0 u 22 u 23 

 31  32 1  0 0 u 33 
The [U ] matrix is the same as the one found at the end of the forward elimination steps of the
naïve Gauss elimination method.
Forward Elimination of Unknowns
Since there are three equations, there will be two steps of forward elimination of unknowns.
0.3333 0.1667 0.6667 
0.1667 0.6667 0.3333
 
 1.05 − 1.00 0.00 
First step
Divide Row 1 by 0.3333 and multiply it by 0.1667, that is, multiply Row 1 by
0.1667 0.3333 = 0.50015 . Then subtract the results from Row 2.
0.3333 0.1667 0.6667 

Row 1 × (0.50015) =  0 0.58332 − 0.00015002
 1.05 − 1.00 0.00 

Divide Row 1 by 0.3333 and multiply it by 1.05, that is, multiply Row 1 by
1.05 0.3333 = 3.1503 . Then subtract the results from Row 3.

04.07.1
04.07.2 Chapter 04.07

0.3333 0.1667 0.6667 



Row 1 × (3.1503) =  0 0.58332 − 0.00015002
 0 − 1.5252 − 2.1003 
Second step
We now divide Row 2 by 0.58332 and multiply it by − 1.5252 , that is, multiply Row 2 by
− 1.5252 0.58332 = −2.6146 . Then subtract the results from Row 3.
0.3333 0.1667 0.6667 

Row 2 × (−2.6146) =  0 0.58332 − 0.00015002
 0 0 − 2.1007 
0.3333 0.1667 0.6667 
[U ] =  0 0.58332 − 0.00015002

 0 0 − 2.1007 
Now find [L] .
1 0 0
[L] =  21 1 0

 31  32 1
From the first step of forward elimination,
0.1667
 21 = = 0.50015
0.3333
1.05
 31 = = 3.1503
0.3333
From the second step of forward elimination,
− 1.5252
 32 = = −2.6146
0.58332
Hence
 1 0 0 

[L] = 0.50015 1 0 6
 3.1503 − 2.6146 1 
Now that [L] and [U ] are known, solve [L ][Z ] = [C ]
 1 0 0  z1   756 
0.50015
 1 0  z 2  = 1260
 3.1503 − 2.6146 1  z 3   0 
to give
z1 = 756
0.50015 z1 + z 2 = 1260
3.1503 z1 + (−2.6146) z 2 + z 3 = 0
Forward substitution starting from the first equation gives
z1 = 756
LU Decomposition-More Examples: Industrial Engineering 04.07.3

z 2 = 1260 − 0.50015 z1
= 1260 − 0.50015 × 756
= 881.89
z 3 = 0 − 3.1503 z1 − (−2.6147) z 2
= 0 − 3.1503 × 756 − (−2.6147) × 881.89
= −75.864
Hence
 z1   756 
[Z ] =  z 2  =  881.89 
 z 3  − 75.864
Now solve [U ][ X ] = [Z ] .
0.3333 0.1667 0.6667   x1   756 
 0
 0.58332 − 0.00015002  x 2  =  881.89 
 0 0 − 2.1007   x3  − 75.864
0.3333 x1 + 0.1667 x 2 + 0.6667 x3 = 756
0.58332 x 2 + (−0.00015002) x3 = 881.89
− 2.1007 x3 = −75.864
From the third equation,
− 2.1007 x3 = −75.864
− 75.864
x3 =
− 2.1007
= 36.113
Substituting the value of x3 in the second equation,
0.58332 x 2 + (−0.00015002) x3 = 881.89
881.89 − (−0.00015002) x3
x2 =
0.58332
881.89 − (−0.00015002) × 36.113
=
0.58332
= 1511.8
Substituting the values of x 2 and x3 in the first equation,
0.3333 x1 + 0.1667 x 2 + 0.6667 x3 = 756
756 − 0.1667 x 2 − 0.6667 x3
x1 =
0.3333
756 − 0.1667 × 1511.8 − 0.6667 × 36.113
=
0.3333
= 1439.8
The solution vector is
04.07.4 Chapter 04.07

 x1  1439.8 
 x  = 1511.9 
 2  
 x3  36.113

SIMULTANEOUS LINEAR EQUATIONS


Topic LU Decomposition – More Examples
Summary Examples of LU decomposition
Major Industrial Engineering
Authors Autar Kaw
Date August 8, 2009
Web Site http://numericalmethods.eng.usf.edu
Chapter 04.07
LU Decomposition – More Examples
Mechanical Engineering
Example 1
A trunnion of diameter 12.363 " has to be cooled from a room temperature of 80°F before it
is shrink fitted into a steel hub (Figure 1).

Figure 1 Trunnion to be slid through the hub after contracting.

The equation that gives the diametric contraction ∆D of the trunnion in a dry-ice/alcohol
mixture (boiling temperature is − 108°F ) is given by
−108
∆D = 12.363 ∫ α (T )dT
80

The equation for the thermal expansion coefficient, α = a1 + a 2T + a3T 2 , is obtained using
regression analysis where the constants of the model are found by solving the following
simultaneous linear equations.
 24 − 2860 7.26 × 10 5   a1   1.057 × 10 −4 
   
 − 2860 7.26 × 10 5 − 1.86472 × 10 8  a 2  = − 1.04162 × 10 − 2 
7.26 × 10 5 − 1.86472 × 10 8 5.24357 × 1010   a3   2.56799 
   
Find the values of a1 , a 2 , and a3 using LU decomposition.

04.07.1
04.07.2 Chapter 04.07

Solution
1 0 0 u11 u12 u13 
[A] = [L][U ] =  21 1 0  0 u 22 u 23 

 31  32 1  0 0 u 33 
The [U ] matrix is the same as the one found at the end of the forward elimination steps of the
naïve Gauss elimination method.
Forward Elimination of Unknowns
Since there are three equations, there will be two steps of forward elimination of unknowns.
 24 − 2860 7.26 × 10 5 
 
 − 2860 7.26 × 10 5 − 1.86472 × 10 8 
7.26 × 10 5 − 1.86472 × 10 8 5.24357 × 1010 
 
First step
Divide Row 1 by 24 and multiply it by −2860, that is, multiply it by − 2860 24 = −119.17 .
Then subtract the result from Row 2.
 24 − 2860 7.26 × 10 5 
 
Row 2 − (Row 1 × (− 119.17 )) =  0 3.8518 × 10 5 − 99.957 × 10 6 
7.26 × 10 5 − 1.8647 × 10 8 5.2436 × 1010 
 
Divide Row 1 by 24 and multiply it by 7.26 × 10 5 , that is, multiply it by
7.26 × 10 5 24 = 30250 . Then subtract the result from Row 3.
24 − 2860 7.26 × 105 
 
Row 3 − (Row 1 × 30250 ) =  0 3.8518 × 105 − 99.957 × 106 
 0 − 99.957 × 106 30.474 × 109 

Second step
We now divide Row 2 by 3.8518 × 10 5 and multiply it by − 99.957 × 10 6 , that is, multiply it
by − 99.957 × 10 6 3.8518 × 10 5 = −259.50 . Then subtract the result from Row 3.
24 − 2860 7.26 × 10 5 
 
Row 3 − (Row 2 × (− 259.50 )) =  0 3.8518 × 10 5 − 99.957 × 10 6 
0
 0 4.5349 × 10 9 
24 − 2860 7.26 × 10 5 
 
[U ] =  0 3.8518 × 10 5 − 99.957 × 10 6 
0
 0 4.5349 × 10 9 

Now find [L] .


1 0 0
[L] =  21 1 0
 31  32 1
LU Decomposition-More Examples: Mechanical Engineering 04.07.3

From the first step of forward elimination,


− 2860
 21 = = −119.17
24
7.26 × 10 5
 31 = = 30250
24
From the second step of forward elimination,
− 99.957 × 10 6
 32 = = −259.50
3.8518 × 10 5
 1 0 0

[L] = − 119.17 1 0
 30250 − 259.50 1
Now that [L] and [U ] are known, solve [L ][Z ] = [C ] .
 1 0 0  z1   1.057 × 10 −4 
 
− 119.17
 1 0  z 2  = − 1.04162 × 10 − 2 
 30250 − 259.50 1  z 3   2.56799 

gives
z1 = 1.057 × 10 −4
− 119.17 z1 + z 2 = −1.04162 × 10 −2
30250 z1 + (− 259.50 ) + z 3 = 2.56799
Forward substitution starting from the first equation gives
z1 = 1.057 × 10 −4
z 2 = −1.04162 × 10 −2 − (− 119.17 )z1
= −1.04162 × 10 −2 − (− 119.17 ) × 1.057 × 10 −4
= 0.0021797
z 3 = 2.56799 − 30250 z1 − (− 259.50 )z 2
= 2.56799 − 30250 × 1.057 × 10 −4 − (− 259.50 ) × 0.0021797
= −0.063788
Hence
 z1  1.057 × 10 
−4

[Z ] =  z 2  =  0.0021797 
 z 3   − 0.063788 
Now solve
[U ][A] = [Z ]
24 − 2860 7.26 × 105   a1  1.057 × 10−4 
   
 0 3.8518 × 10
5
− 99.957 × 106  a2  =  0.0021797 
0
 0 4.5349 × 109   a3   − 0.063788 
24a1 + (− 2860 )a2 + 7.26 × 105 a3 = 1.057 × 10−4
04.07.4 Chapter 04.07

( )
3.8518 × 105 a2 + − 99.957 × 106 a3 = 0.0021797
4.5349 × 10 a3 = −0.063788
9

From the third equation,


4.5349 × 109 a3 = −0.063788
− 0.063788
a3 =
4.5349 × 109
= −1.4066 × 10 −11
Substituting the value of a3 in the second equation,
( )
3.8518 × 105 a2 + − 99.957 × 106 a3 = 0.0021797
(
0.0021797 − − 99.957 × 106 a3
a2 =
)
3.8518 × 105
=
( ) (
0.00217975 − − 99.957 × 106 × − 1.4066 × 10−11 )
3.8518 × 105
= 2.0087 × 10 −9
Substituting the value of a2 and a3 in the first equation,
24a1 + (−2860)a2 + 7.26 × 105 a3 = 1.057 × 10−4
1.057 × 10−4 − (−2860)a2 − 7.26 × 105 a3
a1 =
24
=
(
1.057 × 10 − (− 2860 ) × 2.0087 × 10 −9 − 7.26 × 10 5 × − 1.4066 × 10 −11
−4
)
24
−6
= 5.0690 × 10
The solution vector is
 a1   5.0690 × 10 
−6

a  =  2.0087 × 10− 9 
 2  
 a3  − 1.4066 × 10−11 

SIMULTANEOUS LINEAR EQUATIONS


Topic LU Decomposition – More Examples
Summary Examples of LU decomposition
Major Mechanical Engineering
Authors Autar Kaw
Date August 8, 2009
Web Site http://numericalmethods.eng.usf.edu

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy