Post on 06-Jul-2018
8/17/2019 Ch11 Gauss Siedel
1/22
The Islamic University of Gaza
Faculty of EngineeringCivil Engineering Department
Numerical AnalysisECIV 3306
Chapter 11Special Matrices and Gauss-Siedel
8/17/2019 Ch11 Gauss Siedel
2/22
Introduction
• Certain matrices have particular structures that canbe exploited to develop efficient solution schemes.
• A banded matrix is a square matrix that has allelements equal to zero, with the exception of a bandcentered on the main diagonal. These matricestypically occur in solution of differential equations.
• The dimensions of a banded system can bequantified by two parameters: the band width BWand half-bandwidth HBW. These two values arerelated by BW=2HBW+1.
8/17/2019 Ch11 Gauss Siedel
3/22
Banded matrix
8/17/2019 Ch11 Gauss Siedel
4/22
4
Tridiagonal Systems•
A tridiagonal system has a bandwidth of 3:
4
3
2
1
4
3
2
1
44
333
222
11
r r
r
r
x x
x
x
f e g f e
g f e
g f
• An efficient LU decomposition method, called Thomas
algorithm , can be used to solve such an equation. Thealgorithm consists of three steps: decomposition, forwardand back substitution, and has all the advantages of LUdecomposition.
8/17/2019 Ch11 Gauss Siedel
5/22
Fig 11.2
8/17/2019 Ch11 Gauss Siedel
6/22
Cholesky Decomposition
6
This method is suitable for only symmetric systemswhere:
T ij jia a and A A
11 12 13 11 11 21 31
21 22 23 21 22 22 32
31 32 33 31 32 33 33
0 0
0 * 0
0 0
a a a l l l l
a a a l l l l
a a a l l l l
11
21 22
31 32 33
0 0
[ ] 0
l
L l l
l l l
* T A L L
8/17/2019 Ch11 Gauss Siedel
7/22
Cholesky Decomposition
1
1 1,2, , 1
i
ki ij kj j
ki
ii
a l l l for i k
l
12
1
k
kk kk kj j
l a l
8/17/2019 Ch11 Gauss Siedel
8/22
Pseudocode for Cholesky ’ s LUDecomposition algorithm (cont ’ d)
8/17/2019 Ch11 Gauss Siedel
9/22
Gauss-Siedel
• Iterative or approximate methods provide analternative to the elimination methods. The Gauss-Seidel method is the most commonly used iterative
method.• The system [A]{X}={B}is reshaped by solving the
first equation for x 1, the second equation for x 2,and the third for x
3, …and n th equation for x
n. We
will limit ourselves to a 3x3 set of equations.
8/17/2019 Ch11 Gauss Siedel
10/22
Gauss-Siedel
33
23213131
22
32312122
11
31321211
a xa xab x
a
xa xab x
a
xa xab x
3333232131
2323222121
1313212111
b xa xa xa
b xa xa xa
b xa xa xa
Now we can start the solution process by choosing
guesses for the x’
s. A simple way to obtain initialguesses is to assume that they are zero. Thesezeros can be substituted into x 1 equation tocalculate a new x 1 =b 1 /a 11 .
8/17/2019 Ch11 Gauss Siedel
11/22
Gauss-Siedel
• New x 1 is substituted to calculate x 2 and x 3. Theprocedure is repeated until the convergencecriterion is satisfied:
snew
i
old
i
new
iia
x
x x %100,
8/17/2019 Ch11 Gauss Siedel
12/22
Jacobi iteration Method
An alternative approach, called Jacobi iteration,
utilizes a somewhat different technique. This
technique includes computing a set of new x ’s on the
basis of a set of old x ’s. Thus, as the new values are
generated, they are not immediately used but are
retained for the next iteration.
8/17/2019 Ch11 Gauss Siedel
13/22
Gauss-Siedel
The Gauss-Seidel method The Jacobi iteration method
8/17/2019 Ch11 Gauss Siedel
14/22
Convergence Criterion for Gauss-Seidel Method
• The gauss-siedel method is similar to the technique offixed-point iteration.
• The Gauss-Seidel method has two fundamentalproblems as any iterative method:
1. It is sometimes non-convergent, and
2. If it converges, converges very slowly.• Sufficient conditions for convergence of two linear
equations, u(x,y) and v(x,y) are:
1
1
y
v
x
v
yu
xu
8/17/2019 Ch11 Gauss Siedel
15/22
Convergence Criterion for Gauss-SeidelMethod (cont ’ d)
• Similarly, in case of two simultaneous equations, theGauss-Seidel algorithm can be expressed as:
1 121 2 2
11 11
2 211 2 1
22 22
12
1 2 11
21
1 22 2
( , )
( , )
0
0
b au x x x
a a
b av x x x
a a
au u
x x a
av v
x a x
8/17/2019 Ch11 Gauss Siedel
16/22
Convergence Criterion for Gauss-SeidelMethod (cont ’ d)
Substitution into convergence criterion of two linearequations yield:
In other words, the absolute values of the slopes must beless than unity for convergence:
That is, the diagonal element must be greater than the off-diagonal element for each row.
1,122
21
11
12
a
a
a
a
2122
1211
aa
aan
i j j
jiii aa1
,
equationsnFor
8/17/2019 Ch11 Gauss Siedel
17/22
Gauss-Siedel Method- Example 1
10
x20 x304717
x30 x103193
x20 x10857
x
x
x
471
319
857
x
x
x
102030
307 10
20103
21
31
32
3
2
1
3
2
1
...
...
...
..
.
....
..
• Guess x1, x2, x3= zero for the first guessIter. x 1 x2 x3 | a,1 |(%) | a,2 | (%) | a,3 | (%)
0 0 0 0 - - -
1 2.6167 -2.7945 7.005610 100 100 1002 2.990557 -2.499625 7.000291 12.5 11.8 0.076
8/17/2019 Ch11 Gauss Siedel
18/22
Improvement of Convergence UsingRelaxation
• Where is a weighting factor that is assigned a
value between [0, 2]• If = 1 the method is unmodified.• If is between 0 and 1 (under relaxation) this is
employed to make a non convergent system toconverge.
• If is between 1 and 2 (over relaxation) this isemployed to accelerate the convergence.
1new new old i i i x x x
8/17/2019 Ch11 Gauss Siedel
19/22
Gauss-Siedel Method- Example 2
3862
3473
2028
321
321
321
x x x
x x x
x x x
1 2 3
1 2 3
1 2 3
8 2 20
2 6 38
3 7 34
x x x
x x x
x x x
Rearrange so thatthe equations are
diagonally dominant
8
22032
1
x x x
6
23831
2
x x x
7
33421
3
x x x
8/17/2019 Ch11 Gauss Siedel
20/22
Gauss-Siedel Method- Example 2
iteration unknown value a maximum a 0 x 1 0
x 2 0
x 3 0
1 x 1 2.5 100.00%x
2 7.166667 100.00%x
3 -2.7619 100.00% 100.00%
2 x 1 4.08631 38.82%x
2 8.155754 12.13%x
3 -1.94076 42.31% 42.31%
3 x 1 4.004659 2.04%x
2 7.99168 2.05%
x 3 -1.99919 2.92% 2.92%
8/17/2019 Ch11 Gauss Siedel
21/22
Gauss-Siedel Method- Example 2
The same computation can be developed with relaxation where = 1.2
First iteration:
Relaxation yields:
Relaxation yields:
Relaxation yields :
5.28
)0(20208
220 321
x x
x
3)0(2.0)5.2(2.11 x
1 32
38 2 38 2(3) 07.333333
6 6
x x x
8.8)0(2.0)333333.7(2.12
x
3142857.27
8.8)3(3347334 21
3
x x x
7771429.2)0(2.0)3142857.2(2.13 x
8/17/2019 Ch11 Gauss Siedel
22/22
Gauss-Siedel Method- Example 2
Iter. unknown value relaxation a maximum a 1 x 1 2.5 3 100.00%
x 2 7.3333333 8.8 100.00%
x 3 -2.314286 -2.777143 100.00% 100.000%
2 x 1 4.2942857 4.5531429 34.11%x
2 8.3139048 8.2166857 7.10%x
3 -1.731984 -1.522952 82.35% 82.353%
3 x 1 3.9078237 3.7787598 20.49%x
2 7.8467453 7.7727572 5.71%x
3 -2.12728 -2.248146 32.26% 32.257%
4 x 1 4.0336312 4.0846055 7.49%x
2 8.0695595 8.12892 4.38%x
3 -1.945323 -1.884759 19.28% 19.280%