
Numerical Computation 21
This procedure completes the Gauss elimination. We can carry out the
elimination process by writing only the coefficients and the matrix vec-
tor in an array as
al,1 a~,2 a~,3 ... a~,N_ ~ al,N
Y~
a2,1 a2,2 a2,3 ... aZ,N-1 a2,m Y2
9 .
9 .
(1-67)
aN,1 aN,2 aN,3 "'" aN,N-1 aN,N YN
The array after the forward elimination becomes
al,1 al,2 al,3 ... al,N-1 al,N Y1
P P P a p p
0 a2,2 a2,3 "'" a2,N-1 2,N Y2
,, ,, ,, y ,,
0 0 a3,3 ... a3,N-I a3,N 3
0 0 0 ,.. (N-2) ,_. (N-2) (N-2)
9 " " dN-1,N-1 i::tN-I,N YN-I
0 0 0 0 ,, (N-I) y(N-l)
9 9 9 iZIN,N N
(1-68)
We can summarize the operations of Gauss elimination in a form suit-
able for a computer program as follows:
1. Augment the N • N coefficient matrix with the vector of right
hand sides to form a N x (N-l) matrix.
2. Interchange the rows if required such that a~ is the largest magni-
tude of any coefficient in the first column.
3. Create zeros in the second through
N th rows
in the first column by
subtracting ai~/a~ times the first row from the/ith row. Store the
ai~/a~ in ai~, i=2, 3,... N.
4. Repeat Steps 2 and 3 for the second through the (N-l) ~ rows,
putting the largest-magnitude coefficient on the diagonal by inter-
changing rows (considering only rows j to N). Then subtract aij/ajj
times the
jth rOW from the i th row to
create zeros in all the posi-
tions of the
jth
column below the diagonal. Store the aij/ajj in aij,
i=j+l . . . N. At the end of this step, the procedure is an upper
triangular.
5. Solve for X N from the
N th
equation by
a
XN _-- N,N+I
aN,N