Page 83 - Applied Numerical Methods Using MATLAB
P. 83
72 SYSTEM OF LINEAR EQUATIONS
(ii) The case where the number (M) of equations is smaller than the number
(N) of unknowns (M< N) so that we might have to find the minimum-
norm solution among the numerous solutions.
(iii) The case where the number of equations is greater than the number of
unknowns (M> N) so that there might exist no exact solution and we
must find a solution based on global error minimization, like the “LSE
(Least-squares error) solution.”
2.1 SOLUTION FOR A SYSTEM OF LINEAR EQUATIONS
2.1.1 The Nonsingular Case (M = N)
If the number (M) of equations and the number (N) of unknowns are equal
(M = N), then the coefficient matrix A is square so that the solution can be
written as
x = A −1 b (2.1.1)
so long as the matrix A is not singular. There are MATLAB commands for
this job.
>>A = [1 2;3 4]; b = [-1;-1];
>>x = A^-1*b %or, x = inv(A)*b
x = 1.0000
-1.0000
What if A is square, but singular?
>>A = [1 2;2 4]; b = [-1;-1];
>>x = A^-1*b
Warning: Matrix is singular to working precision.
x = -Inf
-Inf
This is the case where some or all of the rows of the coefficient matrix A are
dependent on other rows and so the rank of A is deficient, which implies that
there are some equations equivalent to or inconsistent with other equations. If
we remove the dependent rows until all the (remaining) rows are independent of
each other so that A has full rank (equal to M), it leads to the case of M< N,
which will be dealt with in the next section.
2.1.2 The Underdetermined Case (M < N): Minimum-Norm Solution
If the number (M) of equations is less than the number (N) of unknowns, the
solution is not unique, but numerous. Suppose the M rows of the coefficient
matrix A are independent. Then, any N-dimensional vector can be decomposed
into two components
+
x = x + x − (2.1.2)