LU Decomposition and Matrix Inversion
LU Decomposition and Matrix Inversion
LU Decomposition and Matrix Inversion
Faculty of Engineering
Civil Engineering Department
Numerical Analysis
ECIV 3306
Chapter 10
If:
L: lower triangular matrix
U: upper triangular matrix
Then,
[A]{X}={B} can be decomposed into two
matrices [L] and [U] such that:
1. [L][U] = [A] ([L][U]){X} = {B}
LU Decomposition
Consider:
[U]{X} = {D}
So, [L]{D} = {B}
2. [L]{D} = {B} is used to generate an
intermediate vector {D} by forward
substitution.
3. Then, [U]{X}={D} is used to get {X} by back
substitution.
Summary of LU Decomposition
LU Decomposition
3 0.1 0.2 1 0 0
U 0 7.003 0.293 [L ] 0.03333 1 0
0 0 10 .012 0.1000 .02713 1
LU Decomposition-Example (cont’d)
Use previous L and D matrices to solve the system:
3 0.1 0.2 x1 7.85
0.1 7 0 .31 x 19.3
2
0.3 0.2 10 x3 71.4
• % Back Substitution
x(n)=d(n)/a(n,n);
for i=n-1:-1:1
x(i)=(d(i)-a(i,i+1:n)*x(i+1:n)')/a(i,i);
end
Matrix Inverse Using the LU
Decomposition
A 1
{x}1 {x}2 {x}3
Matrix inverse using LU decomposition Example
1 0 0 d1 0 d1 0
0.0333 1 0 d 1 d 1
2 2
0.1000 0.02713 1 d 3 0 d 3 0.02713
2nd column
2B. Then, [U]{X}2={d}2 of [A]-1
F e a2 b2 c2
Length or Euclidean norm of [F]
i 1
P-Norm
1/ p
n
p
X p xi
i 1
1-Norm
For Vector
n
X 1 xi
i 1
Cond A A A1
x3 ~
x3 x3
• Then:
a11 ( ~
x1 x1 ) a12 ( ~
x2 x2 ) a13 ( ~
x3 x3 ) b1
a21 ( ~
x1 x1 ) a22 ( ~
x2 x2 ) a23 ( ~
x3 …
x3 ) b2 …….(Eq.2)
a31 ( ~
x1 x1 ) a32 ( ~
x2 x2 ) a33 ( ~
x3 x3 ) b3
Iterative Refinement (cont’d)
Subtract Eq.2 from Eq.1, the result is a system of linear equations
that can be solved to obtain the correction factors x
~
a11x1 a12 x2 a13x3 b1 b1 E1
~
a21x1 a22 x2 a23x3 b2 b2 E2
~
a31x1 a32 x2 a33x3 b3 b3 E3
x3 ~
x3 x3
Iterative Refinement- Example (cont’d)
~ T
X [0.991 0.997 1.00]
Iterative Refinement - Example
(cont’d)
2- Substitute the result in the original system [A]{x}={c}
~ ~ 5.24511
~
[ A]{ X } {C} {C } 5.22246
2.59032
x1 ~
x1 x1 0.999
x ~
2 x x 1.00
2 2
x3 ~
x3 x3 1.00