Professional Documents
Culture Documents
S O LV I N G S Y S T E M S O F L I N E A R
E Q U AT I O N S
ITERATIVE METHODS
equations.
Suppose
CONT’D
and assume that the coefficients in the leading diagonal are large
enough so that
a11 a12 a13
Suppose a1 x b1 y c1 z d1
a2 x b2 y c2 z d 2
a3 x b3 y c3 z d 3 ………. (1)
a1 b1 c1
b2 a2 c2
c3 a3 b3
CONT’D
Now solve for x, y and z (whose coefficients are the larger values) in terms
1
x d1 b1 y c1 z
a1
1
y d 2 a2 x c2 z
b2
1
z d3 a3 x c3 y ……….. (2)
c3
respectively.
1
Thus x1 d1 b1 y0 c1 z0
a1
1
y1 d 2 a2 x0 c2 z0
b2
1
z1 d3 a3 x0 b3 y0
c3
CON’T
Now use these values of x1 , y1 , z1 in (2) and get
1
x2 d1 b1 y1 c1 z1
a1
1
y2 d 2 a2 x1 c2 z1
b2
1
z2 d3 a3 x1 b3 y1
c3
1
then xr 1 d1 b1 yr c1 zr
a1
1
y r 1 d1 a 2 x r c 2 z r
b2
1
z r 1 d 3 a3 x r b3 y r
c3
10 x y 2 z 7
3x 10 y z 15
x y 10 z 20
CONT’D
Solution
Gauss-Jacobi iteration method. To do this first let us write the given equations
as
1
x 7 y 2z
10
1
y 15 3x z …….. (1)
10
1
z 20 x y
10
7
Thus x1 0.7
10
15
y1 1. 5 and
10
20
z1 2
10
CONT’D
Now using these values of x, y and z , in (1) and let us find for the second
iteration.
1
x2 7 1.5 2)( 2) 0.95
10
1
y2 15 3(0.7) 2 1.09
10
1
z2 20 0.7 1.5 1.92
10
1
x3 7 1.09 2(1.92) 0.975
10
1
y3 (15 3(0.95) (1.92) 1.023
10
1
z3 (20 0.95 1.09) 1.986
10
CONT’D
1
x4 7 1.023 2(1.986) 0.9949
10
1
y4 (15 3(0.975) 1.986) 1.0089
10
1
z4 (20 0.975 1.023) 1.9952
10
1
x5 7 1.0089 2(1.9952) 0.99815
10
1
y5 (15 3(0.9949) 1.9952) 1.00201
10
1
z5 (20 0.9949 1.0089) 1.9986
10
CONT’D
1
x6 7 1.00201 2(1.9986) 0.999519
10
1
y6 (15 3(0.99815) 1.9986) 1.000695
10
1
z6 (20 0.99815 1.00201) 1.999614
10
1
x7 7 1.000695 2(1.999614) 0.9998533
10
1
y7 (15 3(0.999519) 1.999614) 1.0001829
10
1
z7 (20 0.999519 1.000695) 1.9998824
10
CONT’D
Putting these values again in (1), we obtain
1
x8 7 1.001829 2(1.9998824) 0.99995819
10
1
y8 (15 3(0.998533) 1.9998824) 1.00005577
10
1
z8 (20 0.9998533 1.0001829) 1.99996704
10
1
x9 7 1.00005577 2(1.99996704) 0.999987831
10
1
y9 (15 3(0.99995819) 1.99996704) 1.00005839
10
1
z9 (20 0.99995819 1.00005577) 1.999990242
10
CONT’D
1
x10 7 1.000015839 2(1.999990242) 0.9999964645
10
1
y10 (15 3(0.999987831) 1.99996704) 1.000006947
10
1
z10 (20 0.999987831 1.000015839) 1.999997199
10
1
x11 7 1.000006947 2(1.999997199) 0.9999987451
10
1
y11 (15 3(0.9999964645) 1.999997199) 1.000001341
10
1
z11 (20 0.9999964645 1.000006947) 1.999998951
10
Thus correct to five decimal places the solution of the given equation is
x 1, y 1 and z 2 .
Jacobi method : Example 2
Consider the following set of equations.
10 x1 x2 2 x3 6
x1 11 x2 x3 3x4 25
2 x1 x2 10 x3 x4 11
3 x2 x3 8 x4 15
Convert the set Ax = b in the form of x = Tx + c.
1 1 3
x1 x2 x3
10 5 5
1 1 3 25
x2 x1 x3 x4
11 11 11 11
1 1 1 11
x3 x1 x2 x4
5 10 10 10
3 1 15
x4 x2 x3
8 8 8
Jacobi method : Example 2
(1) 1 (0) 1 (0) 3
x1 x2 x3
10 5 5
(1) 1 ( 0) 1 (0) 3 ( 0) 25
x2 x1 x3 x4
11 11 11 11
(1) 1 (0) 1 (0) 1 (0) 11
x3 x1 x2 x4
5 10 10 10
(1) 3 (0) 1 (0) 15
x4 x2 x3
8 8 8
(0) (0) (0) (0)
x1 0, x2 0, x3 0 and x4 0.
(1) 1 1 3
x1 (0) (0)
(1)
(1) 1
10 5
1 3
5
25 x1 0.6000,
x2 (0) (0) (0)
11 11 11 11 (1)
(1) 1 1 1 11 x2 2.2727,
x3 (0) (0) (0)
5 10 10 10 (1)
(1) 3 1 15 x3 1.1000
x4 (0) (0)
8 8 8 (1)
x4 1.8750
Jacobi method : Example 2
(2) 1 (1) 1 (1) 3
x1 x2 x3
10 5 5
( 2) 1 (1) 1 (1) 3 (1) 25
x2 x1 x3 x4
11 11 11 11
( 2) 1 (1) 1 (1) 1 (1) 11
x3 x1 x2 x4
5 10 10 10
( 2) 3 (1) 1 (1) 15
x4 x2 x3
8 8 8
15 x20 5 x30 15
x
1
1
7.5
2 2 b Ax1 54.8546
21 4 x10 x30 21 2
x2
1
2.625
8 8
x31 7 4 x10 x20 7.0
JACOBI METHOD : EXAMPLE 4
15 2.625 5 7
x
1
1 11 .3125
2
21 4 7.5 7
x2
1
0.25
8 b Ax 2 208.3761
2
x31 7 4 7.5 2.625 39.625
We consider all the hypothesis of the Gauss-Jacobi method and write the given
equations as
1
x d1 b1 y c1z
a1
1
y d 2 a2 x c2 z ..........
b2
1
z d3 a3 x b3 y
c3
CONT’D
We start with the initial values y 0 , z 0 for y and z , and get x , from the first
equation of (*)
1
x1 d1 b1 y0 c1z0
a1
1
y1 d 2 a2 x1 c2 z0
b2
1
z1 d3 a3 x1 b3 y1
c3
CONT’D
Continuing again using these values of y y1 , and z z1 in (*), we get
1
x2 d1 b1 y1 c1 z1
a1
1
y2 d 2 a2 x2 c2 z1
b2
1
z2 d3 a3 x2 b3 y2
c3
This process of iteration is repeated till the values of x, y and z is obtained to the
5 x 2 y z 4
x 6 y 2 z 1
3x y 5 z 13
CONT’D
Solution
Since the coefficient matrix is a diagonally dominant matrix we can apply
the Gauss-Seidel method.
1
x 4 2 y z
5
1
y 1 x 2z .............1
6
1
z 13 3 x y
5
1
x1 4 0.8
5
1
y1 1 (0.8) 0.033333333
6
1
z1 13 3(0.8) (0.033333333) 3.086666667
5
CONT’D
2nd iteration
1
x2 4 2(0.03333333 3.0866666667) 1.430666667
5
1
y2 1 1.430666667 2 3.086666667 1.100666667
6
1
z2 13 3 1.430666667 1.100666667 3.238266667
5
CONT’D
3rd iteration
1
x3 4 2 1.430666667 3.238266667 2.01992
5
1
y3 1 2.01992 2 3.238266667 1.249408889
6
1
z3 13 3 2.01992 1.249408889 3.562070222
5
4th iteration
1
x4 4 2 1.249408889 3.562070222 1.012650489
5
1
y4 1 1.012650489 2 3.562070222 1.189465156
6
1
z4 13 3 1.012650489 1.189465156 2.969697262
5
CONT’D
5th iteration
1
x5 4 2 1.189465156 2.969697262 0.91815339
5
1
y5 1 0.91815339 2 2.969697262 0.976257985
6
1
z5 13 3 0.91815339 0.976257985 2.955640437
5
6th iteration
1
x6 4 2 0.976257985 2.955640437 1.000624893
5
1
y6 1 1.000624893 2 2.955640437 0.985317627
6
1
z6 13 3 1.000624893 0.985317627 3.00331141
5
CONT’D
7th iteration
1
x7 4 2 0.985317627 3.00331141 1.006535231
5
1
y7 1 1.006535231 2 3.00331141 1.002193009
6
1
z7 13 3 1.006535231 1.002193009 3..003482537
5
8th iteration
1
x8 4 2 1.002193009 3.003482537 0.999819303
5
1
y8 1 0.999819303 2 3.003482537 1.00113073
6
1
z8 13 3 0.999819303 1.00113073 2.999665436
5
GAUSS-SEIDEL METHOD: EXAMPLE 2
1 3 0 51
1 3 x 2 5 x3 x1 0.50000
x1 12
12 28 0.5 31
x2 4.9000
28 x1 3 x3 5
x2
5
76 3 0.50000 7 4.9000
76 3 x1 7 x 2 x3 3.0923
x3 13
13
GAUSS-SEIDEL METHOD: EXAMPLE
4.9000 0
a 2
100 100.00%
4.9000
3.0923 1.0000
a 3
100 67.662%
3.0923
The maximum absolute relative error after the first iteration is 100%
GAUSS-SEIDEL METHOD: EXAMPLE
3.7153 4.9000
a 2
100 31.887%
3.7153
3.8118 3.0923
a 3 100 18.876%
3.8118
The maximum absolute relative error after the first iteration is
240.62%
This is much larger than the maximum absolute relative error
obtained in iteration #1. Is this a problem?
GAUSS-SEIDEL METHOD: EXAMPLE
x1 0.99919
The solution obtained
x
2 3 .0001
x3 4.0001
x1 1
is close to the exact solution of x 2 3
x3 4