LU Decomposition - MATH FOR COLLEGE

Download Report

Transcript LU Decomposition - MATH FOR COLLEGE

LU Decomposition
Electrical Engineering Majors
Authors: Autar Kaw
http://numericalmethods.eng.usf.edu
Transforming Numerical Methods Education for STEM
Undergraduates
7/17/2015
http://numericalmethods.eng.usf.edu
1
LU Decomposition
http://numericalmethods.eng.usf.edu
LU Decomposition
LU Decomposition is another method to solve a set of
simultaneous linear equations
Which is better, Gauss Elimination or LU Decomposition?
To answer this, a closer look at LU decomposition is
needed.
http://numericalmethods.eng.usf.edu
LU Decomposition
Method
For most non-singular matrix [A] that one could conduct 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
http://numericalmethods.eng.usf.edu
How does LU Decomposition work?
If solving a set of linear equations
If [A] = [L][U] then
Multiply by
Which gives
Remember [L]-1[L] = [I] which leads to
Now, if [I][U] = [U] then
Now, let
Which ends with
and
[A][X] = [C]
[L][U][X] = [C]
[L]-1
[L]-1[L][U][X] = [L]-1[C]
[I][U][X] = [L]-1[C]
[U][X] = [L]-1[C]
[L]-1[C]=[Z]
[L][Z] = [C] (1)
[U][X] = [Z] (2)
http://numericalmethods.eng.usf.edu
LU Decomposition
How can this be used?
Given [A][X] = [C]
1. Decompose [A] into [L] and [U]
2. Solve [L][Z] = [C] for [Z]
3. Solve [U][X] = [Z] for [X]
http://numericalmethods.eng.usf.edu
When is LU Decomposition better
than Gaussian Elimination?
To solve [A][X] = [B]
Table. Time taken by methods
Gaussian Elimination
 8n 3
4n 
T 
 12 n 2  
3 
 3
LU Decomposition
 8n 3
4n 
T 
 12 n 2  
3 
 3
where T = clock cycle time and n = size of the matrix
So both methods are equally efficient.
http://numericalmethods.eng.usf.edu
To find inverse of [A]
Time taken by Gaussian Elimination
Time taken by LU Decomposition
 nCT |FE CT |BS 
 CT |LU  n  CT |FS  n  CT |BS
 8n 4
4n 2 
3

 T 
 12n 
3
3


 32n 3
20n 

 T 
 12n 2 
3 
 3
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
http://numericalmethods.eng.usf.edu
Method: [A] Decompose to [L] and [U]
1
A  LU    21
 31
0
1
 32
