Example 1: Solving a system of equations by the GaussSeidel method
Use the GaussSeidel method to solve the system

4x_{1}  + x_{2}   x_{3}  = 3 
2x_{1}  + 7 x_{2}  + x_{3}  = 19 
x_{1}   3 x_{2}  +12 x_{3}  = 31 

<=>  
x_{1} =   1/4 x_{2}  + 1/4 x_{3}  + 3/4 
x_{2} =  2/7 x_{1}    1/7 x_{3}  + 19/7 
x_{3} =  1/12 x_{1}  + 1/4 x_{2}   + 31/12 

Solution:
We have
=  
0  1/4  1/4  
2/7  0  1/7 
1/12  1/4  0  


x_{1}  
x_{2} 
x_{3}  


The iteration formulas are
<=>  
x_{1}^{(k+1)} =   1/4 x_{2}^{(k)}  + 1/4 x_{3}^{(k)}  + 3/4 
x_{2}^{(k+1)} =  2/7 x_{1}^{(k+1)}    1/7 x_{3}^{(k)}  + 19/7 
x_{3}^{(k+1)} =  1/12 x_{1}^{(k+1)}  + 1/4 x_{2}^{(k+1)}   + 31/12 
The difference between the
GaussSeidel method and the Jacobi method
is that here we use the coordinates x_{1}^{(k)},...,x_{i1}^{(k)}
of x^{(k)} already known to compute its
ith coordinate x_{i}^{(k)}.
If we start from x_{1}^{(0)} = x_{2}^{(0)} = x_{3}^{(0)} = 0 and apply the iteration formulas, we obtain
k   x_{1}^{(k)}  x_{2}^{(k)}  x_{3}^{(k)} 
0   0  0  0 
1   0,75  2,50  3,15 
2   0,91  2,00  3,01 
3   1,00  2,00  3,00 
4   1,00  2,00  3,00 
The exact solution is: x_{1} = 1, x_{2} = 2, x_{3} = 3.
For instance, when k=2, we have x_{2}^{(2)}= 2,00:
x_{2}^{(2)} = 2/7 x_{1}^{(2)}  1/7 x_{3}^{(1)} + 19/7 = 2/7 · 0,72  1/7 · 3,15 + 19/7 = 2,00
Go back to theory