D.15 Linear Equations 621
where the coefficient matrix A is a given n × n nonsingular matrix so that the
system possesses a unique solution. The vector b is also given. The unknown vector
x is to be found. The system is said to be homogeneous when b is zero, otherwise
the system is said to be nonhomogeneous. Before we discuss methods for obtaining
the solution to the above equation, we define first some elementary row operations
[3], [2]:
1. Interchange of two rows.
2. Multiplication of a row by a nonzero constant.
3. Addition of a constant multiple of one row to another row.
Each of the above elementary row operations is implemented by multiplying
the matrix from the left by an appropriate matrix E called an elementary matrix.
The three elementary matrices corresponding to the above three elementary row
operations are illustrated below for 4 ×4 matrices [4]:
⎡
⎢
⎢
⎣
1000
0010
0100
0001
⎤
⎥
⎥
⎦
,
⎡
⎢
⎢
⎣
1000
0 a 00
0010
0001
⎤
⎥
⎥
⎦
,
⎡
⎢
⎢
⎣
1000
0100
a 010
0001
⎤
⎥
⎥
⎦
(D.36)
There are two classes of numerical methods for finding a solution. The direct
methods guarantee to find a solution in one step. This is the recommended approach
for general situations and for small values of n.Theiterative methods start with an
assumed solution then try to refine this assumption until the succeeding estimates
of the solution converge to within a certain error limit. This approach is useful for
large values of n and for sparse matrices where A has a large number of zeros.
The advantage of iterative solutions is that they practically eliminate arithmetic
roundoff errors and produce results with accuracy close to the machine precision
[5]. We discuss the two approaches in the following sections. We refer the reader
to Appendix E for a discussion of the techniques used by MATLAB to numerically
find the solution.
In the following section, we review the useful techniques for solving systems of
linear equations.
D.15.1 Gauss Elimination
Gauss elimination solves a system of linear equations by transforming A into upper
triangular form using elementary row operations. The solution is then found using
back-substitution. To create a zero at position (2,1), we need to multiply row 2 by
a
21
/a
11
, then subtract this row from row 1. This is equivalent to a row operation
matrix of the form