0 u11
0  0
1  0
u12
u 22
0
u13 
u 23 
u 33 
[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
http://numericalmethods.eng.usf.edu
Finding the [U] matrix
Using the Forward Elimination Procedure of Gauss Elimination
 25 5 1
 64 8 1


144 12 1
Step 1:
5
1 
 25
64
 2.56; Row2  Row12.56   0  4.8  1.56
25
144 12
1 
5
1 
25
144
 5.76; Row3  Row15.76   0  4.8  1.56
25
 0  16.8  4.76
http://numericalmethods.eng.usf.edu
Finding the [U] Matrix
5
1 
25
Matrix after Step 1:  0  4.8  1.56


 0  16.8  4.76
1 
25 5
 16.8
 3.5; Row3  Row23.5   0  4.8  1.56
Step 2:
 4.8
 0
0
0.7 
1 
25 5
U    0  4.8  1.56
 0
0
0.7 
http://numericalmethods.eng.usf.edu
Finding the [L] matrix
1

 21
 31
0
1
 32
0
0
1
Using the multipliers used during the Forward Elimination Procedure
a
64
 21  21 
 2.56
5 1
From the first step  25
a11 25
of forward
elimination
 64 8 1


144 12 1
 31 
a31 144

 5.76
a11
25
http://numericalmethods.eng.usf.edu
Finding the [L] Matrix
From the second
step of forward
elimination
5
1 
25
 0  4.8  1.56


 0  16.8  4.76
 32 
a32  16.8

 3.5
a22
 4.8
0 0
 1
L  2.56 1 0
5.76 3.5 1
http://numericalmethods.eng.usf.edu
Does [L][U] = [A]?
0 0 25 5
1 
 1
LU   2.56 1 0  0  4.8  1.56 
5.76 3.5 1  0
0
0.7 
?
http://numericalmethods.eng.usf.edu
Example: Unbalanced three phase load
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.4516 0.7460

0.0100  0.0080

0.0080 0.0100
0.0100  0.0080

0.0080 0.0100
0.0100  0.0080 0.0100  0.0080  I ar   120 
0.0080 0.0100 0.0080 0.0100   I ai   0.000 
0.7787  0.5205 0.0100  0.0080  I br   60.00
  

0.5205 0.7787 0.0080 0.0100   I bi    103.9 
0.0100  0.0080 0.8080  0.6040  I cr   60.00
  

0.0080 0.0100 0.6040 0.8080   I ci   103.9 
Find the values of Iar , Iai , Ibr , Ibi , Icr , and Ici using LU Decomposition.
Example: Unbalanced three phase load
Use Forward Elimination to obtain the [U] matrix.
0.7460  0.4516
0.4516 0.7460

0.0100  0.0080

0.0080 0.0100
0.0100  0.0080

0.0080 0.0100
0.0100  0.0080 0.0100  0.0080
0.0080 0.0100 0.0080 0.0100 
0.7787  0.5205 0.0100  0.0080

0.5205 0.7787 0.0080 0.0100 
0.0100  0.0080 0.8080  0.6040

0.0080 0.0100 0.6040 0.8080 
Example: Unbalanced three phase load
Step 1
for Row 2:
0.7460  0.4516
0.4516 0.7460

0.0100  0.0080

0.0080 0.0100
0.0100  0.0080

0.0080 0.0100
0.0100  0.0080 0.0100  0.0080
0.0080 0.0100 0.0080 0.0100 
0.7787  0.5205 0.0100  0.0080

0.5205 0.7787 0.0080 0.0100 
0.0100  0.0080 0.8080  0.6040

0.0080 0.0100 0.6040 0.8080 
0.4516
 0.60536 ;
0.7460
Row2  Row10.60536  0 1.0194 0.00194640.014843 0.00194640.014843
for Row 3:
0.0100
 0.013405 ;
0.7460
Row3  Row10.13405  0  0.00194640.77857  0.52061 0.0098660 0.007893
Example: Unbalanced three phase load
0.7460  0.4516
0.4516 0.7460

0.0100  0.0080

0.0080 0.0100
0.0100  0.0080

0.0080 0.0100
for Row 4:
0.0100  0.0080 0.0100  0.0080
0.0080 0.0100 0.0080 0.0100 
0.7787  0.5205 0.0100  0.0080

0.5205 0.7787 0.0080 0.0100 
0.0100  0.0080 0.8080  0.6040

0.0080 0.0100 0.6040 0.8080 
0.0080
 0.010724 ;
0.7460
Row4  Row10.010724  0 0.014843 0.52039 0.77879 0.00789280.010086
for Row 5: 0.0100
 0.013405 ;
0.7460
Row5  Row10.013405  0  0.00194640.0098660 0.00789280.80787  0.60389
Example: Unbalanced three phase load
0.7460  0.4516
0.4516 0.7460

0.0100  0.0080

0.0080 0.0100
0.0100  0.0080

0.0080 0.0100
for Row 6:
0.0100  0.0080 0.0100  0.0080
0.0080 0.0100 0.0080 0.0100 
0.7787  0.5205 0.0100  0.0080

0.5205 0.7787 0.0080 0.0100 
0.0100  0.0080 0.8080  0.6040

0.0080 0.0100 0.6040 0.8080 
0.0080
 0.010724 ;
0.7460
Row6  Row10.010724  0 0.014843 0.00789280.010086 0.60389 0.80809
Example: Unbalanced three phase load
The system of equations after the completion of the first step of
forward elimination is:
0.0100
 0.0080
0.0100
 0.0080 
0.7460  0.4516
 0

1
.
0194
0
.
0019464
0
.
014843
0
.
0019464
0
.
014843


 0
 0.0019464 0.77857  0.52039 0.0098660  0.0078928


0
0
.
014843
0
.
52039
0
.
77879
0
.
0078928
0
.
010086


 0
 0.0019464 0.0098660  0.0078928 0.80787  0.60389 


0
0
.
014843
0
.
0078928
0
.
010086
0
.
60389
0
.
80809


Example: Unbalanced three phase load
Step 2
for Row 3:
0.0100
 0.0080
0.0100
 0.0080 
0.7460  0.4516
 0

1
.
0194
0
.
0019464
0
.
014843
0
.
0019464
0
.
014843


 0
 0.0019464 0.77857  0.52039 0.0098660  0.0078928


0.014843 0.52039
0.77879 0.0078928 0.010086 
 0
 0
 0.0019464 0.0098660  0.0078928 0.80787  0.60389 


0.014843 0.0078928 0.010086 0.60389
0.80809 
 0
 0.0019464
 0.0019094 ;
1.0194
Row3  Row2 0.0019094  0 0 0.77857  0.52036 0.0098697 0.0078644
for Row 4:
0.014843
 0.014561;
1.0194
Row4  Row20.014561  0 0 0.52036 0.77857 0.00786440.0098697
Example: Unbalanced three phase load
0.0100
 0.0080
0.0100
 0.0080 
0.7460  0.4516
 0

1
.
0194
0
.
0019464
0
.
014843
0
.
0019464
0
.
014843


 0
 0.0019464 0.77857  0.52039 0.0098660  0.0078928


0.014843 0.52039
0.77879 0.0078928 0.010086 
 0
 0
 0.0019464 0.0098660  0.0078928 0.80787  0.60389 


0.014843 0.0078928 0.010086 0.60389
0.80809 
 0
for Row 5:  0.0019464 ;0.0019094 ;
1.0194
Row5  Row2 0.0019094  0 0 0.0098697 0.00786440.80787  0.60386
for Row 6: 0.014843  0.014561;
1.0194
Row6  Row20.014561  0 0 0.00786440.00986970.60386 0.80787
Example: Unbalanced three phase load
The system of equations after the completion of the second step of
forward elimination is:
 0.0080
0.0100
 0.0080 
0.7460  0.4516 0.0100
 0

1
.
0194
0
.
0019464
0
.
014843
0
.
0019464
0
.
014843


 0
0
0.77857  0.52036 0.0098697  0.0078644


0
0
0
.
52036
0
.
77857
0
.
0078644
0
.
0098697


 0
0
0.0098697  0.0078644 0.80787  0.60386 


0
0.0078644 0.0098697 0.60386
0.80787 
 0
Example: Unbalanced three phase load
Step 3
for Row 4:
 0.0080
0.0100
 0.0080 
0.7460  0.4516 0.0100
 0
1.0194 0.0019464 0.014843 0.0019464 0.014843 

 0
0
0.77857  0.52036 0.0098697  0.0078644


0
0
0
.
52036
0
.
77857
0
.
0078644
0
.
0098697


 0
0
0.0098697  0.0078644 0.80787  0.60386 


0
0.0078644 0.0098697 0.60386
0.80787 
 0
0.52036
 0.66836 ;
0.77857
Row4  Row30.66836  0 0 0 1.1264 0.00126790.015126
for Row 5:
0.0098697
 0.012677 ;
0.77857
Row5  Row30.012677  0 0 0  0.00126790.807745  0.60376
Example: Unbalanced three phase load
 0.0080
0.0100
 0.0080 
0.7460  0.4516 0.0100
 0
1.0194 0.0019464 0.014843 0.0019464 0.014843 

 0
0
0.77857  0.52036 0.0098697  0.0078644


0
0
0
.
52036
0
.
77857
0
.
0078644
0
.
0098697


 0
0
0.0098697  0.0078644 0.80787  0.60386 


0
0.0078644 0.0098697 0.60386
0.80787 
 0
for Row 6:
0.0078644
 0.01010 ;
0.77857
Row6  Row30.01010  0 0 0 0.015126 0.60376 0.80795
Example: Unbalanced three phase load
The system of equations after the completion of the third step of
forward elimination is:
 0.0080
0.0100
 0.0080 
0.7460  0.4516 0.0100
 0

1
.
0194
0
.
0019464
0
.
014843
0
.
0019464
0
.
014843


 0
0
0.77857  0.52036 0.0098697  0.0078644


0
0
0
1
.
1264
0
.
0012679
0
.
015126


 0
0
0
 0.0012679 0.807745  0.60376 


0
0
0.015126 0.60376
0.80795 
 0
Example: Unbalanced three phase load
Step 4
for Row 5:
 0.0080
0.0100
 0.0080 
0.7460  0.4516 0.0100
 0
1.0194 0.0019464 0.014843 0.0019464 0.014843 

 0
0
0.77857  0.52036 0.0098697  0.0078644


0
0
0
1
.
1264
0
.
0012679
0
.
015126


 0
0
0
 0.0012679 0.807745  0.60376 


0
0
0.015126 0.60376
0.80795 
 0
 0.0012679
 0.0011257 ;
1.1264
Row5  Row4 0.0011257  0 0 0 0 0.80775  0.60375
for Row 6:
0.015126
 0.013429 ;
1.1264
Row6  Row40.013429  0 0 0 0 0.60375 0.80775
Example: Unbalanced three phase load
The system of equations after the completion of the fourth step of
forward elimination is:
 0.0080 
0.7460  0.4516 0.0100  0.0080 0.0100
 0

1
.
0194
0
.
0019464
0
.
014843
0
.
0019464
0
.
014843


 0
0
0.77857  0.52036 0.0098697  0.0078644


0
0
0
1
.
1264
0
.
0012679
0
.
015126


 0
0
0
0
0.80775  0.60375 


0
0
0
0.60375
0.80775 
 0
Example: Unbalanced three phase load
 0.0080 
0.7460  0.4516 0.0100  0.0080 0.0100
 0

1
.
0194
0
.
0019464
0
.
014843
0
.
0019464
0
.
014843


 0
0
0.77857  0.52036 0.0098697  0.0078644


0
0
0
1
.
1264
0
.
0012679
0
.
015126


 0
0
0
0
0.80775  0.60375 


0
0
0
0.60375
0.80775 
 0
Step 5
for Row 6:
0.60375
 0.74745 ;
0.80775
Row6  Row50.74745  0 0 0 0 0 1.2590
Example: Unbalanced three phase load
The coefficient matrix at the end of the forward elimination process is
the [U] matrix
 0.0080 
0.7460  0.4516 0.0100  0.0080 0.0100
 0

1
.
0194
0
.
0019464
0
.
014843
0
.
0019464
0
.
014843


 0
0
0.77857  0.52036 0.0098697  0.0078644


0
0
0
1
.
1264
0
.
0012679
0
.
015126


 0
0
0
0
0.80775  0.60375 


0
0
0
0
0
1
.
2590


Example: Unbalanced three phase load
For a system of six equations, the [L] matrix is in the form
1

 21
 31
L  
 41
 51

 61
0
0
0
0
1
0
0
0
 32
 42
1
 43
0
1
0
0
 52
 53
 54
1
 62
 63
 64
 65
0
0
0

0
0

1
Values of the [L] matrix are the multipliers used during the Forward
Elimination Procedure
Example: Unbalanced three phase load
From the first step of forward elimination
0.7460  0.4516
0.4516 0.7460

0.0100  0.0080

0.0080 0.0100
0.0100  0.0080

0.0080 0.0100
0.0100  0.0080 0.0100  0.0080
0.0080 0.0100 0.0080 0.0100 
0.7787  0.5205 0.0100  0.0080

0.5205 0.7787 0.0080 0.0100 
0.0100  0.0080 0.8080  0.6040

0.0080 0.0100 0.6040 0.8080 
 21 
0.4516
 0.60536
0.7460
 31 
0.0100
 0.013405
0.7460
 41 
0.0080
 0.010724
0.7460
 51 
0.0100
 0.013405
0.7460
 61 
0.0080
 0.010724
0.7460
Example: Unbalanced three phase load
From the second step of forward elimination
0.0100
 0.0080
0.0100
 0.0080 
0.7460  0.4516
 0

1
.
0194
0
.
0019464
0
.
014843
0
.
0019464
0
.
014843


 0
 0.0019464 0.77857  0.52039 0.0098660  0.0078928


0
0
.
014843
0
.
52039
0
.
77879
0
.
0078928
0
.
010086


 0
 0.0019464 0.0098660  0.0078928 0.80787  0.60389 


0.014843 0.0078928 0.010086 0.60389
0.80809 
 0
 32 
 0.0019464
 0.0019094
1.0194
 42 
0.014843
 0.014561
1.0194
 52 
 0.0019464
 0.0019094
1.0194
 62 
0.014843
 0.014561
1.0194
Example: Unbalanced three phase load
From the third step of forward elimination
 0.0080
0.0100
 0.0080 
0.7460  0.4516 0.0100
 0

1
.
0194
0
.
0019464
0
.
014843
0
.
0019464
0
.
014843


 0
0
0.77857  0.52036 0.0098697  0.0078644


0
0.52036
0.77857 0.0078644 0.0098697
 0
 0
0
0.0098697  0.0078644 0.80787  0.60386 


0
0.0078644 0.0098697 0.60386
0.80787 
 0
 43 
0.52036
 0.66836
0.77857
 53 
0.0098697
 0.012677
0.77857
 63 
0.0078644
 0.01010
0.77857
Example: Unbalanced three phase load
From the fourth step of forward elimination
 0.0080
0.0100
 0.0080 
0.7460  0.4516 0.0100
 0.0012679


 0.0011257
 0

54
1
.
0194
0
.
0019464
0
.
014843
0
.
0019464
0
.
014843
1
.
1264


 0
0
0.77857  0.52036 0.0098697  0.0078644


0
0
1.1264 0.0012679 0.015126 
 0
0.015126
 0
0
0
 0.0012679 0.80774  0.60376 
 64 
 0.013429


1.1264
0
0
0.015126 0.60376
0.80795 
 0
Example: Unbalanced three phase load
From the fifth step of forward elimination
0.7460  0.4516 0.0100  0.0080
 0
1.0194 0.0019464 0.014843

 0
0
0.77857  0.52036

0
0
1.1264
 0
 0
0
0
0

0
0
0
 0
0.0100
0.0019464
0.0098697
0.0012679
0.80775
0.60375
 0.0080 
0.014843 
 0.0078644

0.015126 
 0.60375 

0.80775 
 65 
0.60375
 0.74745
0.80775
Example: Unbalanced three phase load
The [L] matrix is
1

 0.60536

0.013405
L  
0.010724
0.013405

0.010724
0
1
0
0
0
0
 0.0019094
1
0
0
0

0.014561 0.66836
1
0
0
 0.0019094 0.012677  0.0011257
1
0

0.014561 0.01010 0.013429 0.74745 1
0
0
0
0
Example: Unbalanced three phase load
Does [L][U] = [A]?
1
0
0
0
0
0 0.7460  0.4516 0.0100  0.0080 0.0100
 0.0080 

 0.60536
1
0
0
0
0  0
1.0194 0.0019464 0.014843 0.0019464 0.014843 

0.013405  0.0019094
1
0
0
0  0
0
0.77857  0.52036 0.0098697  0.0078644


?
0
.
010724
0
.
014561
0
.
66836
1
0
0
0
0
0
1
.
1264
0
.
0012679
0
.
015126



0.013405  0.0019094 0.012677  0.0011257 1
0  0
0
0
0
0.80775  0.60375 



0
0
0
0
1.2590 
0.010724 0.014561 0.01010 0.013429 0.74745 1  0
Example: Unbalanced three phase load
Set [L][Z] = [C]
1

 0.60536

0.013405

0.010724
0.013405

0.010724
0  Z1   120 
1
0
0
0
0  Z 2   0.000 
 0.0019094
1
0
0
0  Z3   60.00
   

0.014561 0.66836
1
0
0  Z 4    103.9 
 0.0019094 0.012677  0.0011257
1
0  Z5   60.00
  

0.014561 0.01010 0.013429 0.74745 1  Z6   103.9 
0
0
0
0
Example: Unbalanced three phase load
Solve for [Z]
The six equations become
z1  120
0.60536z1  z 2  0.00
0.013405z1   0.0019094z 2  z3  60.00
0.010724z1  0.014561z 2  0.66836z3  z 4  103.9
0.013405z1   0.0019094z 2  0.012677z3   0.0011257z 4  z5  60.00
0.010724z1  0.014561z 2  0.01010z3  0.013429z 4  074745z5  z6  103.9
Example: Unbalanced three phase load
Solve for [Z]
z1  120
z 2  0.00  0.60536z1
 72.643
z3  60.00  0.013405z1   0.0019094z 2
 61.747
z 4  103.9  0.010724z1  0.014561z2  0.66836z3
 62.860
z5  60.00  0.013405z1   0.0019094z 2  0.012677z3   0.0011257z 4
 61.035
z6  103.9  0.010724z1  0.014561z2  0.01010z3  0.013429z 4  074745z5
 150.76
Example: Unbalanced three phase load
The [Z] matrix is
 z1   120 
 z   72.643
 2 

 z3    61.747
Z      

 z 4   62.860
 z5    61.035
  

 z6   150.76 
Example: Unbalanced three phase load
Set [U] [I] = [Z]
0.7460  0.4516 0.0100  0.0080
 0
1.0194 0.0019464 0.014843

 0
0
0.77857  0.52036

0
0
1.1264
 0
 0
0
0
0

0
0
0
 0
0.0100
0.0019464
0.0098697
0.0012679
0.80775
0
 0.0080 
0.014843 
 0.0078644

0.015126 
 0.60375 

1.2590 
 I ar 
I 
 ai 
 I br 
 
 I bi 
 I cr 
 
 I ci 
 120 
 72.643


  61.747



62
.
860


  61.035


150
.
76


Example: Unbalanced three phase load
Solve for [I]
The six equations become
0.7460I ar   0.4516I ai  0.0100I br   0.0080I bi  0.0100I cr   0.0080I ci  120
1.0194I ai  0.0019464I br  0.014843I bi  0.0019464I cr  0.014843I ci  72.643
0.77857I br   0.52036I bi  0.0098697I cr   0.0078644I ci  61.747
1.1264I bi  0.0012679I cr  0.015126I ci  62.860
0.80775I cr   0.603748I ci  61.035
1.2590I ci  150.76
Example: Unbalanced three phase load
Solve for [I]
Remember to start with the last equation
150 .76
 119 .74
1.2590
I ci 
I cr 
 61.035   0.60375 I ci
 13.940
0.80775
I bi 
 62.860  0.0012679 I cr  0.015126 I ci
 57 .432
1.1264
I br 
 61.747   0.52036 I bi  0.0098697 I cr   0.0078644 I ci
 116 .66
0.77857
Example: Unbalanced three phase load
I ai 
 72.643  0.0019464 I br  0.014843 I bi  0.0019464 I cr  0.014843 I ci
 71.973
1.0194
I ar 
120   0.4516 I ai  0.0100 I br   0.0080 I bi  0.0100 I cr   0.0080 I ci
 119 .33
0.7460
Solution:
 I ar   119.3331 
 I    71.97344
 ai  

 I br    116.6607
 

I

57
.
43159
 bi  

 I cr   13.93977 
  

I
119
.
7439
 ci  

Finding the inverse of a square matrix
The inverse [B] of a square matrix [A] is defined as
[A][B] = [I] = [B][A]
http://numericalmethods.eng.usf.edu
Finding the inverse of a square matrix
How can LU Decomposition be used to find the inverse?
Assume the first column of [B] to be [b11 b12 … bn1]T
Using this and the definition of matrix multiplication
First column of [B]
b11  1
b  0
A  21    
    
   
bn1  0
Second column of [B]
 b12  0
 b  1
A  22    
    
   
bn 2  0
The remaining columns in [B] can be found in the same manner
http://numericalmethods.eng.usf.edu
Example: Inverse of a Matrix
Find the inverse of a square matrix [A]
 25 5 1
A   64 8 1
144 12 1
Using the decomposition procedure, the [L] and [U] matrices are found to be
1 
 1 0 0 25 5
A  LU   2.56 1 0  0  4.8  1.56
5.76 3.5 1  0
0
0.7 
http://numericalmethods.eng.usf.edu
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]
Step 1:
0 0  z1  1
 1
