Professional Documents
Culture Documents
Lecture Notes Chapter 3 Part 3
Lecture Notes Chapter 3 Part 3
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
Description
AIMS
This chapter is aimed to solve small numbers of linear algebraic equations by using
iterative methods involving Jacobi method and Gauss-Seidel method
EXPECTED OUTCOMES
1. Students should be able to solve linear algebraic equations by using Jacobi and
Gauss-Seidel methods
REFERENCES
1 Introduction
2 Jacobi Method
3 Gauss-Seidel Method
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
INTRODUCTION
Two Types
of Methods
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
JACOBI METHOD
Jacobi Methods Procedures
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
JACOBI METHOD (Cont.)
Jacobi Methods Procedures (Cont.)
n
aii
j 1, j i
aij
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
JACOBI METHOD (Cont.)
Jacobi Methods Procedures (Cont.)
a11
a11 a12 a13 x1 b1
b2 a21 x1 a23 x3
k
a a23 x2 b2
k
x2
k 1
21 a22
a22
a31 a32 a33 x3 b3
b3 a31 x1 a32 x2
k k
x3
k 1
a33
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
JACOBI METHOD (Cont.)
Jacobi Methods Procedures (Cont.)
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
JACOBI METHOD (Cont.)
Example 1
Use the Jacobi method to obtain the solution for.
8 x1 x2 x3 10
2 x1 x2 9 x3 2
x1 7 x2 2 x3 4
Use 4 decimal places in your computation and let xi 0, 0, 0 . Compute up to two
0 T
iterations and calculate the approximate percent relative error for each iteration.
Solution
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
JACOBI METHOD (Cont.)
Solution (Cont.)
10 x2 x3 10 0 0
0 0
1
x1 1.25
8 8
4 x1 2 x3 4 0 0
0 0
1
x2 0.5714
7 7
2 2 x1 x2 2 0 0
0 0
1
x3 0.2222
9 9
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
JACOBI METHOD (Cont.)
Solution (Cont.)
1 1 1
The approximate percent relative error for x1 , x2 , and x3 are
computed as follows:
1.25 0
a 100% 100%
x1
1.25
0.5714 0
a 100% 100%
x2
0.5714
0.2222 0
a 100% 100%
x3
0.2222
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
JACOBI METHOD (Cont.)
Solution (Cont.)
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
JACOBI METHOD (Cont.)
Solution (Cont.)
2 2 2
The approximate percent relative error for x1 , x2 , and x3 are computed as
follows:
1.3492 1.25
a 100% 7.35%
x1
1.3492
0.4563 0.5714
a 100% 25.22%
x2
0.4563
0.4365 0.2222
a 100% 49.10%
x3
0.4365
iterations and calculate the approximate percent relative error for each iteration and
compare the solution with the results obtain in Example 1.
Solution
Rearrange the equation to make the system diagonally dominant.
Step 1
8 1 1 x1 10 8 1 1 x1 10
2 1 9 x 2 R2 R3 1 7 2 x 4
2 2
1 7 2 x3 4 2 1 9 x3 2
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
GAUSS-SEIDEL METHOD (Cont.)
Solution (Cont.)
10 x2 x3
k k
x1
k 1
8
4 x1
k 1
2 x3
k
x2
k 1
7
2 2 x1
k 1
x2
k 1
x3
k 1
9
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
GAUSS-SEIDEL METHOD (Cont.)
Solution (Cont.)
10 x2 x3 10 0 0
0 0
1
x1 1.25
8 8
4 x1 2 x3 4 1.25 0
1 0
1
x2 0.3929
7 7
2 2 x1 x2 2 2 1.25 0.3929
1 1
x3 0.4563
1
9 9
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
GAUSS-SEIDEL METHOD (Cont.)
Solution (Cont.)
1 1 1
The approximate percent relative error for x1 , x2 , and x3 are
computed as follows:
1.25 0
a 100% 100%
x1
1.25
0.3929 0
a 100% 100%
x2
0.3929
0.4563 0
a 100% 100%
x3
0.4563
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
GAUSS-SEIDEL METHOD (Cont.)
Solution (Cont.)
2 10 x2 x3
1 1
10 0.3929 0.4563
x1 1.3562
8 8
4 x 2
2 x 1
4 1.3562 2 0.4563
x2 0.5081
2 1 3
7 7
2 2 x 2
x 2 2 2 1.3562 0.5081
x3 0.4671
2 1 2
9 9
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
GAUSS-SEIDEL METHOD (Cont.)
Solution (Cont.)
2 2 2
The approximate percent relative error for x1 , x2 , and x3 are computed as
follows:
1.3562 1.25
a 100% 7.83%
x1
1.3562
0.5081 0.3929
a 100% 22.67%
x2
0.5081
0.4671 0.4563
a 100% 2.31%
x3
0.4671
The solution that is obtained via Gauss-Seidel method converge faster compare
to Jacobi Method.
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
Conclusion
Method Formula
b1 a12 x2 a13 x3
k
Jacobi k 1
k
x1
a11
b2 a21 x1 a23 x3
k k
k 1
x2
a22
b3 a31 x1 a32 x2
k k
k 1
x3
a33
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449