Enter your system
Use a diagonally dominant matrix whenever possible for more reliable convergence.
Example data table
This example is already configured in the form. It is a diagonally dominant 4 × 4 system with exact solution [1, 2, -1, 1].
| Equation | Coefficients | Constant | Initial guess |
|---|---|---|---|
| 1 | 10x1 - x2 + 2x3 + 0x4 | 6 | [0, 0, 0, 0] |
| 2 | -x1 + 11x2 - x3 + 3x4 | 25 | [0, 0, 0, 0] |
| 3 | 2x1 - x2 + 10x3 - x4 | -11 | [0, 0, 0, 0] |
| 4 | 0x1 + 3x2 - x3 + 8x4 | 15 | [0, 0, 0, 0] |
Formula used
Jacobi iteration updates each variable using only the previous iteration values. The diagonal term stays in the denominator, and all off-diagonal terms use older estimates.
For each iteration, this calculator also reports three diagnostics:
- Maximum absolute error = max |x(k+1) - x(k)|
- Maximum relative error = max |x(k+1) - x(k)| / |x(k+1)|
- Maximum residual = max |b - Ax(k+1)|
If q is below 1, the row-sum test provides a sufficient convergence condition. Many practical systems also converge when diagonal dominance is strong.
How to use this calculator
- Choose a matrix size from 2 × 2 to 4 × 4.
- Enter the coefficient matrix A, constants vector b, and an initial guess.
- Set tolerance, maximum iterations, decimal places, and a stopping metric.
- Click Run Jacobi Iteration to generate the result section above the form.
- Review convergence status, solution values, residuals, and the iteration table.
- Use the CSV and PDF buttons to export the generated results.
- Inspect the Plotly graphs to see error decay and variable stabilization across iterations.
Frequently asked questions
1) What does Jacobi iteration solve?
It solves linear systems of equations by repeatedly updating variable estimates. Each new estimate uses only the previous iteration values, making the method simple and easy to parallelize.
2) Why is diagonal dominance important?
A strictly diagonally dominant matrix often makes Jacobi iteration converge more reliably. It is not the only convergence condition, but it is a very practical and useful check.
3) What stopping metric should I choose?
Relative error is usually the safest default because it scales with solution size. Residual is useful when you care about how well Ax matches b.
4) Why do I need an initial guess?
The initial guess starts the iteration process. Better guesses can reduce the number of steps, but many well-behaved systems still converge from simple zero vectors.
5) What does the residual measure?
The residual measures how closely the current estimate satisfies the original linear system. Smaller residuals mean the computed vector better fits the equations.
6) Can this tool handle singular systems?
No method can produce a stable unique solution from a singular system. This calculator requires non-zero diagonal entries and uses direct comparison only when a unique direct solution exists.
7) Why might Jacobi fail to converge?
Convergence can fail when the matrix structure is unfavorable, especially without diagonal dominance. Poor scaling or difficult coefficients may also slow progress or cause divergence.
8) When should I use Jacobi instead of direct elimination?
Jacobi is useful for iterative analysis, teaching, and some large sparse systems. Direct elimination is often faster for small dense systems when exact factorization is practical.