LZ   C   2.56 1 0  z2   0
5.76 3.5 1  z3  0
This generates the equations:
z1  1
2.56z1  z2  0
5.76z1  3.5z2  z3  0
http://numericalmethods.eng.usf.edu
Example: Inverse of a Matrix
Solving for [Z]
z1  1
z 2  0  2.56z1
 0  2.561
 2.56
z3  0  5.76z1  3.5 z 2
 z1   1 
Z    z2    2.56
 z3   3.2 
 0  5.761  3.5 2.56
 3.2
http://numericalmethods.eng.usf.edu
Example: Inverse of a Matrix
Solving [U][X] = [Z] for [X]
5
1  b11   1 
25
 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
0.7b31  3.2
http://numericalmethods.eng.usf.edu
Example: Inverse of a Matrix
Using Backward Substitution
3.2
 4.571
0.7
2.56  1.560b31
b21 
4.8
2.56  1.5604.571

 0.9524
4 . 8
1  5b21  b31
b11 
25
1  5 0.9524  4.571

 0.04762
25
b31 
So the first column of
the inverse of [A] is:
b11   0.04762
b    0.9524
 21  

b31   4.571 
http://numericalmethods.eng.usf.edu
Example: Inverse of a Matrix
Repeating for the second and third columns of the inverse
Second Column
 25 5 1 b12  0
 64 8 1 b   1

  22   
144 12 1 b32  0
b12   0.08333
b    1.417 
 22  

b32    5.000 
Third Column
 25 5 1  b13  0
 64 8 1 b   0

  23   
144 12 1 b33  1
b13   0.03571
b    0.4643
 23  

b33   1.429 
http://numericalmethods.eng.usf.edu
Example: Inverse of a Matrix
The inverse of [A] is
 0.04762  0.08333 0.03571
A1   0.9524 1.417  0.4643
 4.571
 5.000
1.429 
To check your work do the following operation
[A][A]-1 = [I] = [A]-1[A]
http://numericalmethods.eng.usf.edu
Additional Resources
For all resources on this topic such as digital audiovisual
lectures, primers, textbook chapters, multiple-choice
tests, worksheets in MATLAB, MATHEMATICA, MathCad
and MAPLE, blogs, related physical problems, please
visit
http://numericalmethods.eng.usf.edu/topics/lu_decomp
osition.html
THE END
http://numericalmethods.eng.usf.edu