Gauss–Seidel method
In numerical linear algebra, the Gauss–Seidel method, also known as the Liebmann method or the method of successive displacement, is an iterative method used to solve a linear system of equations. It is named after the German mathematicians Carl Friedrich Gauss and Philipp Ludwig von Seidel, and is similar to the Jacobi method. Though it can be applied to any matrix with non-zero elements on the diagonals, convergence is guaranteed if the matrix is either diagonally dominant, or symmetric and positive definite.
The procedure is generally continued until the changes made by an iteration are below some tolerance.
The computation of xi(k+1) uses only the elements of x(k+1) that have already been computed, and only the elements of x(k) that have yet to be advanced to iteration k+1. This means that, unlike the Jacobi method, only one storage vector is required as elements can be overwritten as they are computed, which can be advantageous for very large problems.
However, unlike the Jacobi method, the computations for each element cannot be done in parallel.[citation needed] Furthermore, the values at each iteration are dependent on the order of the original equations.
Output: φ
Choose an initial guess φ(0) to the solution
repeat until convergence
Gauss-Seidel is the same as SOR (successive over-relaxation) with ω = 1.
First of all, we have to choose : we can only guess. The better the guess, the quicker will perform the algorithm.
We suppose:
First of all, we have to choose : we can only guess. The better the guess, the quicker will perform the algorithm.
We suppose:
To make it clear let's consider an example.
The exact solution of the system is (1, 2, −1, 1).
Contents[hide] |
Description
Given a square system of n linear equations with unknown x:The procedure is generally continued until the changes made by an iteration are below some tolerance.
Discussion
The element-wise formula for the Gauss–Seidel method is extremely similar to that of the Jacobi method.The computation of xi(k+1) uses only the elements of x(k+1) that have already been computed, and only the elements of x(k) that have yet to be advanced to iteration k+1. This means that, unlike the Jacobi method, only one storage vector is required as elements can be overwritten as they are computed, which can be advantageous for very large problems.
However, unlike the Jacobi method, the computations for each element cannot be done in parallel.[citation needed] Furthermore, the values at each iteration are dependent on the order of the original equations.
Convergence
The convergence properties of the Gauss–Seidel method are dependent on the matrix A. Namely, the procedure is known to converge if either:- A is symmetric positive-definite, or
- A is strictly or irreducibly diagonally dominant.
Algorithm
Inputs: A , bOutput: φ
Choose an initial guess φ(0) to the solution
repeat until convergence
- for i from 1 until n do
- for j from 1 until i − 1 do
- end (j-loop)
- for j from i + 1 until n do
- end (j-loop)
- end (i-loop)
- check if convergence is reached
Gauss-Seidel is the same as SOR (successive over-relaxation) with ω = 1.
Examples
An example for the matrix version
A linear system shown as is given by:- and
- and
- and
- .
First of all, we have to choose : we can only guess. The better the guess, the quicker will perform the algorithm.
We suppose:
Another example for the matrix version
Another linear system shown as is given by:- and
- and
- and
- .
First of all, we have to choose : we can only guess. The better the guess, the quicker will perform the algorithm.
We suppose:
An example for the equation version
Suppose given k equations where xn are vectors of these equations and starting point x0. From the first equation solve for x1 in terms of For the next equations substitute the previous values of xs.To make it clear let's consider an example.
x1 | x2 | x3 | x4 |
---|---|---|---|
0.6 | 2.32727 | − 0.987273 | 0.878864 |
1.03018 | 2.03694 | − 1.01446 | 0.984341 |
1.00659 | 2.00356 | − 1.00253 | 0.998351 |
1.00086 | 2.0003 | − 1.00031 | 0.99985 |
See also
- Jacobi method
- Successive over-relaxation
- Iterative method. Linear systems
- Gaussian belief propagation
References
- Black, Noel and Moore, Shirley, "Gauss-Seidel Method" from MathWorld.
External links
- Gauss–Seidel from www.math-linux.com
- Module for Gauss–Seidel Iteration
- Gauss–Seidel From Holistic Numerical Methods Institute
- Gauss Siedel Iteration from www.geocities.com
- The Gauss-Seidel Method
- Bickson
- Matlab code
- C++ Sources - solving systems of linear algebraic equations (Gauss_Seidel_method).
|