Page 98 - Applied Numerical Methods Using MATLAB
P. 98
SOLVING A SYSTEM OF LINEAR EQUATIONS 87
Without partial pivoting, the Gauss elimination procedure will give us a
quite good result.
14.6 14.6
110 = 3.981071705534969e+014 10 + 1 = 3.981071705534979e+014
[A 1 b 1 ] =
0 6.018928294465030e+014 6.018928294465030e+014
1 3.981071705534969e+014 3.981071705534979e+014
→
0 1 1
backward
1
substitution
−−−−−−−−→ x =
1
But, if we exchange the first row with the second row having the larger
element in the first column according to the strategy of partial pivoting, the
Gauss elimination procedure will give us a rather surprisingly bad result
as follows:
row 15 15
swapping 110 = 1.000000000000000e+015 10 + 1 = 1.000000000000001e+015
15
15
−−−−−−−→ 01 − 10 · 10 −14.6 1 + 10 −14.6 − (1 + 10 ) · 10 −14.6
forward
elimination =−1.5118864315095819 =−1.5118864315095821
backward
substitution 0.7500000000000000
−−−−−−−−→ x =
1.0000000000000002
One might be happy to have the scaled partial pivoting scheme
[Eq. (2.2.20)], which does not switch the rows in this case, since the
relative magnitude (dominancy) of a 11 in the first row is greater than that
15
of a 21 in the second row, that is, 10 −14.6 /1 > 1/10 .
15 15
10 1 10 + 1
(c) A 3 x = b 3 with A 3 = −14.6 , b 3 = −14.6 (E2.2.3)
1 10 1 + 10
With any pivoting scheme, we don’t need to switch the rows, since the
relative magnitude as well as the absolute magnitude of a 11 in the first row
is greater than those of a 21 in the second row. Thus, the Gauss elimination
procedure will go as follows:
forward
elimination 1 1.000000000000000e-015 1.000000000000001e+000
−−−−−−−→
0 1.511886431509582e-015 1.332267629550188e-015
backward
substitution 1.000000000000000
−−−−−−−−→ x =
0.811955724875121
(cf) Note that the coefficient matrix, A 3 is the same as would be obtained by applying
the full pivoting scheme for A 2 to have the largest pivot element. This example
implies that the Gauss elimination with full pivoting scheme may produce a worse
result than would be obtained with scaled partial pivoting scheme. As a matter of