Page 117 - Applied Numerical Methods Using MATLAB
P. 117
106 SYSTEM OF LINEAR EQUATIONS
Table P2.2 Comparison of gauss() with Different Pivoting Methods in Terms of
||Ax i − b||
A 1 x = b 1 A 2 x = b 2 A 3 x = b 3 A 4 x = b 4
gauss(A,b,0) (no pivoting) 1.25e-01
gauss(A,b,1) (partial pivoting) 4.44e-16
gauss(A,b,2) (scaled partial pivoting) 0
A\b 6.25e-02
A^-1*b
14.6 14.6
10 1 10 + 1
(4) A 4 = −15 , b 4 = −15
1 10 1 + 10
(b) Which pivoting strategy yields the worst result for problem (1) in (a)?
Has the row swapping been done during the process of partial pivoting
and scaled partial pivoting? If yes, did it work to our advantage? Did
the ‘\’ operator or the ‘inv()’ command give you any better result?
(c) Which pivoting strategy yields the worst result for problem (2) in (a)?
Has the row swapping been done during the process of partial pivoting
and scaled partial pivoting? If yes, did it produce a positive effect for
this case? Did the ‘\’ operator or the ‘inv()’ command give you any
better result?
(d) Which pivoting strategy yields the best result for problem (3) in (a)? Has
the row swapping been done during the process of partial pivoting and
scaled partial pivoting? If yes, did it produce a positive effect for this
case?
(e) The coefficient matrix A 3 is the same as would be obtained by applying
the full pivoting scheme for A 1 to have the largest pivot element. Does
the full pivoting give better result than no pivoting or the (scaled) partial
pivoting?
(f) Which pivoting strategy yields the best result for problem (4) in (a)? Has
the row swapping been done during the process of partial pivoting and
scaled partial pivoting? If yes, did it produce a positive effect for this
case? Did the ‘\’operatororthe ‘inv()’ command give you any better
result?
2.3 Gauss–Jordan Elimination Algorithm Versus Gauss Elimination Algorithm
Gauss–Jordan elimination algorithm mentioned in Section 2.2.3 is trimming
the coefficient matrix A into an identity matrix and then takes the RHS
vector/matrix as the solution, while Gauss elimination algorithm introduced
with the corresponding routine “gauss()” in Section 2.2.1 makes the matrix
an upper-triangular one and performs backward substitution to get the solu-
tion. Since Gauss–Jordan elimination algorithm does not need backward
substitution, it seems to be simpler than Gauss elimination algorithm.