Gauss-Seidel Calculator
Solve a diagonally-dominant linear system iteratively using the Gauss-Seidel method.
About Gauss-Seidel Calculator
Gauss-Seidel walks through the equations one at a time and immediately reuses each value it has just computed within the same pass. That single change from Jacobi propagates corrections through the system far faster, typically halving the number of passes needed. The relaxation factor generalises the method: at 1.0 you get plain Gauss-Seidel, while values above 1.0 give successive over-relaxation, deliberately overshooting each update to accelerate convergence, and values below 1.0 under-relax to stabilise awkward systems. Optimal omega for a well-behaved system often lands between 1.2 and 1.8, but too large a value oscillates and diverges. The reported residual is the true measure of quality: how far the coefficient matrix times the solution still sits from the right-hand side.
Formulas
Gauss-Seidel update
x_i(target) = (d_i - sum of a_ij x_j using the newest available values) / a_ii
- newest available
- Values already refreshed in this pass are used immediately
Relaxation
x_i(new) = x_i(old) + omega x (x_i(target) - x_i(old))
- omega
- 1 = Gauss-Seidel, >1 = over-relaxation, <1 = under-relaxation
Residual
residual = max over rows of |(M x)_i - d_i|
Worked example
With the default values below, Gauss-Seidel Calculator returns x of 4.91071427. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Row 1: coefficient of x
- 4
- Row 1: coefficient of y
- -1
- Row 1: coefficient of z
- 0
- Row 1: right-hand side
- 15
- Row 2: coefficient of x
- -1
- Row 2: coefficient of y
- 4
- Row 2: coefficient of z
- -1
- Row 2: right-hand side
- 10
- Row 3: coefficient of x
- 0
- Row 3: coefficient of y
- -1
- Row 3: coefficient of z
- 4
- Row 3: right-hand side
- 10
- Relaxation factoraccepts 0.1–1.9
- 1
- Convergence tolerance
- 0.000001
- Maximum passesaccepts 1–5,000
- 200
Results
- x
- 4.91071427
- y
- 4.64285713
- z
- 3.66071428
- Iteration Outcome
- Settled after 10 passes
Step by step
- 1Values used
- 2Gauss-Seidel update
- 3Relaxation
- 4Residual
- 5x= 4.91071427
- 6y= 4.64285713
- 7z= 3.66071428
- 8Iteration Outcome= Settled after 10 passes
Assumptions and limits
- The result is derived only from the 15 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 8 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
What does the relaxation factor do?
It scales how far each variable moves toward its freshly computed target. At omega = 1 the variable jumps exactly there, which is classic Gauss-Seidel. Above 1 it overshoots deliberately, which often reaches the solution in noticeably fewer passes. Below 1 it moves cautiously, which can rescue a system that otherwise oscillates.
Why report a residual as well as a pass count?
The pass count only tells you the updates got small. A residual measures the thing you actually care about: how far the coefficient matrix times your solution still is from the right-hand side. Small updates with a large residual is the signature of a nearly singular system creeping along rather than converging.
Can over-relaxation make things worse?
Yes. Convergence for over-relaxation requires omega below 2, and in practice values much above the optimum cause the iteration to oscillate with growing amplitude. If the solution starts swinging, pull omega back toward 1.
