X X X X X X: Example 3. Given The Equations
X X X X X X: Example 3. Given The Equations
2 x1 6 x2 x3 38
3x1 x2 7 x3 34
8 x1 x2 3x3 20
2 6 1 x1 38
3 1 7 x 34
2
8 1 3 x3 20
A
x b
2 6 1
a) D A 3 1 7 393 since D 0,so this system has a unique solution
8 1 3
b) 1. Gauss elimination without partial pivoting
2 6 1 38 ...(a)
3 1 7 34 ...(b)
8 1 3 20 ...(c)
Forward elimination:
Pivot element = 2 and pivot equation is equation (a).
2 6 1 38 ...(a)
(b) a 0 10 5.5 91 ...(b' )
3
2
c a 0 23 7 172 ...(c' )
8
2
Pivot element = -10 and pivot equation is equation (b).
2 6 1 38 ...(a)
0 10 5.5 91 ...(b)
c 1023 b 0 0 19.65 37.3 ...(c)
Back substitution:
37.3
x3 1.89822
19.65
91 5.5(1.89822)
x2 8.05598 Ans.
10
38 6 1.70750 1 1.89822
x1 4.21883
2
By S. TACHASOMBOONSUK
ii
2 6 1 38 ...(a)
3 1 7 34 ...(b)
8 1 3 20 ...(c)
Forward elimination:
Interchange between equation (a) and (c) to raise the maximum absolute
value of pivot element. Pivot element = -8 and pivot equation is equation
(a).
8 1 3 20 ...(a)
3 1 7 34 ...(b)
2 6 1 38 ...(c)
8 1 3 20 ...(a)
8
(b) 3 a 0 1.375 8.125 26.5 ...(b' )
c 2 a 0 5.75 1.75 43
...(c' )
8
Interchange between equation (b) and (c)
8 1 3 20 ...(a)
0 5.75 1.75 43 ...(b' )
0 1.375 8.125 26.5 ...(c' )
Pivot element = -5.75 and pivot equation is equation (b).
8 1 3 20 ...(a)
0 5.75 1.75 43 ...(b)
c 15.375
.75 b 0
0 8.54348 16.21739 ...(c)
Back substitution:
16.21739
x3 1.89822
8.54348
43 1.75(1.89822)
x2 8.05598 Ans.
5.75
20 18.05598 3 1.89822
x1 4.21883
8
c) 1. LU decomposition without partial pivoting
Decomposition:
A
2 6 1 ...(a)
3 1 7 ...(b)
8 1 3 ...(c)
By S. TACHASOMBOONSUK
iii
2 6 1 ...(a)
f 21 3
2
(b) a 0 10 5.5 ...(b' )
3
2
f 31 8
2
c a 0 23 7 ...(c' )
8
2
2 6 1 ...(a)
0 10 5.5 ...(b' )
f 32 23
10
c 1023 b 0 0
19.65 ...(c' )
U
Therefore
1 0 0 1 0 0 2 6 1 38
L f 21 1 0 23 1 0
, U 0 10
5.5 and b 34
f 31 f32 1 28 23
1 0 0 19.65 20
10
Forward substitution: Ld b
1 0 0 d1 38
3
2 1 0 d 2 34
28 23
10
1 d3 20
d1 38
d 2 34 23 38 91
d3 20 28 38 10
23
91 37.3
Back substitution: U x d
2 6 1 x1 38
0 10 x 91
5.5 2
0 0 19.65 x3 37.3
37.3
x3 1.89822
19.65
91 5.5(1.89822)
x2 8.05598 Ans.
10
38 6 1.70750 1 1.89822
x1 4.21883
2
2. LU decomposition with partial pivoting
Decomposition:
A
2 6 1 ...(a)
3 1 7 ...(b)
8 1 3 ...(c)
By S. TACHASOMBOONSUK
iv
interchang e (a ) (c)
8 1 3 ...(a)
3 1 7 ...(b)
2 6 1 ...(c)
8 1 3 ...(a)
f 21 3
8
(b) 8 a 0 1.375 8.125
3 ...(b)
f 31 2
8
c 28 a 0 5.75 1.75 ...(c)
8 1 3 ...(a)
0 5.75 1.75 ...(b)
f 32 1.375
5.75 c 15.375
.75 b
0 0 8.54348 ...(c)
Therefore
1 0 0 1 0 0 8 1 3
Lpivoting f 21 1 0 28 1 0 and U pivoting 0 5.75 1.75
f 31 f32 1 83 1.375
5.75
1 0 0 8.54348
38 20 20
b 34 interchange (a)and (c) b 34 interchange (b)and (c) bpivoting 38
20 38 34
Forward substitution: Ld b
1 0 0 d1 20
2
8 1 0 d 2 38
83 1.375
5.75
1 d3 34
d1 20
d 2 38 28 20 43
d3 34 83 20 15.375
.75
43 16.21739
Back substitution: U x d
8 1 3 x1 20
0 5.75 1.75 x 43
2
0 0 8.54348 x3 16.21739
By S. TACHASOMBOONSUK
v
16.21739
x3 1.89822
8.54348
43 1.75(1.89822)
x2 8.05598 Ans.
5.75
20 18.05598 3 1.89822
x1 4.21883
8
Exercise
2)
6 x1 2.2 x2 3x3 20
3x1 x2 1.1x3 8.1
x1 3x2 0.9 x3 6
3)
4 x 12 y 8 z 4w 4
1x 7 y 18 z 9w 5
2 x 9 y 20 z 20w 25
3x 11y 15 z 14w 18
By S. TACHASOMBOONSUK