Gaussian elimination
From CFDWiki
(reverted  capitals are for matrices, not vectors. I suggest a forum discussion) 
m (→Important Considerations) 

Line 118:  Line 118:  
== Important Considerations ==  == Important Considerations ==  
  Gaussian elimination is best used for relatively small, relatively full systems of equations. If properly used, it should outperform most iterative methods for these systems. As the system to be solved becomes larger, the overhead associated with the more complicated iterative methods becomes less of an issue, and the iterative methods should outperform Gaussian Elimination. For sparse  +  Gaussian elimination is best used for relatively small, relatively full systems of equations. If properly used, it should outperform most iterative methods for these systems. As the system to be solved becomes larger, the overhead associated with the more complicated iterative methods becomes less of an issue, and the iterative methods should outperform Gaussian Elimination. For sparse systems, the use of Gaussian elimination is complicated by the possible introduction of more nonzero entries (fillin). In any case, it is important to keep in mind that the basic algorithm is vulnerable to accuracy issues, including (but not limited to) the distinct possibility of division by zero at various places in the solution process. In practice, it is best to employ safeguards against such problems (e.g. pivoting). 
Revision as of 00:32, 17 December 2005
Description
We consider the system of linear equations or
To perform Gaussian elimination starting with the above given system of equations we compose the augmented matrix equation in the form:
After performing elementary raw operations the augmented matrix is put into the upper triangular form:
The solution to the original system is found via back substitution. The solution to the last equation is
This result may now be substituted into the second to last equation, allowing us to solve for . Repetition of this substitution process will give us the complete solution vector. The back substitution process may be expressed as
where .
Algorithm
Forward elimination phase
 for k:= 1 step until n1 do
 for i:=k+1 step until n do

 for j:=k+1,3

 end loop (j)


 end loop (i)
 for i:=k+1 step until n do
 end loop (k)
Back substitution phase
 for k:=n stepdown until 1 do
 for i:=k+1 step until n

 end loop (i)

 for i:=k+1 step until n
 end loop (k)
Important Considerations
Gaussian elimination is best used for relatively small, relatively full systems of equations. If properly used, it should outperform most iterative methods for these systems. As the system to be solved becomes larger, the overhead associated with the more complicated iterative methods becomes less of an issue, and the iterative methods should outperform Gaussian Elimination. For sparse systems, the use of Gaussian elimination is complicated by the possible introduction of more nonzero entries (fillin). In any case, it is important to keep in mind that the basic algorithm is vulnerable to accuracy issues, including (but not limited to) the distinct possibility of division by zero at various places in the solution process. In practice, it is best to employ safeguards against such problems (e.g. pivoting).