Vous êtes sur la page 1sur 5

zar97/09/03

Numerical Methods For Engineers

page 3-26

Gauss-Seidel Method
For many systems with a large number of equations, the elimination methods seem
to be less efficient. This is because most of the elements of the coefficient matrix A
are zero i.e. the matrix A is extremely sparse. An iterative procedure based on an
initial guess is suggested. In iterative methods, RErs are not the major concern here
since we can control the level of error. Gauss-Seidel iteration is the most popular
and one of the most powerful iterative techniques available for solutions of LAEs.
Consider the following set of three LAEs,
a11x1 + a12x2 + a13x3 = b1
a21x1 + a22x2 + a23x3 = b2
a31x1 + a32x2 + a33x3 = b3
Solving the above three equations each for x1, x2, and x3, respectively, yields

b1 a12 x2 a13x3
a11
b a 21x1 a23x3
x2 2
a 22
x1

x3

b3 a31x1 a 32 x2
a 33

(3.20)

zar97/09/03

Numerical Methods For Engineers

page 3-27

To solve eq.(3.20), initial guesses for x1, x2, and x3 are needed. Lets denote these
initial guesses as x1(0) , x2(0) , and x3(0) , the new values are then
x1(1)

b1 a12 x2(0) a13x3(0)


a11

x2(1)

b2 a21x1(1) a 23x3(0)
a 22

x3(1)

b3 a 31x1(1) a32 x2(1)


a 33

Note that the new estimate of xi(k) is immediately used in the subsequent equations.
This is where it is different from the Jacobi method. The iteration continues until the
convergence criterion is satisfied. Most commonly used convergence criterion is

a, j

x j (k) x j (k 1)
x j (k)

100 % < s

(3.21)

for all unknowns xj where xj(k) and xj(k-1) are the new and old values, respectively.
Remark:
The method is best employed when the matrix of coefficients is diagonally
dominant; that is when
n

aii

aij

(3.22)

i , j 1,i j

That is the diagonal element in each of the equations must be larger that the sum of
the absolute values of the other elements in the equation. This is to ensure that the
method converges to the exact solution. Thus, the criterion is a sufficient condition
but not necessary.

zar97/09/03

Numerical Methods For Engineers

page 3-28

Example 3.8: LAEs with iterative approach.


Problem Statement: Solve the following set of linear algebraic equations using
Gauss-Seidel method.
8x1 + 2x2 + 3x3 = 30
x1 - 9x2 + 2x3 = 1
2x1 + 3x2 + 6x3 = 31
Solution:
Notice that the equation is diagonally dominant, so we do not have to
interchange any of the row.
Solving each of the equations for x1, x2, and x3, yields

30 2 x2 3x3
8
1 x1 2 x3
x2
9
31 2 x1 3x2
x3
6
x1

k
0
1
2
3
4

x1
1.0
3.1250
2.1745
2.0220
2.0034

a,1
68.0
43.1
7.54
0.93

x2
1.0
0.4583
0.9963
0.9899
0.9999

a,2
118.2
54.0
0.64
1.0

x3
1.0
3.8959
3.9437
3.9977
3.9989

a,3
74.3
1.21
1.33
0.03

After four iterations the solution seems to be converging. Thus, the estimate of the
solution is x = [2.0034, 0.9999, 3.9989]T . The exact answer is [2, 1, 4]T.

zar97/09/03

Numerical Methods For Engineers

page 3-29

Gauss-Seidel with relaxation


To improve convergence of the Gauss-Seidel method, relaxation is introduced. The
new value of x to be used in the successive equations is modified by a weighted
average of the present and previous iterations:
x j new x j new ( 1 )x j old

(3.23)

where = a relaxation (or weighting) factor.


if

= 1
0< < 1
1< < 2

: no modification.
: underrelaxation.
: overrelaxation. (or better known as Successive
Overrelaxation, SOR).

Note: Selection of the optimum value for is highly problem-specific and is


normally determined by empirical or numerical means. For most systems of LAEs,
overrelaxation is more appropriate while underrelaxation is used when the GaussSeidel algorithm causes the solution to overshoot by dampening out oscillations.

zar97/09/03

Numerical Methods For Engineers

page 3-30

Example 3.9: LAEs using iterative approach with relaxation.


Problem Statement: Solve the following set of linear algebraic equations using
Gauss-Seidel method with a relaxation factor = 1.1 .
8x1 + 2x2 + 3x3 = 30
x1 - 9x2 + 2x3 = 1
2x1 + 3x2 + 6x3 = 31
Solution:
Notice that the equation is diagonally dominant, so we do not have to
interchange any of the row.
Solving each of the equations for x1, x2, and x3, yields

30 2 x2 3x3
30 2(1.0) 3(1.0)

31250
.
x1(1) (1.1)(3.1250) ( 0.1)1 3.3375
8
8
1 x1 2 x3 1 (3.3375) 3(1.0)
x2

0.4819
x2 (1) (1.1)(0.4819) ( 0.1)1 0.4301
9
9
31 2 x1 3x2 31 2(3.3375) 3(0.4301)
x3

3.8391 x3(1) (1.1)(3.8391) (0.1)1 3.3375


6
6
x1

k
0
1
2
3
4

Answer:

x1
1.0
3.1250
1.9971

a,1
-

x2
1.0
0.4819
0.9893

a,2
-

x3
1.0
3.8391
4.0102

a,3
-

Vous aimerez peut-être aussi