Iterative Methods Jacobi and Gauss-Seidel

Iterative methods Jacobi and Gauss-Seidel in numerical analysis are based on the idea of successive approximations. This iterative method begins with one or two initial approximations of the roots, with a sequence of approximations x1, x2, x3, …, xk, …, as k → ∞, this sequence of roots converges to exact root 𝛼. For a system of equations Ax = B, we begin with an initial approximation of solution vector x = xo, by which we get a sequence of solution vector x1, x2, …, xk, … as k → ∞, this sequence converges to the solution x = A– 1B.

The general iterative formulas can be given as:

x k + 1 = Hxk ; k = 1, 2, 3, …

Where xk + 1 and xk are approximations for the exact root of Ax = B at (k + 1)th and kth iterations. H is an iteration matrix that depends on A and B.

Also, read Direct Method Gauss Elimination.

Convergence of Iterative Methods: The sequence of iterates {xk} is said to be converging to the exact root x, if

\(\begin{array}{l}\displaystyle \lim_{k \to \infty}\textbf{x}_{k}=\textbf{x}\:\:\:or\:\:\:\left| \textbf{x}_{f}-\textbf{x}\right|\leq\varepsilon \end{array} \)

Where 𝜀 is a very small positive quantity called error tolerance or error bound.

The criterion to terminate Iteration Process: As we cannot perform the iteration process infinitely, we need some criterion to stop the iteration; we may use one or both of the criteria:

  • The approximated root satisfies the given system of linear equations to a given accuracy.
  • The magnitude of the difference between two successive iterates is negligible or smaller than a given error bound 𝜀.

Jacobi Method

Jacobi method or Jacobian method is named after German mathematician Carl Gustav Jacob Jacobi (1804 – 1851). The main idea behind this method is,

For a system of linear equations:

a11x1 + a12x2 + … + a1nxn = b1

a21x1 + a22x2 + … + a2nxn = b2

an1x1 + an2x2 + … + annxn = bn

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

x1 = 1/a11 [b1 – a12x2 – a13x3 – … – a1nxn]

x2 = 1/a22 [b2 – a21x1 – a23x3 – … – a2nxn]

xn = 1/ann [bn – an1x1 – an3x3 – … – an n – 1xn – 1]

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.

Learn more about Jacobian method in matrix form.

Convergence of Approximations

The sufficient condition for the convergence of the approximations obtained by Jacobi method is that the system of equations is diagonally dominant, that is, the coefficient matrix A is diagonally dominant.

The matrix A is said to be diagonally dominant if |aii | ≥ ∑nj = 1 |aij | for i ≠ j. That means, the absolute value of of the diagonal element is greater than or equal to the sum of all elements of the corresponding row.

How to Decide Initial Approximations?

To initiate the iterative process, we must assume some initial approximation of the possible solution for the given system of equations. If the given system of equations are diagonally dominant, then any initial approximation will converge to the exact solution. Still, if no suitable approximations are not available, then we may take x(0) = 0 where xi(0) = 0 for all i. Then, the first approximation becomes xi = bi/aii for all i.

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 are 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.

Related Articles:

Solved Examples

Example 1:

Solve the system of equations using the Jacobi Method

26x1 + 2x2 + 2x3 = 12.6

3x1 + 27x2 + x3 = – 14.3

2x1 + 3x2 + 17x3 = 6.0

Obtain the result correct to three decimal places.

Solution:

First, check for the convergence of approximations,

26 > 2 + 2

27 > 3 + 1

17 > 2 + 3

Hence, the given system of equations are strongly diagonally dominant, which ensures the convergence of approximations. Let us take the initial approximation, x1(0) = 0, x2(0) = 0 and

x3(0) = 0

First Iteration:

x1(1) = 1/26[12.6 – 2 × 0 – 2 × 0 ] = 0.48462

x2(1) = 1/27[ – 14.3 – 3 × 0 – 1 × 0 ] = – 0.52963

x3(1) = 1/17[6 – 2 × 0 – 3 × 0] = 0.35294

Second Iteration:

x1(2) = 1/26[12.6 – 2 × (– 0.52963 + 0.35294)] = 0.49821

x2(2) = 1/27[ – 14.3 – 3 × 0.48462 – 1 × 0.35294] = – 0. 59655

