gauss seidel calculator

Gauss-Seidel Method Solver

Enter a square coefficient matrix A, a constants vector b, and optional initial guess x₀. The calculator performs iterative updates until the tolerance is reached or max iterations are hit.

Tip: For best convergence, use a diagonally dominant matrix or reorder equations accordingly.

What is the Gauss-Seidel method?

The Gauss-Seidel method is an iterative numerical algorithm used to solve systems of linear equations of the form Ax = b. Instead of solving the whole system in one expensive matrix operation, it updates one variable at a time, reusing newly updated values immediately within each iteration.

This makes the method efficient for many large, sparse systems where direct techniques (like Gaussian elimination) can be slow or memory-heavy.

How this calculator works

1) Parse your system

The calculator reads matrix A and vector b, checks dimensional consistency, and validates numerical inputs.

2) Start from an initial estimate

You can provide an initial guess vector x₀. If omitted, the tool uses all zeros.

3) Iterate until convergence

At iteration k+1, each variable is updated using the latest available values:

xᵢ(k+1) = (bᵢ - Σj<iaᵢⱼxⱼ(k+1) - Σj>iaᵢⱼxⱼ(k)) / aᵢᵢ

Convergence is checked using the infinity norm of the update vector and the residual norm.

When Gauss-Seidel converges well

  • Strict diagonal dominance: Each diagonal element is larger than the sum of the off-diagonal absolute values in its row.
  • Symmetric positive definite systems: Common in engineering and physics simulations.
  • Reasonable initial guess: Not always required, but can reduce iteration count.

If your matrix is not diagonally dominant, convergence can still happen, but it may be slow or may fail altogether. This page shows a warning when dominance is not detected.

Practical tips

  • Use a tolerance like 1e-6 for most problems.
  • Increase max iterations for harder systems.
  • Watch both update error and residual; small update alone does not always guarantee an accurate solution.
  • If a diagonal value is zero, reorder equations or use pivoting before applying Gauss-Seidel.

Example system

The default values in this calculator correspond to a classic 4×4 system that converges to approximately:

  • x₁ = 1
  • x₂ = 2
  • x₃ = -1
  • x₄ = 1

Click Calculate to see each iteration and how quickly the method approaches the final answer.

🔗 Related Calculators