Академический Документы
Профессиональный Документы
Культура Документы
Hyderabad Campus
Lecture -11:
SYSTEM of LINEAR ALGEBRAIC EQUATIONS
Direct Methods: LU Decomposition
LU Decomposition
Decompose A = L . U
0
* 0
CHE F242 Numerical Methods for Chemical Engineers, BITS, Pilani-Hyderabad Campus P-2
LU Decomposition
To solve [A]{x}={b}
[L][U]=[A] [L][U]{x}={b}
Consider [U]{x}={d}
[L]{d}={b}
CHE F242 Numerical Methods for Chemical Engineers, BITS, Pilani-Hyderabad Campus P-3
LU Decomposition
[L] [U]
CHE F242 Numerical Methods for Chemical Engineers, BITS, Pilani-Hyderabad Campus P-4
LU Decomposition
1 0 0
L l 21 1 0
[U]
l31 l32 1 Coefficients used during the elimination step
CHE F242 Numerical Methods for Chemical Engineers, BITS, Pilani-Hyderabad Campus P-5
LU Decomposition
a21
l21
a11
[ L.U ]
a31
l31
a11
l32 ?
CHE F242 Numerical Methods for Chemical Engineers, BITS, Pilani-Hyderabad Campus P-6
Example
1 2.5 5 1 0 0 1 2.5 5
2 9 11 2 1 0 0 4 1 .
A = L U
4 22 20 4 3 1 0 0 3
Gauss Elimination
Coefficients
1 2.5 5 1 2.5 5
l21 = -2/-1= 2 2 9 11 0 4 1
l31 = 4/-1= -4 4 22 20 0 12 0
1 2.5 5 1 2.5 5
0 4 1
0 4 1
[L] l32 = -12/4= -3 0 12 0 0 0 3
1 0 0 1 0 0
L 2 1 0 L 2 1 0 [U]
4 ?? 1 4 3 1
CHE F242 Numerical Methods for Chemical Engineers, BITS, Pilani-Hyderabad Campus P-7
Example:
Gauss Elimination with pivoting
1 2.5 5 4 22 20
2 9 11 pivoting 2 9 11 A = L U
4 22 20 1 2.5 5
Coefficients
4 22 20 4 22 20 4 22 20
l21 = -2/4= -.5 2 9 11 0 2 1 pivoting 0 3 0
l31 = -1/4= -.25 1 2.5 5 0 3 0 0 2 1
4 22 20 4 22 20
Coefficients 0 3 0 0 3 0
l32 = -2/-3 0 2 1 0 0 1
1 0 0 1 0 0 1 0
L 0 .5 1 0 0.25 1 0 0.25
0
1 0
[U]
0.25 ?? 1 0 .5 ?? 1 0 .5 0 .6 6 1
CHE F242 Numerical Methods for Chemical Engineers, BITS, Pilani-Hyderabad Campus P-8
• Gauss Elimination can be used to decompose [A] into [L] and [U].
Therefore, it requires the same total FLOPs as for Gauss elimination:
In the order of (proportional to) N3 where N is the # of unknowns.
• lij values (the factors generated during the elimination step) can be
stored in the lower part of the matrix to save storage. This can be
done because these are converted to zeros anyway and unnecessary
for the future operations.
CHE F242 Numerical Methods for Chemical Engineers, BITS, Pilani-Hyderabad Campus P-9