x3(2) = 1/17[6 – 2 × 0.48462 – 3 ×(– 0.52963)] = 0.38939

Likewise there will be modification in approximation with each iteration.

kth iteration

0

1

2

3

4

5

x1

0.000

0.48462

0.49821

0.50006

0.50000

0.50001

x2

0.000

– 0.52963

– 0. 59655

– 0.59941

– 0.59999

– 0.60000

x3

0.000

0.35294

0.38939

0.39960

0.39989

0.40000

After the fifth iteration, we get |x1(5) – x1(4)| = |0.50001 – 0.50000| = 0.00001

|x2(5) – x2(4)| = | – 0.6 + 0.59999| = 0.00001

|x3(5) – x3(4)| = | 0.4 – 0.39989| = 0.00011

Since, all the errors in magnitude are less than 0.0005, the required solution is

x1 = 0.5, x2 = – 0.6, x3 = 0.4.

Example 2:

Solve the system of equations using the Gauss-Seidel Method

45x1 + 2x2 + 3x3 = 58

–3x1 + 22x2 + 2x3 = 47

5x1 + x2 + 20x3 = 67

Obtain the result correct to three decimal places.

Solution:

First, check for the convergence of approximations,

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, x1(0) = 0, x2(0) = 0 and

x3(0) = 0

First Iteration:

x1(1) = 1/45[58 – 2 × 0 – 3 × 0 ] = 1.28889

x2(1) = 1/22[ 47 + 3 × 1.28889 – 2 × 0 ] = 2.31212

x3(1) = 1/20[67 – 5 × 1.28889 – 1 × 2.31212] = 2.91217.

Second Iteration:

x1(2) = 1/45[58 – 2 × 2.31212 – 3 × 2.91217 ] = 0.99198

x2(2) = 1/22[ 47 + 3 × 0.99198 – 2 × 2.91217 ] = 2.00689

x3(2) = 1/20[67 – 5 × 0.99198 – 1 × 2.00689] = 3.00166.

Likewise there will be modification in approximation with each iteration.

kth iteration

0

1

2

3

4

x1

0.000

1.28889

0.99198

0.99958

1.0000

x2

0.000

2.31212

2.00689

1.99979

1.99999

x3

0.000

2.91217

3.00166

3.00012

3.00000

After the fourth iteration, we get |x1(4) – x1(3)| = |1.0000 – 0.99958| = 0.00042

|x2(4) – x2(3)| = |1.99999 + 1.99979| = 0.00020

|x3(4) – x3(3)| = | 3.0000 – 3.00012| = 0.00012

Since, all the errors in magnitude are less than 0.0005, the required solution is

x1 = 1.0, x2 = 1.99999, x3 = 3.0.

Rounding to three decimal places, we get x1 = 1.0, x2 = 2.0, x3 = 3.0.

Practice Problems

1. Solve the system of equations using both Jacobi and Gauss-Seidel Method

5x1 – 2x2 + 3x3 = –1

–3x1 + 9x2 + x3 = 2

2x1 – x2 – 7x3 = 3

Obtain the result correct to three decimal places.

2. Solve the system of equations

x1 – 5x2 = –4

7x1 – x2 = 6.

Frequently Asked Questions – FAQs

Q1

Is Gauss Jacobi method an iterative method?

Yes, Gauss Jacobi or Jacobi method is an iterative method for solving equations of diagonally dominant system of linear equations.

Q2

What is the difference between Jacobi and Gauss-Seidel method?

The only difference between Jacobi and Gauss-Seidel method is that, in Jacobi method the value of the variables is not modified until next iteration, whereas in Gauss-Seidel method the value of the variables are modified as soon as new value is evaluated.

Q3

Which iterative method is more efficient Jacobi method or Gauss-Seidel method?

Gauss-Seidel method is more efficient than Jacobi method as Gauss-Seidel method requires less number of iterations to converge to the actual solution with a certain degree of accuracy.

Q4

What is the disadvantage of Jacobi method?

The disadvantage of Jacobi method is that, even after the modified value of a variable is evaluated in the present iteration, it is not used until the next iteration. In other words, the value of all the variables which are used in current iteration are from the previous iteration, hence increase the number of iterations to reach the exact solution.

Comments

Leave a Comment

Your Mobile number and Email id will not be published.

*

*