SEAMBooks SPCE DCCN Gauss Seidel Students

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

SPCE-DCCN Numerical Solution of System of Equation Gauss Seidel

Module-6 Gauss Seidel Iterative Method


Topic-4

Gauss Seidel Iterative Method


To solve the system of equations

a1 x + b1 y + c1 z = d1
a2 x + b2 y + c2 z = d 2
a3 x + b3 y + c3 z = d 3

Rearrange the equations so that the coefficient matrix is diagonally dominant.

Write equations as

1
x=  d1 − b1 y − c1 z  Here a1  b1 + c1
a1
1
y=  d 2 − a2 x − c2 z  Here b2  a2 + c2
b2
1
z=  d3 − a3 x − b3 y  Here c3  a3 + b3
c3

Suppose initial solution is x (0) , y (0) , z (0)

First iterative solution is given by

1
x (1) =  d1 − b1 y (0) − c1 z (0) 
a1
1
y (1) =  d 2 − a2 x (1) − c2 z (0)  Use improved value of x obtained in the previous step
b2
1
z (1) =  d3 − a3 x (1) − b3 y (1)  Use improved value of x and y obtained in the previous steps
c3

Second iterative solution is given by

1
x (2) =  d1 − b1 y (1) − c1 z (1) 
a1 
1
y (2) =  d 2 − a2 x (2) − c2 z (1) 
b2 
1
z (2) =  d3 − a3 x (2) − b3 y (2) 
c3 

Continue till we get desired accuracy.

© 2022-SEAMBooks by Prof. Satishkumar Barot Page 1


SPCE-DCCN Numerical Solution of System of Equation Gauss Seidel

Solved Examples

1. Solve the following system of equations using Gauss Seidel Iterative method
10 x + 2 y + z = 9
x + 10 y − z = −22
−2 x + 3 y + 10 z = 22

2. Solve the following system of equations using Gauss Seidel Iterative method
6 x + 15 y + 2 z = 72
x + y + 54 z = 110
27 x + 6 y − z = 85

3. Solve the following system of equations using Gauss Seidel Iterative method up to four
iterations
4 x − 2 y − z = 40
x − 6 y + 2 z = −28
x − 2 y + 12 z = −86

4. Solve the following system of equations using Gauss Seidel method


20 x + y − 2 z = 17
3 x + 20 y − z = −18
2 x − 3 y + 20 z = 25

5. Solve the following system of equations using Gauss Seidel Iterative method
28 x + 4 y − z = 32
x + 3 y + 10 z = 24
2 x + 17 y + 4 z = 35

© 2022-SEAMBooks by Prof. Satishkumar Barot Page 2


SPCE-DCCN Numerical Solution of System of Equation Gauss Seidel

Example 8.2.1: Solve the following system of equations using Gauss Seidel Iterative method
10 x + 2 y + z = 9
x + 10 y − z = −22
−2 x + 3 y + 10 z = 22

Solution: Here coefficient matrix of the system of equations is diagonally dominant. Dividing
each equation by the dominant diagonal element and rewriting the equations, we have
1
10 x + 2 y + z = 9  x = 9 − 2 y − z  − − − − − −(1)
10
1
x + 10 y − z = −22  y =  −22 − x + z  − − − − − (2)
10
1
−2 x + 3 y + 10 z = 22  z =  22 + 2 x − 3 y  − − − (3)
10

Let the initial values of x, y, z be


x ( ) = 0, y ( ) = 0, z ( ) = 0
0 0 0

By Gauss Seidel Iterative Method,First iterative solution is given by


1 1
x( ) =
1
9 − 2 y ( 0) − z ( 0)  = 9 − 2 ( 0 ) − 0  = 0.9
10   10
1 1
y ( ) =  −22 − x ( ) + z ( )  =  −22 − 0.9 + 0 = −2.29
1 1 0

10 10
1 1
z ( ) =  22 + 2 x ( ) − 3 y ( )  =  22 + 2 ( 0.9 ) − 3 ( −2.29 )  = 3.067
1 1 1

10 10

Second iterative solution is given by


1 1
x( ) =
2
9 − 2 y (1) − z (1)  = 9 − 2 ( −2.29 ) − 3.067  = 1.0513
10   10
1 1
y ( ) =  −22 − x ( ) + z ( )  =  −22 − 1.0513 + 3.067  = −1.99843
2 2 1

10 10
1 1
z ( ) =  22 + 2 x ( ) − 3 y ( )  =  22 + 2 (1.0513) − 3 ( −1.99843)  = 3.00978
2 2 2

10 10

Third iterative solution is given by


1  1
x ( 3) =  10 9 − 2 ( −1.99843) − 3.00978 = 0.99870
( 2) ( 2) 
9 − 2 y − z =
10 
1 1
y ( ) =  −22 − x( ) + z ( )  =  −22 − 0.99870 + 3.00978 = −1.99889
3 3 2

10 10
1 1
z (3) =  22 + 2 x (3) − 3 y (3)  =  22 + 2 ( 0.99870 ) − 3 ( −1.99889 )  = 2.99940
10 10

© 2022-SEAMBooks by Prof. Satishkumar Barot Page 3


SPCE-DCCN Numerical Solution of System of Equation Gauss Seidel

Fourth iterative solution is given by


1 1
x( ) =
4
9 − 2 y ( 3) − z ( 3)  = 9 − 2 ( −1.99889 ) − 2.99940  = 0.99983
10   10
1 1
y ( ) =  −22 − x ( ) + z ( )  =  −22 − 0.99983 + 2.99940 = −2.00004
4 4 3

10 10
1 1
z ( ) =  22 + 2 x ( ) − 3 y ( )  =  22 + 2 ( 0.99983) − 3 ( −2.00004 )  = 2.99997
4 4 4

