Jacobi method
From CFD-Wiki
(Difference between revisions)
Line 28: | Line 28: | ||
'''Note''': The major difference between the Gauss-Seidel method and Jacobi method lies in the fact that for Jacobi method the values of solution of previous iteration (here k) are used, where as in Gauss-Seidel method the latest available values of solution vector '''X''' are used. <br> | '''Note''': The major difference between the Gauss-Seidel method and Jacobi method lies in the fact that for Jacobi method the values of solution of previous iteration (here k) are used, where as in Gauss-Seidel method the latest available values of solution vector '''X''' are used. <br> | ||
+ | |||
+ | |||
+ | ---- | ||
+ | <i> Return to [[Numerical methods | Numerical Methods]] </i> |
Revision as of 06:24, 3 October 2005
We seek the solution to set of linear equations:
For the given matrix A and vectors X and Q.
In matrix terms, the definition of the Jacobi method can be expressed as :
Where D,L and U represent the diagonal, lower triangular and upper triangular matrices of coefficient matrix A and k is iteration counter.
Algorithm
- Chose an intital guess to the solution
- for k := 1 step 1 untill convergence do
- for i := 1 step until n do
-
- for j := 1 step until n do
- if j != i then
- end if
- if j != i then
- end (j-loop)
-
- end (i-loop)
- check if convergence is reached
- for i := 1 step until n do
- end (k-loop)
Note: The major difference between the Gauss-Seidel method and Jacobi method lies in the fact that for Jacobi method the values of solution of previous iteration (here k) are used, where as in Gauss-Seidel method the latest available values of solution vector X are used.
Return to Numerical Methods