# Successive over-relaxation method - SOR

(Difference between revisions)
Jump to: navigation, search
 Revision as of 20:44, 14 December 2005 (view source)Tsaad (Talk | contribs)m (Successive over-relaxation method moved to Successive over-relaxation method - SOR)← Older edit Latest revision as of 02:08, 19 December 2005 (view source)Jasond (Talk | contribs) (2 intermediate revisions not shown) Line 1: Line 1: - We seek the solution to set of linear equations:
+ == Introduction == - :$A \bullet X = Q$
+ We seek the solution to set of linear equations
- For the given matrix '''A''' and vectors '''X''' and '''Q'''.
+ :$A \phi = b.$
- In matrix terms, the definition of the SOR method can be expressed as :
+ - $+ - x^{(k)} = \left( {D - \omega L} \right)^{ - 1} \left( {\omega U + \left( {1 - \omega } \right)D} \right)x^{(k - 1)} + \omega \left( {D - \omega L} \right)^{ - 1} q + -$
+ - Where '''D''','''L''' and '''U''' represent the diagonal, lower triangular and upper triangular matrices of coefficient matrix '''A''' and k is iteration counter.
+ - $\omega$ is extrapolation factor.
+ - The pseudocode for the SOR algorithm:
+ In matrix terms, the successive over-relaxation (SOR) iteration can be expressed as - === Algorithm === + :$- ---- + \phi^{(k+1)} = \left( {D - \omega L} \right)^{ - 1} \left( {\omega U + \left( {1 - \omega } \right)D} \right)\phi^{(k)} + \omega \left( {D - \omega L} \right)^{ - 1} b - : Chose an intital guess [itex]X^{0}$ to the solution
+ [/itex] - :    for k := 1 step 1 untill convergence do
+ + where $D$, $L$, and $U$ represent the diagonal, lower triangular, and upper triangular parts of the coefficient matrix $A$, $k$ is the iteration count, and $\omega$ is a relaxation factor.  This matrix expression is not usually used to program the method, and an element-based expression is used: + + :$+ \phi^{(k+1)}_i = (1-\omega)\phi^{(k)}_i+\frac{\omega}{a_{ii}} \left(b_i - \sum_{ji}a_{ij}\phi^{(k)}_j\right),\, i=1,2,\ldots,n. +$ + + Note that for $\omega = 1$ that the iteration reduces to the [[Gauss-Seidel method| Gauss-Seidel]] iteration.  As with the [[Gauss-Seidel method]], the computation may be done in place, and the iteration is continued until the changes made by an iteration are below some tolerance. + + The choice of relaxation factor is not necessarily easy, and depends upon the properties of the coefficient matrix.  For symmetric, positive definite matrices it can be proven that $0<\omega<2$ will lead to convergence, but we are generally interested in faster convergence rather than just convergence. + + == Algorithm == + Chose an initial guess $\phi^{0}$ to the solution
+ :    for k := 1 step 1 until convergence do
::  for i := 1 step until n do
::  for i := 1 step until n do
:::  $\sigma = 0$
:::  $\sigma = 0$
:::  for j := 1 step until i-1 do
:::  for j := 1 step until i-1 do
- ::::      $\sigma = \sigma + a_{ij} x_j^{(k)}$ + ::::      $\sigma = \sigma + a_{ij} \phi_j^{(k)}$ :::    end (j-loop)
:::    end (j-loop)
:::  for j := i+1 step until n do
:::  for j := i+1 step until n do
- ::::      $\sigma = \sigma + a_{ij} x_j^{(k-1)}$ + ::::      $\sigma = \sigma + a_{ij} \phi_j^{(k-1)}$ :::    end (j-loop)
:::    end (j-loop)
- :::    $\sigma = {{\left( {q_i - \sigma } \right)} \over {a_{ii} }}$ + :::    $\sigma = {{\left( {b_i - \sigma } \right)} \over {a_{ii} }}$ - :::    $x_i^{(k)} = x_i^{(k - 1)} + \omega \left( {\sigma - x_i^{k - 1} } \right)$ + :::    $\phi_i^{(k)} = \phi_i^{(k - 1)} + \omega \left( {\sigma - \phi_i^{k - 1} } \right)$ ::  end (i-loop) ::  end (i-loop) ::  check if convergence is reached ::  check if convergence is reached :    end (k-loop) :    end (k-loop) - ---- - - ---- + ''TODO - add references, more about relaxation factor'' - Return to [[Numerical methods | Numerical Methods]] +

## Introduction

We seek the solution to set of linear equations

$A \phi = b.$

In matrix terms, the successive over-relaxation (SOR) iteration can be expressed as

$\phi^{(k+1)} = \left( {D - \omega L} \right)^{ - 1} \left( {\omega U + \left( {1 - \omega } \right)D} \right)\phi^{(k)} + \omega \left( {D - \omega L} \right)^{ - 1} b$

where $D$, $L$, and $U$ represent the diagonal, lower triangular, and upper triangular parts of the coefficient matrix $A$, $k$ is the iteration count, and $\omega$ is a relaxation factor. This matrix expression is not usually used to program the method, and an element-based expression is used:

$\phi^{(k+1)}_i = (1-\omega)\phi^{(k)}_i+\frac{\omega}{a_{ii}} \left(b_i - \sum_{ji}a_{ij}\phi^{(k)}_j\right),\, i=1,2,\ldots,n.$

Note that for $\omega = 1$ that the iteration reduces to the Gauss-Seidel iteration. As with the Gauss-Seidel method, the computation may be done in place, and the iteration is continued until the changes made by an iteration are below some tolerance.

The choice of relaxation factor is not necessarily easy, and depends upon the properties of the coefficient matrix. For symmetric, positive definite matrices it can be proven that $0<\omega<2$ will lead to convergence, but we are generally interested in faster convergence rather than just convergence.

## Algorithm

Chose an initial guess $\phi^{0}$ to the solution

for k := 1 step 1 until convergence do
for i := 1 step until n do
$\sigma = 0$
for j := 1 step until i-1 do
$\sigma = \sigma + a_{ij} \phi_j^{(k)}$
end (j-loop)
for j := i+1 step until n do
$\sigma = \sigma + a_{ij} \phi_j^{(k-1)}$
end (j-loop)
$\sigma = {{\left( {b_i - \sigma } \right)} \over {a_{ii} }}$
$\phi_i^{(k)} = \phi_i^{(k - 1)} + \omega \left( {\sigma - \phi_i^{k - 1} } \right)$
end (i-loop)
check if convergence is reached
end (k-loop)

TODO - add references, more about relaxation factor