GAUSS-SEIDEL METHOD
This is a modification of Gauss-Jacobi’s method.
Let us consider the system of equations
a 11 x1 + a12 x 2+ a13 x 3=b1
a 21 x1 + a22 x 2+ a23 x 3=b2
a 31 x1 + a32 x 2+ a33 x 3=b3 … … … … … … … … …(1)
Where the diagonal coefficients are not zero and are large compared to other coefficients. Such a
system is called a diagonally dominant system.
The system of equation (1) may be written as
1
x 1= [ b −a x −a x ]
a11 1 12 2 13 3
1
x 2= [ b −a x −a x ]
a22 2 21 1 23 3
1
x 3= [ b −a x −a x ] … … … … …..(2)
a33 3 31 1 32 2
(0 ) ( 0) (0 )
Let the initial approximate solution be x 1 , x2 , x 3 .
Substituting x 2(0 ) , x3( 0) in the first equation of (2), we get
1
x 1( 1) = [ b −a x ( 0)−a13 x 3(0 ) ] … … … … .(3)
a11 1 12 2
This is taken as the first approximation of x1.
Substituting x 1(1) for x1 and x 3(0 ) for x3 in the second equation of (2), we get
1
x 2( 1 ) =
a 22
[ b2−a21 x 1(1)−a23 x 3(0 ) ] … … … … … … …(4 )
This is taken as the first approximation of x2.
Next, substituting x 1(1) for x1 and x 2(1) for x2 in the last equation of (2), we get
1
x 3 ( 1) =
a 33
[ b3−a31 x 1(1)−a32 x 2(1 )] … … … … ..(5)
This is taken as the first approximation of x3.
The values obtained in (3),(4),(5) constitute the first iterates of the solution.
Proceeding in the same way, we get successive iterates.
The (k+1)th iterates are given by
1
x 1(k+1 )= [ b −a x (k )−a 13 x 3(k) ]
a11 1 12 2
1
x 2(k+1 ) = [ b −a x ( k+1)−a23 x 3(k ) ]
a22 2 21 1
1
x 3(k +1) = [ b −a x ( k+1 )−a32 x 2(k +1) ] … … … … …(6)
a33 3 31 1
The iteration process is stopped when the desired order of approximation is reached or
two successive iterations are nearly the same. The final values of x1,x2,x3 so obtained
constitute an approximate solution of the system (2).
This method can be generalized to a system of ‘n’ equations ‘n’ unknowns.
The method is known as Gauss-Seidel iteration method.
Comparison between Gauss-Seidel method and Jacobi’s method
In Gauss-Seidel method, the current values of unknowns are used at each stage of
iteration in getting the values of unknowns.
Therefore, Gauss-Seidel method is very fast when compared to Jacobi’s method. The rate
of convergence of Gauss-Seidel method is two times than that of Jacobi’s method.
Problems
1. Use Gauss-Seidel iteration method to solve the system 10x+y+z = 12,
2x+10y+z =13, 2x+2y+10z =14
Solution: The given system is diagonally dominant.
Then we can write the equations
1
x= [ 12− y −z ] … … …(1)
10
1
y= [ 13−2 x−z ] … … … … .(2)
10
1
z= [ 14−2 x −2 y ] … … … … ..(3)
10
We start iteration by taking y = 0, z = 0 in equation (1), we get
1 1
x (1) = [ 12−0−0 ] = [ 12 ] =1.2
10 10
(1 )
Putting x=x =1.2, z = 0 in equation (2), we get
1 1 1
y (1 )= [ 13−2 x (1) −z ] = [ 13−2 ( 1.2 )−0 ] = [ 10.6 ] =1.06
10 10 10
Putting x=x (1 ) =1.2, y= y (1)=1.06 in equation (3), we get
1 1 1
z (1 )= [ 14−2 x (1 )−2 y ( 1) ]= [ 14−2 ( 1.2 )−2 (1.06 ) ] = [ 9.48 ] =0.948
10 10 10
Now taking y (1 ), z (1 ) as the initial values in equation (1), we get
1 1 1
x (2 )= [ 12− y (1 )−z (1) ] = [ 12−1.06−0.948 ] = [ 9.992 ] =0.9992
10 10 10
(2 ) (1 )
Taking x=x and z=z in equation (2), we get
1 1 1
y (2 )= [ 13−2 x (2 )−z( 1) ] = [ 13−2 ( 0.999 ) −0.948 ] = [ 10.054 ] =1.0054
10 10 10
Next taking x=x ( 2 ) =0.999, y= y (2)=1.005 in equation (3), we get
1 1 1
z (2 )= [ 14−2 x (2 )−2 y( 2) ] = [ 14−2 ( 0.999 )−2 ( 1.005 ) ] = [ 9.992 ] = 0.999
10 10 10
Again taking x (2 ), y (2 ), z (2 ) as the initial values, we get
1 1 1
x (3 )= [ 12− y (2 )−z (2) ] = [ 12−1.005−0.999 ] = [ 9.996 ]= 0.9996=1.00
10 10 10
1 1 1
y (3 )= [ 13−2 x (3 )−z (2) ] = [ 13−2 ( 1 )−0.999 ]= [ 10.001 ]= 1.0001=1
10 10 10
1
z (3 )= [ 14−2 x (3 )−2 y (3) ] = 1 [ 14−2 (1 ) −2 ( 1 ) ]= 1 [ 10 ] = 1
10 10 10
(3 ) (3 ) (3 )
Again taking x , y , z as the initial values, we get
1
x (4 )= [ 12− y (3)−z ( 3) ] = 1 [ 12−1−1 ] = 1 [ 10 ] = 1
10 10 10
1 1 1
y ( 4)= [ 13−2 x( 4 )−z (3) ] = [ 13−2 ( 1 )−1 ] = [ 10 ] = 1
10 10 10
1 1 1
z (4 )= [ 14−2 x (4 )−2 y (4 ) ] = [ 14−2 (1 ) −2 ( 1 ) ] = [ 10 ] = 1
10 10 10
⸫ The solution of given equations are x = 1, y = 1, z = 1.
2. Solve the following system of equations by using Gauss-Seidel method correct to
three decimal places.
8x-3y+2z = 20,4x+11y-z = 33, 6x+3y+12z = 35.
Solution: Consider the system of equations
8x-3y+2z = 20
4x+11y-z = 33
6x+3y+12z = 35 ………… (1)
Since the diagonal elements are dominant in the coefficient matrix of equation (1)
i.e: |8|>|−3|+|2|
|11|>|4|+|−1|
|12|>|6|+|3|
Convergence condition is satisfied, we apply iterative method for the given system of
(1), then we can write x,y,z as follows.
1
x= [ 20+3 y −2 z ] … … … … … .(2)
8
1
y= [ 33−4 x + z ] … … … … … .( 3)
11
1
z= [ 35−6 x−3 y ] … … … … ..(4 )
12
Iteration :( 1) Putting y=0,z= 0 in R.H.S of equation (2), we get
1 1 1
x 1= [ 20+3 y−2 z ] = [ 20+0−0 ] = [ 20 ] = 2.5
8 8 8
Putting x=x 1 =2.5 , z= 0 in R.H.S of equation (3), we get
1 1 1
y 1=
11
[ 33−4 x 1 + z ] =
11
[ 33−4 ( 2.5 ) +0 ] =
11
[ 23 ] = 2.091
Putting x=x 1=2.5 , y= y1 =2.091 in R.H.S of equation (4), we get
1 1 1
z 1= [ 35−6 x 1−3 y 1 ] =
12 12
[ 35−6 ( 2.5 )−3 ( 2.091 ) ] =
12
[ 13.727 ] = 1.144
Iteration :( 2) For second approximation
1 1 1
x 2=
8
[ 20+3 y 1−2 z 1 ] = 8 [ 20+3 ( 2.091 )−2 ( 1.144 ) ] = 8 [ 23.985 ] = 2.998
1 1 1
y 2= [ 33−4 x 2 + z 1 ] = [ 33−4 ( 2.998 ) +1.144 ] = [ 22.152 ] = 2.014
11 11 11
1 1 1
z 2= [ 35−6 x 2−3 y 2 ] =
12 12
[ 35−6 ( 2.998 )−3 ( 2.014 ) ] =
12
[ 10.97 ] = 0.914
Iteration :( 3) For third approximation
1 1 1
x 3= [ 20+3 y 2−2 z 2 ] = [ 20+3 ( 2.014 )−2 ( 0.914 ) ] = [ 24.214 ] = 3.027
8 8 8
1 1 1
y 3= [ 33−4 x 3 + z 2 ] =
11 11
[ 33−4 ( 3.027 ) +0.914 ] =
11
[ 21.806 ] = 1.982
1 1 1
z 3= [ 35−6 x 3−3 y 3 ] =
12 12
[ 35−6 ( 3.027 )−3 ( 1.982 ) ] =
12
[ 10.892 ] = 0.908
Iteration :( 4) For fourth approximation
1 1 1
x4 = [ 20+3 y 3−2 z 3 ] = [ 20+3 ( 1.982 )−2 ( 0.908 ) ] = [ 24.13 ] = 3.016
8 8 8
1 1 1
y 4 = [ 33−4 x 4 + z 3 ] =
11 11
[ 33−4 ( 3.016 ) +0.908 ] =
11
[ 21.844 ] = 1.986
1 1 1
z 4 = [ 35−6 x 4−3 y 4 ] =
12 12
[ 35−6 ( 3.016 )−3 ( 1.986 ) ] =
12
[ 10.946 ] = 0.912
Iteration :( 5) For fifth approximation
1 1 1
x 5= [ 20+3 y 4−2 z 4 ] = [ 20+3 ( 1.986 ) −2 ( 0.912 ) ] = [ 24.134 ] = 3.017
8 8 8
1 1 1
y 5=
11
[ 33−4 x 5 + z 4 ] =
11
[ 33−4 ( 3.017 ) +0.912 ] =
11
[ 21.844 ] = 1.986
1 1 1
z 5= [ 35−6 x 5−3 y 5 ] =
12 12
[ 35−6 ( 3.017 )−3 ( 1.986 ) ] =
12
[ 10.94 ] = 0.912
Iteration :( 6) For sixth approximation
1 1 1
x 6= [ 20+ 3 y 5 −2 z 5 ] = [ 20+3 ( 1.986 ) −2 ( 0.912 ) ] = [ 24.134 ] = 3.017
8 8 8
1 1 1
y 6= [ 33−4 x 6 + z 5 ] =
11 11
[ 33−4 ( 3.017 ) +0.912 ] =
11
[ 21.844 ] = 1.986
1 1 1
z 6= [ 35−6 x6 −3 y 6 ] =
12 12
[ 35−6 ( 3.017 )−3 ( 1.986 ) ] = 12 [ 10.94 ] = 0.912
We observe that from 5th and 6th iterations are same.
⸫ The solution of the equations are x = 3.017, y = 1.986, z = 0.912
3. Solve the following system of equations by using Gauss-Seidel method correct to
three decimal places.
x+y+54z = 110, 27x+6y-z = 85,6x+15y+2z = 72
4. 8x+y+z = 8, 2x+4y+z = 4, x+3y+6z = 5