10 10

 Solution is x = 0.99983, y = −2.00004, z = 2.99997

© 2022-SEAMBooks by Prof. Satishkumar Barot Page 4


SPCE-DCCN Numerical Solution of System of Equation Gauss Seidel

Example 8.2.2: Solve the following system of equations using Gauss Seidel Iterative method
6 x + 15 y + 2 z = 72
x + y + 54 z = 110
27 x + 6 y − z = 85

Solution: Rearranging equations so that the coefficient matrix of the system of equations is
diagonally dominant.
27 x + 6 y − z = 85
6 x + 15 y + 2 z = 72
x + y + 54 z = 110

Dividing each equation by the dominant diagonal element and rewriting the equations, we have

1
27 x + 6 y − z = 85  x = 85 − 6 y + z  − − − − − −(1)
27
1
6 x + 15 y + 2 z = 72  y =  72 − 6 x − 2 z  − − − − − (2)
15
1
x + y + 54 z = 110  z = 110 − x − y  − − − − − −(3)
54

Let the initial values of x, y, z be


x ( ) = 0, y ( ) = 0, z ( ) = 0
0 0 0

By Gauss Seidel Iterative Method,First iterative solution is given by


1  1
x( ) = 85 − 6 y ( ) + z ( )  = 85 − 6 ( 0 ) + ( 0 )  = 3.14814
1 0 0

27  27 
1 1
y ( ) = 72 − 6 x ( ) − 2 z ( )  = 72 − 6 ( 3.14814 ) − 2 ( 0 )  = 3.54074
1 1 0

15 15
1 1
z ( ) = 110 − x ( ) − y ( )  = 110 − 3.14814 − 3.54074  = 1.91316
1 1 1

54 54

Second iterative solution is given by


1 
x( ) = 85 − 6 y ( ) + z ( )  = ________________
2 1 1

27 
1 
y( ) = 72 − 6 x ( ) − 2 z ( )  = ________________
2 2 1

15 
1
z(
2)
= 110 − x ( ) − y ( )  = ________________
2 2

54

© 2022-SEAMBooks by Prof. Satishkumar Barot Page 5


SPCE-DCCN Numerical Solution of System of Equation Gauss Seidel

Third iterative solution is given by


1 
x ( 3) = 85 − 6 y ( 2) + z ( 2)  = ________________
27
1
y ( ) = 72 − 6 x ( ) − 2 z ( )  = ________________
3 3 2

15
1
z ( ) = 110 − x ( ) − y ( )  = ________________
3 3 3

54

Fourth iterative solution is given by


1 
x( 4) =  85 − 6 y (3) + z (3)  = ________________
27
1
y ( ) = 72 − 6 x ( ) − 2 z ( )  = ________________
4 4 3

15
1 
z( ) = 110 − x ( ) − y ( )  = ________________
4 4 4

54 

 Solution is x = _________, y = ___________, z = _________

© 2022-SEAMBooks by Prof. Satishkumar Barot Page 6


SPCE-DCCN Numerical Solution of System of Equation Gauss Seidel

Example 8.2.3: Solve the following system of equations using Gauss Seidel Iterative method
up to four iterations
4 x − 2 y − z = 40
x − 6 y + 2 z = −28
x − 2 y + 12 z = −86

Solution: Here coefficient matrix of the system of equations is diagonally dominant. Dividing
each equation by the dominant diagonal element and rewriting the equations, we have

1
4 x − 2 y − z = 40  x =  40 + 2 y + z  − − − − − −(1)
4
1
x − 6 y + 2 z = −28  y =  28 + x + 2 z  − − − − − (2)
6
1
x − 2 y + 12 z = −86  z =  −86 − x + 2 y  − − − (3)
12

Let the initial values of x, y, z be


x ( 0) = 0, y ( 0) = 0, z ( 0) = 0

By Gauss Seidel Iterative Method,First iterative solution is given by


1 ( 0)  1
x (1) =  = 4  40 + 2 ( 0 ) + ( 0 )  = 10
( 0)
40 + 2 y + z
4
1 1
y( ) =  28 + x( ) + 2 z ( )  =  28 + 10 + 2 ( 0 )  = 6.33333
1 1 0

6 6
1  1
z( ) =  12  −86 − 10 + 2 ( 6.33333 )  = −6.94444
(1) (1) 
− − + =
1
86 x 2 y
12 

Second iterative solution is given by


1
x( ) = 40 + 2 y ( ) + z ( )  = ________________
2 1 1

4 
1
y ( 2) =  28 + x ( 2) + 2 z (1)  = ________________
6
1
z ( 2) =  −86 − x ( 2) + 2 y ( 2)  = ________________
12

Third iterative solution is given by


1
x( ) = 40 + 2 y ( ) + z ( )  = ________________
3 2 2

4 
1
y ( ) =  28 + x ( ) + 2 z ( )  = ________________
3 3 2

6
1
z ( ) =  −86 − x ( ) + 2 y ( )  = ________________
3 3 3

12

© 2022-SEAMBooks by Prof. Satishkumar Barot Page 7


SPCE-DCCN Numerical Solution of System of Equation Gauss Seidel

Fourth iterative solution is given by


1
x( ) = 40 + 2 y ( ) + z ( )  = ________________
4 3 3

4 
1
y ( ) =  28 + x ( ) + 2 z ( )  = ________________
4 4 3

6
1
z ( ) =  −86 − x ( ) + 2 y ( )  = ________________
4 4 4

12

 Solution is x = _________, y = __________, z = __________

© 2022-SEAMBooks by Prof. Satishkumar Barot Page 8

You might also like