Iterative linear-system solver
Trace Jacobi or Gauss–Seidel iterations and inspect residual convergence.
A clear answer. Here’s how.
Starts from the zero vector and applies the chosen iteration without reordering rows. Diagonal entries must be non-zero at scale. Stops when max|Ax−b| meets the target or after 1–1,000 iterations; non-convergence is explicitly reported. Displays the first 100 iterates and states the final solution/residual. Convergence is not guaranteed; a small residual does not bound error for ill-conditioned matrices.
See a worked example
Worked example
A fixed demonstration, separate from the values you enter above.
- Matrix: one row per line
4, 1 1, 3
- Right-hand side vector
- 1, 2
- Iteration method
- Gauss–Seidel
- Maximum iterations
- 100
- Maximum absolute residual target
- 1e-8
Example result
| Iteration | Maximum absolute residual | X1 | X2 |
|---|---|---|---|
| 1 | 0.583333333333 | 0.25 | 0.583333333333 |
| 2 | 0.0486111111111 | 0.104166666667 | 0.631944444444 |
| 3 | 0.00405092592593 | 0.0920138888889 | 0.63599537037 |
| 4 | 0.000337577160494 | 0.0910011574074 | 0.636332947531 |
| 5 | 0.000028131430041 | 0.0909167631173 | 0.636361078961 |
Converged after 9 iterations. Final X=[0.0909090912790855, 0.6363636362403048]; residual 1.3566467949033267e-9. First 100 iterations are shown. A small residual alone does not bound solution error in an ill-conditioned system.