CFD Online Logo CFD Online URL
Home > Wiki > Jacobi method

Jacobi method

From CFD-Wiki

Revision as of 05:12, 15 September 2005 by Zxaar (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

We seek the solution to set of linear equations:

 A \bullet X = Q

For the given matrix A and vectors X and Q.
In matrix terms, the definition of the Jacobi method can be expressed as :
x^{(k)}  = D^{ - 1} \left( {L + U} \right)x^{(k - 1)}  + D^{ - 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.


Chose an intital guess X^{0} to the solution
for k := 1 step 1 untill convergence do
for i := 1 step until n do
 \sigma = 0
for j := 1 step until n do
if j != i then
 \sigma  = \sigma  + a_{ij} x_j^{(k-1)}
end if
end (j-loop)
  x_i^{(k)}  = {{\left( {q_i  - \sigma } \right)} \over {a_{ii} }}
end (i-loop)
check if convergence is reached
end (k-loop)

My wiki