LU Decomposition
LU Decomposition
Topic: LU Decomposition
The goal of LU decomposition is to write a square matrix A as the product of matrix L and matrix U.
Formula: A=L.U
1 0 0
L= * 1 0
* * 1
* * *
U= 0 * *
0 0 *
Example:
x1 + x2-x3=4
x1 -2x2+3x3=-6
2x1 + 3x2+x3=7
Solution:
1 1 -1 x1 4
1 -2 3 x2 = -6
2 3 1 x3 7
A X = B
1 1 -1
1 -2 3
2 3 1
R2-> -1R1+R2 (take the opposite value of -1 and place it in R21 in L matrix)
1 1 -1
0 -3 4
2 3 1
R3->-2R1+R3
1 1 -1
0 -3 4
0 1 3
R3->1/3R2+R3
L= 1 0 0
1 1 -1
1 1 0
0 -3 4 =U 2 -1/3 1
0 0 13/3
Solve LY=B for Y
1 0 0 y1 4
1 1 0 y2 = -6
2 -1/3 1 y3 7
L Y = B
Y1=4
Y1+y2=-6
2Y1-1/3y2+y3=7
Y1+y2=-6
4+y2=-6
Y2=-10
2Y1-1/3y2+y3=7
2(4)-1/3(-10)+y3=7
8+10/3 +y3=7
y3=-13/3
1 1 -1 x1 4
0 -3 4 x2 = -10
0 0 13/3 x3 -13/3
U X = Y
x1+x2-x3=4
-3x2+4x3=-10
13/3x3=-13/3
-3x2+4x3=-10
-3x2+4(-1)=-10
X2=2
x1+x2-x3=4
x1+2-(-1)=4
x1=1