Gaussian Elimination#
We are now ready to write out the algorithm for Gaussian elimination. The basic idea is to get the matrix \({\bf A}\) into row-echelon form. If the matrix is square, and non-singular (\(\mbox{det}\{\bf A\} \ne 0\)), then a row-echelon matrix is an upper-trangular matrix. The process of transforming the matrix this way is called forward-elimination. Then we solve for \({\bf x}\) by doing back substitution.
Forward Elimination#
Consider the following state of our matrix \({\bf A}\) mid-way through the row-echelon transformation:
At this point, the matrix is in row-echelon form down to row \(k\), but the next row, \(k+1\) is not, since there is a non-zero element below the diagonal (\(a_{k+1,k}\)).
Our next step in forward-elimination is to operate on all rows \(k+1, \ldots, N\) using row \(k\) to eliminate any non-zero entries in column \(k\).
The procedure is:
Define a coefficient
\[f_{k+1} = \frac{a_{k+1,k}}{a_{k,k}}\]subtract \(f_{k+1} \times \{ \mbox{row}~k \}\) from row \(k+1\)
correct the \(k+1\) row of the righthand size vector, \({\bf b}\) with the same factor
Repeat the procedure for all rows \(k+2, \ldots, N\)
Back Substitution#
At the end of forward elimination, our system looks like:
The last element is simply
The second-to-last element is then found by solving:
giving:
and so forth, with the general case looking like: