Jacobi Iterative Method
Jacobi Iterative Method
Jacobi Iterative Method
Jacobian method or Jacobi method is one the iterative methods for approximating the solution
of a system of n linear equations in n variables. The Jacobi iterative method is considered as an
iterative algorithm which is used for determining the solutions for the system of linear equations
in numerical linear algebra, which is diagonally dominant. In this method, an approximate value
is filled in for each diagonal element. Until it converges, the process is iterated. This algorithm
was first called the Jacobi transformation process of matrix diagonalization. Jacobi Method is
also known as the simultaneous displacement method.
To find the solution to this system of equations Ax = B, we assume that the system of equations
have a unique solution and there is no zero entry among the diagonal or pivot elements of the
coefficient matrix A.
Now, we shall begin to solve equation (1) for x1, equation (2) for x2 and so on equation (n) for xn,
we get
By making an initial guess for the solution x(0) = (x1(0), x2(0), …, xn(0)) and substituting these values
only to the right hand side of the above equations we get first approximations x(1) = (x1(1), x2(1), …,
xn(1)). Continuing this process iteratively we get sequence of approximations {x(k)} such that as k
→ ∞, this sequence converges to exact solution of the system of equation up to a given error
tolerance.
Jacobian Method Example 1:
Solve the system of equations using the Jacobi Method
Solution:
26 > 2 + 2
27 > 3 + 1
17 > 2 + 3
Hence, the given systems of equations are strongly diagonally dominant, which ensures the
convergence of approximations.
STEP 1: make coefficients of x1 in equation (1), x2, in equation (2) and x3 in equation (3) one,
STEP 2: make equation x1 x2, x3 subject of formula in equation 1, 2, 3 respectively
STEP 3: write the equations 1 to 3 to get the values of x1 x2, x3
12 .6− 2x2 - 2x 3
26 0 . 48− 0 . 077x 2−0. 077 x 3
x1 = =
−14 .3−3 x 1−x 3
27 −0 . 53− 0 .11x 1 − 0 .037x 3
x2 = =
6−2 x 1 −3 x 2
17 0 . 35− 0 .118x 1 +0 .176 x 2
x3 = =
First Iteration: Let us take the initial approximation, x1(0) = 0, x2(0) = 0 and x3(0) = 0
kth iteration 0 1 2 3 4 5
After the fifth iteration, we get |x1(5) – x1(4)| = |0.50001 – 0.50000| = 0.00001
Since, all the errors in magnitude are less than 0.0005, the required solution is
EXAMPLE 2
Solve the following system of linear equations using iterative Jacobi method.
4x1 + 2x2 – 2x3 = 0
x1 – 3x2 – x3 = 7
3x1 – x2 + 4x3 = 5
Solution:
Given,
4x1 + 2x2 – 2x3 = 0 (1)
x1 – 3x2 – x3 = 7 (2)
3x1 – x2 + 4x3 = 5 (3)
STEP 1: make coefficients of x1 in equation, x2, in equation (2) and x3 in equation (3) one,
STEP 2: make equation x1 x2, x3 subject of formula in equation 1, 2, 3 respectively
STEP 3: write the equations 1 to 3 to get the values of x1 x2, x3
0− 2x 2 + 2x3 1 1
0− x2 + x3
4 2 2
x1 = =
7−x 1 + x 3 7 1 1
− − x 1− x 3
−3 3 3 3
x2 = =
5−3 x 1 + x 2 5 3 1
− x 1+ x 2
4 4 4 4
x3 = =
First iteration; make the initial guess x1 = 0, x2 = 0, x3 = 0.
1 1
− (0 ) + (0 )
2 2
So, x1(1) = =0
7 1 1
− − (0 ) − (0 )
3 3 3
x2(1) = = – 2.3
5 3 1
− (0 )+ (0)=1. 25
4 4 4
x3(1) =
Second iteration; we now have x1 = 0, x2 = – 2.3, x3 = 1.25
Repeating,
1 1
− (-2. 3 ) + (1. 25 )
2 2
x1(2) = = 1.79
7 1 1
− − (0 ) − (1 .25 )
3 3 3
x2(2) = = – 2.75
5 3 1
− (0 )+ (-2.3 )
4 4 4
x3(2) = = 0.6667
Third iteration; we now have x1 = 1.79, x2 = – 2.75, x3 = 0.6667
1 1
− (-2. 75 ) + (0 .667 )
2 2
x1(3) = = 1.7083
7 1 1
− − (1 .79 ) − (0 . 6667 )
3 3 3
x2(3) = = – 1.95
5 3 1
− (1. 79 )+ (-2.75 )
4 4 4
x3(3) = = - 0.7812
it is not converging
GAUSS-SEIDEL METHOD
The Guass-Seidel method is a improvisation of the Jacobi method. This method is named after
mathematicians Carl Friedrich Gauss (1777–1855) and Philipp L. Seidel (1821–1896). This
modification often results in higher degree of accuracy within fewer iterations.
In Jacobi method the value of the variables is not modified until next iteration, whereas in Gauss-
Seidel method the value of the variables is modified as soon as new value is evaluated. For
instance, in Jacobi method the value of xi(k) is not modified until the (k + 1)th iteration but in
Gauss-Seidel method the value of xi(k) changes in in kth iteration only.
Example 2:
5x1 + x2 + 20x3 = 67
Solution:
45 > 2 + 3
22 > – 3 + 2
20 > 5 + 1
Hence, the given system of equations are strongly diagonally dominant, which ensures the
convergence of approximations. Let us take the initial approximation, x 1(0) = 0, x2(0) = 0 and x3(0) =
0
58− 2x 2 −3x3
45 1 .2889− 0. 044x 2− 0 . 0667x 3
So, x1 = =
47 +3 x1 −2 x 3
22 2 .1364 +0 .1364x 1 − 0 . 09091x 3
x2 = =
67−5 x1 −x 2
20 3 .35− 0 .25x 1 −0 .05 x 2
x3 = =
First iteration; make the initial guess x1 = 0, x2 = 0, x3 = 0.
kth iteration 0 1 2 3 4
After the fourth iteration, we get |x1(4) – x1(3)| = |1.0000 – 0.99958| = 0.00042
Since, all the errors in magnitude are less than 0.0005, the required solution is
Practice Problems
1. Solve the system of equations using both Jacobi and Gauss-Seidel Method
–3x1 + 9x2 + x3 = 2
2x1 – x2 – 7x3 = 3
Obtain the result correct to three decimal places.
x1 – 5x2 = –4
7x1 – x2 = 6.