Professional Documents
Culture Documents
Matrix Inversion
Chapter 2
LU Decomposition
Computational complexity
The Matrix Inverse
Extending the Gaussian Elimination
Process
1
LU Decomposition /LU factorization
3
4
LU Decomposition /LU factorization
[ A ] {X} = {B}
A=[ L ][U]
5
LU Decomposition /LU factorization
[ A ] {X} = {B}
A= [ L ][U]
6
LU Decomposition /LU factorization
[ A ] {X} = {B}
[ L ][U] {X} = {B}
7
LU Decomposition /LU factorization
8
LU-Decomposition Procedure
9
LU-Decomposition Procedure
10
Example 1
Derive LU-D for the coefficients matrix of the following system:
𝑥1 + 2𝑥2 + 3𝑥3 = 9
2𝑥1 − 𝑥2 + 𝑥3 = 8
3𝑥1 − 𝑥3 =3
Solution
1 2 3
1. A= 2 −1 1
3 0 −1
-2R1 + R2 1 2 3
2. A
-3R1 + R3
0 −5 −5 = U1
0 −6 −10
11
Example 1
Solution (cont..) How to obtain the factorization ?
-6/5R1 + R3 1 2 3
U1 0 −5 −5 = U2 = Upper Triangular Form
0 0 −4
Derive
𝑎21 2
1 0 0 𝑙∗21 = = =2
𝑎11 1
3.
𝐿1 = 𝑙 ∗ 21 1 0
𝑎31 3
𝑙 ∗ 31 𝑙32 1 ∗
𝑙 31 = = =3
𝑎11 1
* Means known
12
Example 1
Solution (cont..)
𝑎′32 −6
Derive L2 𝑙∗ 32 =𝑎′ = = 1.2
22 −5
1 0 0
𝐿2 = 2 1 0 the Lower triangular
3 1.2 1 form
1 0 0 1 2 3 1 2 3
4. LU = 2 1 0 0 −5 −5 = 2 −1 1 =A
3 1.2 1 0 0 −4 3 0 −1
13
Example2
Solve the following system using LU-D method
𝑥1 + 2𝑥2 + 3𝑥3 = 9
2𝑥1 − 𝑥2 + 𝑥3 = 8
3𝑥1 − 𝑥3 =3
Solution
1 2 3 𝑥1 9
2 −1 1 𝑥2 = 8
1. 3 0 −1 𝑥3 3
1 2 3 1 0 0 1 2 3
2.
2 −1 1 = 2 1 0 0 −5 −5
3 0 −1 3 1.2 1 0 0 −4 Forward
Substitution
3. 1 0 0 𝑑1 9
2 1 0 𝑑2 = 8
3 1.2 1 𝑑3 3
14
Solution (cont..)
𝑑1 = 9
4.
2𝑑1 + 𝑑2 = 8
2(9) + 𝑑2 = 8
18 + 𝑑2 = 8
d2= -10
3𝑑1 + 1.2𝑑2 + 𝑑3 = 3
3(9) +1.2 (-10) + 𝑑3 = 3
27 – 12 +𝑑3 = 3
15 +𝑑3 = 3
d3 = -12
15
Solution (cont..)
1 2 3 𝑥1 9
Backward
0 −5 −5 𝑥2 = −10
5.
substitution
0 0 −4 𝑥3 −12
6. −12
X3 = =3
−4
𝑥1 + 2𝑥2 + 3𝑥3 = 9
𝑥1 +2(-1) + 3( 3) = 9
𝑥1 − 2 + 9 = 9
x1 = 2
7. Check….
The solution is { 2, -1, 3 }
17
The Matrix Inverse
• Find matrix A
1
the inverse of [A], for which
−1
𝐴 𝐴 = 𝐴−1 𝐴 = 𝐼
18
1
• The solution of [L][U]{X}={B} with 0
0
. will be the first column of A1
0
•The solution of [L][U]{X}={B} with
1
will be the second column of A1 0
19
Example 2:
Use LU decomposition to determine the matrix
inverse for the following system and use it to
find the solution:
3x1 – 0.1x2 – 0.2x3 = 7.85
0.1x1 + 7x2 – 0.3x3 = -19.3
0.3x1 – 0.2x2 + 103 = 71.4
20
Example 2- solution
1 0 0 d1 1 1
0.0333333
1 0 d 2 0 D 0.03333
0.100000 0.0271300 1
d3 0
0.1009
21
3 0.1 0.2 x1 1 0.33249
0 7.00333 0.293333 x 0.03333 X 0.00518
2
0 0 10.0120
x3 0.1009
0.01008
22
The third column of [ A ]-1
1 0 0 d1 0 0
0.0333333
1 0 d 2 0 D 0
0.100000 0.0271300 1 1
3
d 1
23
• Check your result by verifying that [ A ] [A ]-1 = [I]
24
Extending the Gaussian Elimination Process
Example 3
Use LU decomposition with permutation to solve the following
system of equations
U
1 0 1 1
0 1 L
P
0 2.9997
1 0 0.0003 1
26
2. Compute the column vector [P]{B}.
0 1 2.0001 1
1 0 1
2 .0001
3. Solve [L]{D}=[P]{B} for {D} using forward
substitution.
1 0 d1 1 1
0.0003 1 d 2.0001 D 1.9998
2
1 1 x1 1 0.33333
0 2.9997 x 1.9998 X 0.66667
2
27
THE END
28