In numerical linear algebra, the Jacobi method (or Jacobi iterative method) is an algorithm for determining the solutions of a diagonally dominant system of linear equations. Each diagonal element is solved for, and an approximate value is plugged in. The process is then iterated until it converges. This algorithm is a stripped-down version of the Jacobi transformation method of matrix diagonalization. The method is named after Carl Gustav Jacob Jacobi.
Contents
Description
Let
be a square system of n linear equations, where:
Then A can be decomposed into a diagonal component D, and the remainder R:
The solution is then obtained iteratively via
where
The computation of xi(k+1) requires each element in x(k) except itself. Unlike the Gauss–Seidel method, we can't overwrite xi(k) with xi(k+1), as that value will be needed by the rest of the computation. The minimum amount of storage is two vectors of size n.
Algorithm
Input: initial guessConvergence
The standard convergence condition (for any iterative method) is when the spectral radius of the iteration matrix is less than 1:
A sufficient (but not necessary) condition for the method to converge is that the matrix A is strictly or irreducibly diagonally dominant. Strict row diagonal dominance means that for each row, the absolute value of the diagonal term is greater than the sum of absolute values of other terms:
The Jacobi method sometimes converges even if these conditions are not satisfied.
Example
A linear system of the form
We use the equation
we determine
Further,
With
The next iteration yields
This process is repeated until convergence (i.e., until
Another example
Suppose we are given the following linear system:
If we choose (0, 0, 0, 0) as the initial approximation, then the first approximate solution is given by
Using the approximations obtained, the iterative procedure is repeated until the desired accuracy has been reached. The following are the approximated solutions after five iterations.
The exact solution of the system is (1, 2, −1, 1).
An example using Python and Numpy
The following numerical procedure simply iterates to produce the solution vector.
Produces the output:
Weighted Jacobi method
The weighted Jacobi iteration uses a parameter
with
Recent developments
In 2014, a refinement of the algorithm, called scheduled relaxation Jacobi (SRJ) method, was published. The new method employs a schedule of over- and under-relaxations and provides performance improvements for solving elliptic equations discretized on large two- and three-dimensional Cartesian grids. The described algorithm applies the well-known technique of polynomial (Chebyshev) acceleration to a problem with a known spectrum distribution that can be classified either as a multi-step method or a one-step method with a non-diagonal preconditioner. However, none of them are Jacobi-like methods.
Improvements published in 2015.