Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Jacobi Method

5𝑥 − 2𝑦 + 3𝑧 = −1
−3𝑥 + 9𝑦 + 𝑧 = 2
2𝑥 − 𝑦 − 7𝑧 = 3

𝑥 = 0; 𝑦 = 0; 𝑧 = 0
5 −2 3
[−3 9 1]
2 −1 −7

−1 2 3
𝑥= + 𝑦− 𝑧
5 5 5
2 3 1
𝑦= + 𝑥− 𝑧
9 9 9
−3 2 1
𝑧= + 𝑥− 𝑦
7 7 7
Error <= 10%
𝑥𝑐𝑢𝑟𝑟𝑒𝑛𝑡 − 𝑥𝑝𝑟𝑒𝑣
𝜀=| | × 100%
𝑥𝑐𝑢𝑟𝑟𝑒𝑛𝑡

i x y z(A) ɛx ɛy ɛz
0 0 0 0
1 -0.2 0.2222 -0.4286 100 100 100
2 0.1460 0.2032 -0.5175 236.99 9.35 17.18
3 0.1918 0.3284 -0.4159 23.88 38.12 24.43
4 0.1809 0.3324 -0.4207 6.03 1.20 1.14
5
6

Gauss-Seidel

i x y z(A) ɛx ɛy ɛz
0 0 0 0
1 -0.2 0.1556 -0.5079 100 100 100
2 0.1670 0.3343 -0.4286 219.76 53.45 18.5
3 0.1909 0.3335 -0.4218 12.52 0.24 1.61
4 0.1865 0.3313 -0.4226 2.36 0.66 0.19
5
1. Check the system if it is diagonally dominant.
2. If not, do pivoting – partial or complete.
3. Assume initial values for the unknowns.
4. Rewrite the equations such that only one of the unknowns will be left on the left-hand side.
5. Compute the values of each unknown using the assumed values. For convention, our values
should be up to 4 decimal places.
a. Jacobi – compute each unknown using the approximated values of the previous
iteration
b. Gauss-Seidel – compute each unknown using the updated approximated values.
6. Compute the percentage difference error between the current and previous values of the
unknowns. (error has to be less than or equal to 10%)

You might also like