GaussSeidel method
From CFDWiki
(towards a uniform notation for linear systems : A*Phi = B) 
(Added more material) 

Line 1:  Line 1:  
+  == Introduction ==  
+  
We seek the solution to set of linear equations: <br>  We seek the solution to set of linear equations: <br>  
  :<math> A \  +  :<math> A \phi = b </math> <br> 
  +  In matrix terms, the the GaussSeidel iteration can be expressed as  
  In matrix terms, the  +  
  +  
  +  
  +  
  +  
  +  :<math>  
+  \phi^{(k)} = \left( {D  L} \right)^{  1} \left( {U\phi^{(k  1)} + b} \right),  
+  </math>  
  === Algorithm  +  where <math>D</math>, <math>L</math> and <math>U</math> represent the diagonal, lower triangular and upper triangular matrices of coefficient matrix <math>A</math> and <math>k</math> is the iteration count. This matrix expression is mainly of academic interest, and is not used to program the method. Rather, an elementbased approach is used: 
  +  
  : Chose an  +  :<math> 
  : for k := 1 step 1  +  \phi^{(k)}_i = \frac{1}{a_{ii}} \left(b_i  \sum_{j<i}a_{ij}\phi^{(k+1)}_j\sum_{j>i}a_{ij}\phi^{(k)}_j\right),\, i=1,2,\ldots,n. 
+  </math>  
+  
+  Note that the computation of <math>\phi^{(k)}_i</math> uses only those elements of <math>\phi^{(k+1)}</math> that have already been computed. This means that no additional storage is required, and the computation can be done in place (<math>\phi^{(k+1)}</math> replaces <math>\phi^{(k)}</math>). While this might seem like a rather minor concern, for large systems it is unlikely that every iteration can be stored. Thus, unlike the [[Jacobi method]], we do not have to do any vector copying should we wish to use only one storage vector. The iteration is generally continued until the changes made by an iteration are below some tolerance.  
+  
+  == Algorithm ==  
+  : Chose an initial guess <math>\phi^{0}</math> <br>  
+  : for k := 1 step 1 until convergence do <br>  
:: for i := 1 step until n do <br>  :: for i := 1 step until n do <br>  
::: <math> \sigma = 0 </math> <br>  ::: <math> \sigma = 0 </math> <br>  
Line 28:  Line 34:  
:: check if convergence is reached  :: check if convergence is reached  
: end (kloop)  : end (kloop)  
  
  
  
  
 
Revision as of 01:02, 19 December 2005
Introduction
We seek the solution to set of linear equations:
In matrix terms, the the GaussSeidel iteration can be expressed as
where , and represent the diagonal, lower triangular and upper triangular matrices of coefficient matrix and is the iteration count. This matrix expression is mainly of academic interest, and is not used to program the method. Rather, an elementbased approach is used:
Note that the computation of uses only those elements of that have already been computed. This means that no additional storage is required, and the computation can be done in place ( replaces ). While this might seem like a rather minor concern, for large systems it is unlikely that every iteration can be stored. Thus, unlike the Jacobi method, we do not have to do any vector copying should we wish to use only one storage vector. The iteration is generally continued until the changes made by an iteration are below some tolerance.
Algorithm
 Chose an initial guess
 for k := 1 step 1 until convergence do
 for i := 1 step until n do

 for j := 1 step until i1 do
 end (jloop)
 for j := i+1 step until n do
 end (jloop)

 end (iloop)
 check if convergence is reached
 for i := 1 step until n do
 end (kloop)