Page 71 - Applied Numerical Methods Using MATLAB
P. 71
60 MATLAB USAGE AND COMPUTATIONAL ERRORS
(b) Use the backslash (\) command, the LS (least-squares) solution (2.1.10)
and the pinv() command to solve the following equations and find the
residual error ||A i x − b i ||’s and the rank of the coefficient matrix A i ,
and fill in Table P1.14 with the results.
12
2
x 1
6
(i) A 4 x = 23 = = b 4 (P1.14.4)
x 2
34 7
12
1
5
(ii) A 5 x = 24 x 1 = = b 5 (P1.14.5)
x 2
36 8
12
3
x 1
(iii) A 6 x = 24 = 6 = b 6 (P1.14.6)
x 2
36 9
(cf) If some or all of the rows of the coefficient matrix A in a set of linear equations
can be expressed as a linear combination of other row(s), the corresponding
equations are dependent, which can be revealed by the rank deficiency, that is,
rank(A) < min(M, N) where M and N are the row dimension and the column
dimension, respectively. If some equations are dependent, they may have either
inconsistency (no exact solution) or redundancy (infinitely many solutions),
which can be distinguished by checking if augmenting the RHS vector b to the
coefficient matrix A increases the rank or not—that is, rank([A b]) > rank(A)
or not [M-2].
(c) Based on the results obtained in (a) and (b) and listed in Table P1.14,
answer the following questions.
(i) Based on the results obtained in (a)(i), which one yielded the
non-minimum-norm solution among the three methods, that is,
the backslash(\) operator, the minimum-norm solution (2.1.7) and
the pinv() command? Note that the minimum-norm solution
means the solution whose norm (||x||) is the minimum over the
many solutions.
(ii) Based on the results obtained in (a), which one is most reliable
as a means of finding the minimum-norm solution among the
three methods?
(iii) Based on the results obtained in (b), choose two reliable methods
as a means of finding the LS (least-squares) solution among the
three methods, that is, the backslash (\) operator, the LS solu-
tion (2.1.10) and the pinv() command. Note that the LS solution