12 LU Decomposition Lecture
12 LU Decomposition Lecture
12 LU Decomposition Lecture
LU Decomposition
LU Decomposition is another method to solve a set of
simultaneous linear equations
[A] = [L][U]
where
[L] = lower triangular matrix
[U] = upper triangular matrix
How does LU Decomposition work?
If solving a set of linear equations [A][X] = [C]
If [A] = [L][U] then [L][U][X] = [C]
Multiply by [L]-1
Which gives [L]-1[L][U][X] = [L]-1[C]
Remember [L]-1[L] = [I] which leads to [I][U][X] = [L]-1[C]
Now, if [I][U] = [U] then [U][X] = [L]-1[C]
Now, let [L]-1[C]=[Z]
Which ends with [L][Z] = [C] (1)
and [U][X] = [Z] (2)
LU Decomposition
How can this be used?
[U] is the same as the coefficient matrix at the end of the forward
elimination step.
[L] is obtained using the multipliers that were used in the forward
elimination process
Finding the [U] matrix
Using the Forward Elimination Procedure of Gauss Elimination
25 5 1
64 8 1
144 12 1
25 5 1
2.56; Row 2 Row12.56 0 4.8 1.56
64
Step 1:
25
144 12 1
25 5 1
5.76; Row3 Row15.76 0 4.8 1.56
144
25
0 16.8 4.76
Finding the [U] Matrix
25 5 1
Matrix after Step 1: 0 4.8 1.56
0 16.8 4.76
25 5 1
16.8
Step 2: 3.5; Row3 Row 23.5 0 4.8 1.56
4.8
0 0 0.7
25 5 1
U 0 4.8 1.56
0 0 0.7
Finding the [L] matrix
1 0 0
0
21 1
31 32 1
1 0 0
L 2.56 1 0
5.76 3.5 1
Does [L][U] = [A]?
1 0 0 25 5 1
LU 2.56 1 0 0 4.8 1.56
5.76 3.5 1 0 0 0.7
?
Using LU Decomposition to solve SLEs
Solve the following set of 25 5 1 x1 106.8
linear equations using LU 64 8 1 x 177.2
Decomposition 2
144 12 1 x3 279.2
Using the procedure for finding the [L] and [U] matrices
1 0 0 25 5 1
A LU 2.56 1 0 0 4.8 1.56
5.76 3.5 1 0 0 0.7
Example
Set [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
z1 106.8
z2 177.2 2.56 z1 z1 106.8
177.2 2.56106.8
96.2
Z z2 96.21
z3 279.2 5.76 z1 3.5 z2 z3 0.735
279.2 5.76106.8 3.5 96.21
0.735
Example
Set [U][X] = [Z]
25 5 1 x1 106.8
0 4.8 1.56 x 96.21
2
0 0 0.7 x3 0.735
a3
0.735 96.21 1.56a3
a2
0.7 4.8
a3 1.050 96.21 1.561.050
a2
4.8
a2 19.70
Example
Substituting in a3 and a2 using Hence the Solution Vector is:
the first equation
Using the decomposition procedure, the [L] and [U] matrices are found to be
1 0 0 25 5 1
A LU 2.56 1 0 0 4.8 1.56
5.76 3.5 1 0 0 0.7
Example: Inverse of a Matrix
Solving for the each column of [B] requires two steps
1) Solve [L] [Z] = [C] for [Z]
2) Solve [U] [X] = [Z] for [X]
1 0 0 z1 1
Step 1: LZ C 2.56 1 0 z2 0
5.76 3.5 1 z3 0
This generates the equations:
z1 1
2.56 z1 z 2 0
5.76 z1 3.5 z 2 z3 0
Example: Inverse of a Matrix
Solving for [Z]
z1 1
z1 1
z2 0 2.56 z1
0 2.561
Z z2 2.56
2.56 z3 3.2
z3 0 5.76 z1 3.5 z 2
0 5.761 3.5 2.56
3.2
Example: Inverse of a Matrix
25 5 1 b11 1
Solving [U][X] = [Z] for [X] 0 4.8 1.56 b 2.56
21
0 0 0.7 b31 3.2
8n3 4n 8n3 4n
T 12n 2 T 12n 2
3 3 3 3
29
THE END