2013/9/9
T O P I C : G A U S S - S E I D E L M E T H O D
GAUSS-SEIDEL METHOD
Adalah metode ITERASI
Prosedur dasar:
- Menyelesaikan tiap persamaan linier secara aljabar untuk xi - Membuat nilai asumsi solusi
- Selesaikan untuk tiap xi dan ulangi
- Gunakan perkiraan kesalahan relatif tiap akhir iterasi untuk mengecek apakah error sudah mencapai angka toleransi.
GAUSS-SEIDEL METHOD
Kenapa?
Untuk mengatasi round-off error (kesalahan pembulatan).
Metode eliminasi seperti Gaussian Elimination and LU Decomposition(*) rawan terhadap kesalahan pembulatan.
GAUSS-SEIDEL METHOD
Algorithm
Sistem persamaan linier
1 1 3 13 2 12 1 11
x
a
x
a
x
...
a
x
b
a
n n
2 3 23 2 22 1 21x
a
x
a
x
...
a
x
b
a
2n n
n n nn n n nx
a
x
a
x
a
x
b
a
1 1
2 2
3 3
...
. . . .. . Kita mengubah sistem
persamaan [A]{X}={B} untuk menyelesaikan x1
dengan persamaan
pertama, menyelesaikan x2 dengan persamaan kedua, dan seterusnya.
GAUSS-SEIDEL METHOD
Algorithm
General Form of each equation
11 1 1 1 1 1
a
x
a
c
x
n j j j j
22 2 1 2 2 2a
x
a
c
x
j n j j j
1 , 1 1 1 , 1 1 1
n n n n j j j j n n na
x
a
c
x
nn n n j j j nj n na
x
a
c
x
1MENJADI:
33 2 32 1 31 3 3 22 3 23 1 21 2 2 11 3 13 2 12 1 1a
x
a
x
a
b
x
a
x
a
x
a
b
x
a
x
a
x
a
b
x
Now we can start the solution process by
choosing guesses for the x’s. A simple way to
obtain initial guesses is to assume that they are
zero. These zeros can be substituted into
x
1equation to calculate a new x
1=b
1/a
11.
Untuk sistem
BATAS AKHIR ITERASI
New x1 is substituted to calculate x2 and x3. The procedure is repeated until the convergence criterion is satisfied:
kan diperkenan baru i lama i baru i i a
x
x
x
100
t a
approximation error, sering digunakan, seringkali disebut sebagai galat absolut.True error, kurang berarti. digunakan Relative error, dalam prosentase
GAUSS-SEIDEL METHOD: EXAMPLE 1
2
.
279
2
.
177
8
.
106
x
x
x
1
12
144
1
8
64
1
5
25
3 2 1Diketahui sistem persamaan
Initial Guess: asumsi nilai awal,
5
2
1
3 2 1x
x
x
GAUSS-SEIDEL METHOD: EXAMPLE 1
2 . 279 2 . 177 8 . 106 x x x 1 12 144 1 8 64 1 5 25 3 2 1Tulis ulang untuk aplikasi
Gauss-Seidel
25
5
8
.
106
2 3 1x
x
x
8
64
2
.
177
1 3 2x
x
x
1
12
144
2
.
279
1 2 3x
x
x
GAUSS-SEIDEL METHOD: EXAMPLE 1
Masukkan nilai perkiraan awal untuk selesaikan x
i
5
2
1
3 2 1x
x
x
6720
.
3
25
)
5
(
)
2
(
5
8
.
106
1
x
8510
.
7
8
5
6720
.
3
64
2
.
177
2
x
36
.
155
1
8510
.
7
12
6720
.
3
144
2
.
279
3
x
Initial GuessGAUSS-SEIDEL METHOD: EXAMPLE 1
36 . 155 8510 . 7 6720 . 3 3 2 1 a a a100
x
x
x
new i old i new i i a
% 76 . 72 100 x 6720 . 3 0000 . 1 6720 . 3 1 a % 47 . 125 100 x 8510 . 7 0000 . 2 8510 . 7 2 a % 22 . 103 100 x 36 . 155 0000 . 5 36 . 155 3 aFinding the absolute relative approximate error
At the end of the first iteration
The maximum absolute
relative approximate error is 125.47%
GAUSS-SEIDEL METHOD: EXAMPLE 1
36
.
155
8510
.
7
6720
.
3
3 2 1a
a
a
Iteration #2
Using
056
.
12
25
36
.
155
8510
.
7
5
8
.
106
1
a
882 . 54 8 36 . 155 056 . 12 64 2 . 177 2 a
34 . 798 1 882 . 54 12 056 . 12 144 2 . 279 3 a from iteration #1GAUSS-SEIDEL METHOD: EXAMPLE 1
Hitung “the absolute relative approximate error”
% 542 . 69 100 x 056 . 12 6720 . 3 056 . 12 1 a
% 695 . 85 100 x 882 . 54 8510 . 7 882 . 54 2 a
% 54 . 80 100 x 34 . 798 36 . 155 34 . 798 3 aAkhir iterasi kedua
34
.
798
882
.
54
056
.
12
3 2 1a
a
a
Galat absolut terbesar 85.695%
GAUSS-SEIDEL METHOD: EXAMPLE 1
Tersukan iterasi, kita dapatkan nilai berikut.
Iteration a 1 a2 a3 1 2 3 4 5 6 3.672 12.056 47.182 193.33 800.53 3322.6 72.767 67.542 74.448 75.595 75.850 75.907 -7.8510 -54.882 -255.51 -1093.4 -4577.2 -19049 125.47 85.695 78.521 76.632 76.112 75.971 -155.36 -798.34 -3448.9 -14440 -60072 -249580 103.22 80.540 76.852 76.116 75.962 75.931
%
1 a
% 2 a %
3 a
GAUSS-SEIDEL METHOD: PITFALL
Salahnya dimana?
Contoh tadi mengilustrasikan kemungkinan kesalahan pada Gauss-Siedel method: tidak semua sistem persamaan akan konvergen.
Is there a fix?
One class of system of equations always converges: One with a
diagonally dominant coefficient matrix.
Diagonally dominant: [A] in [A] [X] = [C] is diagonally dominant if:
n j j ija
a
i 1 ii
n i j j ij iia
a
1Untuk semua ‘i’ ; DAN Untuk minimal sebuah ‘i’
GAUSS-SEIDEL METHOD: PITFALL
1 16 123 1 43 45 34 81 . 5 2 A 129 33 96 5 53 23 56 34 124 ] [ BDiagonally dominant: Koefisien pada diagonal harus sama atau lebih besar dari jumlah semua koefisien pada baris itu, dan minimal satu baris harus memiliki diagonal yang lebih besar dari jumlah koefisien pada
baris itu.
GAUSS-SEIDEL METHOD: EXAMPLE 2
Sistem persamaan linier
1 5x -3x 12x1 2 3
28
3x
5x
x
1
2
3
76
13x
7x
3x
1
2
3
1
0
1
3 2 1x
x
x
Dengan asumsi nilai awal
Matriks Koefisien nya adalah
13
7
3
3
5
1
5
3
12
A
GAUSS-SEIDEL METHOD: EXAMPLE 2
13 7 3 3 5 1 5 3 12 ACek apakah matriks nya diagonally dominant
4
3
1
5
5
21 23 22
a
a
a
10
7
3
13
13
31 32 33
a
a
a
8
5
3
12
12
12 13 11
a
a
a
GAUSS-SEIDEL METHOD: EXAMPLE 2
76 28 1 13 7 3 3 5 1 5 3 12 3 2 1 a a a 1 0 1 3 2 1 x x xTulis ulang
12
5
3
1
2 3 1x
x
x
5
3
28
1 3 2x
x
x
13
7
3
76
1 2 3x
x
x
Asumsi nilai awal
50000 . 0 12 1 5 0 3 1 1 x
9000 . 4 5 1 3 5 . 0 28 2 x
0923 . 3 13 9000 . 4 7 50000 . 0 3 76 3 xGAUSS-SEIDEL METHOD: EXAMPLE 2
The absolute relative approximate error
%
662
.
67
100
50000
.
0
0000
.
1
50000
.
0
1 a
%
00
.
100
100
9000
.
4
0
9000
.
4
2 a
%
662
.
67
100
0923
.
3
0000
.
1
0923
.
3
3 a
GAUSS-SEIDEL METHOD: EXAMPLE 2
8118 . 3 7153 . 3 14679 . 0 3 2 1 x x x 0923 . 3 9000 . 4 5000 . 0 3 2 1 x x xSetelah iterasi #1
14679 . 0 12 0923 . 3 5 9000 . 4 3 1 1 x
7153 . 3 5 0923 . 3 3 14679 . 0 28 2 x
8118 . 3 13 7153 . 3 7 14679 . 0 3 76 3 xGAUSS-SEIDEL METHOD: EXAMPLE 2
Galat absolut dari Iterasi #2
% 62 . 240 100 14679 . 0 50000 . 0 14679 . 0 1 a
%
887
.
31
100
7153
.
3
9000
.
4
7153
.
3
2
a%
876
.
18
100
8118
.
3
0923
.
3
8118
.
3
3
aGalat absolut maksimum 240.62%
GAUSS-SEIDEL METHOD: EXAMPLE 2
Ulangi iterasi, didapatkan…
1 a 2 a
3 a
Iteration a1 a2 a3 1 2 3 4 5 6 0.50000 0.14679 0.74275 0.94675 0.99177 0.99919 67.662 240.62 80.23 21.547 4.5394 0.74260 4.900 3.7153 3.1644 3.0281 3.0034 3.0001 100.00 31.887 17.409 4.5012 0.82240 0.11000 3.0923 3.8118 3.9708 3.9971 4.0001 4.0001 67.662 18.876 4.0042 0.65798 0.07499 0.00000 4 3 1 3 2 1 x x x 0001 . 4 0001 . 3 99919 . 0 3 2 1 x x xLATIHAN
1 0 1 3 2 1 x x xSistem persamaan linier
76
13x
7x
3x
1
2
3
28
3x
5x
x
1
2
3
1
5x
-3x
12x
1
2
3
GAUSS-SEIDEL METHOD
13 7 3 3 5 1 5 3 12 AThe Gauss-Seidel Method can still be used
The coefficient matrix is not
diagonally dominant
5
3
12
3
5
1
13
7
3
A
But this is the same set of
equations used in example #2, which did converge.
If a system of linear equations is not diagonally dominant, check to see if rearranging the equations can form a diagonally dominant matrix.
GAUSS-SEIDEL METHOD
Not every system of equations can be rearranged to have a diagonally dominant coefficient matrix.
Observe the set of equations
3
3 2 1
x
x
x
9
4
3
2
x
1
x
2
x
3
9
7
2 3 1
x
x
x
Which equation(s) prevents this set of equation from having a diagonally dominant coefficient matrix?