Gauss-Seidel Calculator
Solve a two by two linear system by iterative substitution.
What it does
The Gauss-Seidel method solves a linear system by rearranging each equation for one unknown and iterating. Its defining feature is that it uses each newly computed value immediately in the following equation of the same sweep.
Millersville University numerical analysis notes introduce Gauss-Seidel alongside Jacobi and explain that iterative methods are especially useful for large sparse systems, such as those from differential equations and circuit analysis.
University of Minnesota numerical analysis notes describe how Jacobi updates can be serialised into Gauss-Seidel, and note that convergence is guaranteed for diagonally dominant matrices.
This tool handles a two by two system with a zero starting guess and a chosen number of iterations. It reports the current estimates of x and y.
For small systems a direct method such as Cramer's rule is usually simpler. Iteration matters most when the system is large.
How to use
- Enter the four matrix coefficients and two right side values.
- Use a diagonally dominant system for reliable convergence.
- Enter the number of iterations, up to 500.
- Read the x and y estimates in the main result.
- Compare with Cramer's rule for the exact answer.
- Increase the iteration count and watch the values settle.
Formula
- a11, a12, a21, a22
- Entries of the coefficient matrix.
- b1, b2
- Right hand side values.
- x, y
- Unknowns being approximated.
- iterations
- Number of sweeps through the equations.
The engine performs each sweep in order, so the new x is used when computing y. It starts from x = 0 and y = 0 and rejects a zero diagonal entry.
Worked example
Example: a diagonally dominant system
4x + y = 11 and x + 3y = 11 with 10 iterations.
- Rearrange the first equation: x = (11 - y) / 4.
- Rearrange the second: y = (11 - x) / 3.
- Starting from x = 0 and y = 0, the first sweep gives x = 2.75 and then y = (11 - 2.75)/3 = 2.75.
- The next sweep uses those updated values and moves closer to the exact solution.
- After 10 sweeps, x is about 2.00000000 and y about 3.00000000.
- The exact solution is x = 2 and y = 3.
Reference table
| Method | x after 10 steps | y after 10 steps |
|---|---|---|
| Gauss-Seidel | 2.00000000 | 3.00000000 |
| Jacobi | 1.99999196 | 2.99998794 |
| Exact | 2 | 3 |
Limits
- The tool handles 2 by 2 systems only.
- It uses a fixed zero starting guess.
- Convergence is not guaranteed for every system.
- Results are shown to eight decimal places.
Common mistakes
- Using a system that is not diagonally dominant and expecting convergence.
- Confusing this method with Jacobi, which uses old values throughout a sweep.
- Entering a zero diagonal entry.
- Assuming more iterations always improve accuracy if the method diverges.
- Comparing with a direct method without noting roundoff differences.
Try it yourself
Quick checks. Answers sit tucked under each question.
What makes Gauss-Seidel different from Jacobi?
It uses newly computed values immediately within the same sweep.
What system is the worked example?
4x + y = 11 and x + 3y = 11, with solution x = 2, y = 3.
When is convergence assured?
For diagonally dominant matrices.
Questions
What is Gauss-Seidel?
An iterative method for solving linear systems.
Why use it?
It is efficient for large sparse systems.
How does it differ from Jacobi?
It updates values in place rather than waiting for the next sweep.
Does it always converge?
No. Diagonal dominance is a common sufficient condition.
What is the starting guess?
Zero for both unknowns on this page.
Is it faster than a direct solver for 2 by 2?
Usually not. Direct methods are simpler for small systems.
Sources
- Millersville University, MATH 375 Jacobi and Gauss-Seidel Techniques
- University of Minnesota, Numerical Analysis Lecture Notes