LU Decomposition
LU Decomposition
LU decomposition
Topics
Eigenvalues and eigenvectors
LU decomposition
Objectives
Understanding the mathematical definition of eigenvalues and
eigenvectors
MATHEMATICAL BACKGROUND
eigenvalue problems associated with engineering are typically of the general form
for nontrivial solutions to be possible, the determinant of the matrix must equal zero
Case Study
Case Study
Topics
Eigenvalues and eigenvectors
8n3 4n 8n3 4n
T 12n 2 T 12n 2
3 3 3 3
Objectives
Another way of solving a system of equations is by using a
factorization technique for matrices called LU decomposition
Understanding that LU factorization involves decomposing the
coefficient matrix into two triangular matrices that can then be used
to efficiently evaluate different right-hand-side vectors.
Knowing how to express Gauss elimination as an LU factorization
Applications
Solving linear equations
Inverting a matrix
Computing the determinant
Definition
In numerical analysis and linear algebra, LU decomposition (where
'LU' stands for „lower upper‟, and also called LU factorization) factors
a matrix as the product of a lower triangular matrix and an upper
triangular matrix
Where, A LU
where
and
2. Substitution step
[L] and [U] are used to determine a solution {x} for a right-hand side
{b}. This step itself consists of two steps.
a. First, generate an intermediate vector {d} by forward substitution
b. Then, the result is substituted into equation which can be solved
by back substitution for {x}
1. LU decomposition step
2. Substitution step
One way to find the LU decomposition of this simple matrix would be to simply
solve the linear equations by inspection. Expanding the matrix multiplication
gives
the lower triangular matrix L is a unit triangular matrix. Then the system of
equations has the following solution
[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
25 5 1
64 8 1
144 12 1
25 5 1
Row 2 Row12.56
Step 1: 64
2.56; 0 4.8 1.56
25
144 12 1
25 5 1
Row3 Row15.76
144
5.76; 0 4.8 1.56
25
0 16.8 4.76
Thai Minh Quan - Numerical
21
Methods
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 Row23.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
Thai Minh Quan - Numerical
22
Methods
Finding the [L] matrix
1 0 0
1 0
21
31 32 1
1 0 0
L 2.56 1 0
5.76 3.5 1
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 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
z1 106.8
z 2 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 z 2
z3 0.735
279.2 5.76106.8 3.5 96.21
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
Substituting in a3 and a2 using the first Hence the Solution Vector is:
equation
25a1 5a2 a3 106.8 a1 0.2900
106.8 5a2 a3 a 19.70
a1
25
2
106.8 519.70 1.050
a3
1.050
25
0.2900
[U]
[L]
[A] =
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
z1 1
z1 1
z 2 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
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
[L]{d}=[P]{b}
[U]{x}={d}
[A] =
At the same time, we keep track of the pivot by switching the rows of
the permutation matrix:
8n3 4n 8n3 4n
T 12n 2 T 12n 2
3 3 3 3
Exercises
Use the LU factorization to find the solution
Exercises
Use the LU factorization to find the solution
[L]= [U]=
[x]= {1 2 -1}
Matlab
>> e = eig(A) e=
11.7157
40.0000
68.2843
Thai Minh Quan - Numerical Methods 59
LU decomposition Matlab
The coefficient matrix and the right-hand-side vector can be entered in standard fashion as
We can test that it is correct by computing the original matrix as >> L*U
Thai Minh Quan - Numerical Methods 61
LU decomposition Matlab
x= 3.0000
And then use this result to compute the solution -2.5000
>> x = U\d 7.0000