Professional Documents
Culture Documents
Linear Algebraic
Equation Solvers
Cramer’s rule
LU Decomposition Gauss-Seidel
Naive Gauss
Matrix Inverse Newton Raphson
(Pivoting)
1
Linear Algebraic
Equation Solvers
Cramer’s rule
LU Decomposition Gauss-Seidel
Naive Gauss
Matrix Inverse Newton Raphson
(Pivoting)
LU Decomposition and
Matrix Inversion
We have countered with Naive-Gauss elimination
to solve the algebraic system. It involve forward
elimination and back-substitution.
Time-consuming of forward elimination in Naive-
Gauss elimination will be replaced by
decomposition technique in LU decomposition.
LU decomposition may also help to calculate the
matrix inverse.
2
LU- Factorization & Matrix inversion
LU Decomposition
Given the system of linear algebraic
equation in matrix form.
AX B
In LU decomposition, [A] will be
decomposed into upper triangle form, [U]
and lower triangle form , [L] to give the
values of {B}.
1 0 0 a11 a12 a13
L f 21 1 0 U 0 a22 a23
f 31 f 32 1 0 0 a33
3
2 phases on solving equation using LU
decomposition:
1) LU decomposition step
2) Substitution step
Steps for using the LU decomposition method:
1. Arrange the linear algebraic equations
given into matrix form:
AX B
2. Decomposed [A] into lower and upper
triangular matrices, [L] and [U].
L U X B
U { X } D
4
LU Factorization
[ A]{ x } {b} 0 Assume there is a
forawrd elimination lower diagonal matrix :
produce upper triangular system:
1 0 0
u11 u12 u13 x1 d1
[ L] l 21 1 0
0 u 22 u 23 x2 d 2 l 31 l32 1
0 0 u33 x3 d 3
[U ]{ x } {d } 0 Such that
[ L]{[U ]{ x } {d }} [ A]{ x } {b}
[ L][U ] [ A]
[ L]{d } {b}
5
How to decompose [A] into [L] and [U] ?
a31
1st
3. Multiply row by and use 3rd row to
a11
substrate the result to eliminate a31.
a31
f 31
a11
a32
4. Multiply modified 2nd
row by and use 3rd row
a22
to substrate the result to eliminate a’32.
a32
f 32
a22
6
5. After the elimination we will get the matrix [U]:
a11 a12 a13
U 0 a22 a23
0 0 a33
7
Example
Finding the [U] matrix
Using the Forward Elimination Procedure of Gauss Elimination
25 5 1
64 8 1
144 12 1
25 5 1
Row1
Row 2 (64) 0 4.8 1.56
25
144 12 1
25 5 1
Row1
Row 3 (144) 0 4.8 1.56
25
0 16.8 4.76
25 5 1
0 4.8 1.56
0 16.8 4.76
25 5 1
Row 2
Row 3 ( 16.8) 0 4.8 1.56
4.8
0 0 0.7
25 5 1
U 0 4.8 1.56
0 0 0.7
8
Finding the [L] matrix
Using the multipliers used during the Forward Elimination Procedure
a 21 64
1 0 0 21 2.56
From the first a11 25
step of forward 21 1 0
a 31 144
elimination 31 32 1 31 5.76
a11 25
1 0 0
L 2.56 1 0
5.76 3.5 1
Does LU A ?
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
9
LU factorization with Gauss Elimination: Example 10.1
3 0.1 0.2
A 0.1 7 0.3
0.3 0.2 10
3 0.1 0.2
After forward elimination we had U 0 7.00333 0.293333
0 0 10.0120
The factors employed to obtain the upper triangular matrix can be
assembled into lower triangular matrix.
Therefore:
1 0 0 3 0.1 0.2
[ A] [ L][U ] 0.033333 1 0 0 7.00333 0.293333
0.100000 0.0271300 1 0 0 10.0120
10
Substitution steps: Example 10.2
3 0.1 0.2 x1 7.85
0.1
7 0.3 x2 19.3
0.3 0.2 10 x3 71.4
decomposition
3 0.1 0.2
U 0 7.00333 0.293333
0 0 10.0120
1 0 0
0
L 0.033333 1
0.100000 0.0271300 1
11
Matrix Inverse
Matrix inverse [A]-1 can be calculated numerically
using LU decomposition.
Steps for using the LU decomposition method
for matrix inverse [A]-1:
1. Decompose [A] into lower and
upper triangular matrices, [L] and [U].
2. [L] is used to generate an intermediate
vector, {d} using:
L { d } b
(23)
1 0 0
b 1 0 b 2 1 b 3 0
0 0 1
(24)
12
Matrix Inverse
A A A A I
1 1
0
A1 a1i1 a2i1 a3i1
A a3i1 0
3rd column 1
of [A]-1
(25)
Example 10.3
3 0.1 0.2
A 0.1 7 0.3
0.3 0.2 10
3 0.1 0.2 1 0 0
U 0 7.00333 0.293333
L 0.033333 1 0
0 0 10.0120 0.100000 0.0271300 1
(26)
13
1 1 U {a1i1 } d 0.33249
L {d }1 0 {d }1 0.0333
1
1
{a1i } 0.00518
0 0.1009 0.1008
0 U {a3 i } d 3 0.006798
1
0
L {d }3 0 {d }3 0
{a3i1 } 0.004183
1 1.0000 0.099880
(27)
3 0.1 0.2
A 0.1 7 0.3
0.3 0.2 10
a
1
1i a 1
2i a
1
3i
A A I
1
(28)
14