Revision as of 00:05, 3 January 2012

The Jacobi method is an algorithm in linear algebra for determining the solutions of a system of linear equations with largest absolute values in each row and column dominated by the diagonal element. Each diagonal element is solved for, and an approximate value 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 German mathematician Carl Gustav Jakob Jacobi.

We seek the solution to set of linear equations:

In matrix terms, the definition of the Jacobi method can be expressed as :

where , , and represent the diagonal, lower triangular, and upper triangular parts of the coefficient matrix and is the iteration count. This matrix expression is mainly of academic interest, and is not used to program the method. Rather, an element-based approach is used:

Note that the computation of requires each element in except itself. Then, unlike in the Gauss-Seidel method, we can't overwrite with , as that value will be needed by the rest of the computation. This difference between the Jacobi and Gauss-Seidel methods complicates matters somewhat. Generally, two vectors of size will be needed, and a vector-to-vector copy will be required. If the form of is known (e.g. tridiagonal), then the additional storage should be avoidable with careful coding.

Convergence

The method will always converge if 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 this condition is not satisfied. It is necessary, however, that the diagonal terms in the matrix are greater (in magnitude) than the other terms.

Example Calculation

As with Gauss-Seidel, Jacobi iteration lends itself to situations in which we need not explicitly represent the matrix. Consider the simple heat equation problem

subject to the boundary conditions and . The exact solution to this problem is . The standard second-order finite difference discretization is

where is the (discrete) solution available at uniformly spaced nodes (see the Gauss-Seidel example for the matrix form). For any given for , we can write

Then, stepping through the solution vector from to , we can compute the next iterate from the two surrounding values. For a proper Jacobi iteration, we'll need to use values from the previous iteration on the right-hand side:

The following table gives the results of 10 iterations with 5 nodes (3 interior and 2 boundary) as well as norm error.