4.8.20 · D2Numerical Methods

Visual walkthrough — Iterative methods — Jacobi, Gauss-Seidel, convergence

2,218 words10 min readBack to topic

Step 0 — The words we will use (nothing assumed)

Before any formula, three plain ideas.

  • A system is just several straight-line equations that must all be true at once. Their meeting point is the true solution, which we name (the star means "the real answer we are hunting").
  • A guess is any point we propose as the answer. The little on top is a step counter, not a power — is our first guess, the next, and so on.
  • The error is the arrow that points from the true answer to our current guess. If that arrow shrinks to nothing, our guess has landed on the answer.

Look at the figure: the black dot is , the open dot is our guess, and the red arrow is the error . Everything below is one question: how does that red arrow change from step to step?


Step 1 — Rewrite the problem so "new" sits alone on the left

WHAT. We split into an easy part and a leftover part , so that , and we insist is a matrix we can cheaply undo (invert).

WHY. We cannot invert cheaply — that is the whole reason we abandoned Gaussian Elimination. But if is diagonal or triangular, "solving " is trivial. So we push all the hard stuff to the right side, where it multiplies an old guess we already have numbers for.

Start from the exact statement and substitute the split:

Reading term by term: is the part we can solve instantly; is the "coupling" we will feed with an old guess; is the fixed data vector. Now freeze the right side at the old guess and let the left side produce the new guess :

PICTURE. The figure shows the "conveyor belt": old guess enters the right box, gets multiplied by and nudged by , then is undone to spit out the new guess.


Step 2 — Name the single machine that does one step:

WHAT. Undo on both sides. That collapses one full step into a single multiply-and-shift.

WHY. We want to see the machine that turns any guess into the next guess, because studying that one machine tells us everything about the long run.

Term by term: is "undo the easy part"; is the iteration matrix — the fixed multiplier applied every step; is a constant offset that never changes. So every method (Jacobi, Gauss-Seidel, SOR) is the same shape:

PICTURE. The two boxes of Step 1 fuse into one labelled box , with a small constant added on.


Step 3 — Subtract the truth to watch the error, not the guess

WHAT. The true answer is a fixed point: feeding it in gives it back. So it obeys the same rule, .

WHY. The constant clutters things. If we subtract the truth's equation from the guess's equation, the cancels and we are left with a clean law for the error arrow alone.

The appeared identically in both rows, so it vanished. What remains is startlingly simple:

Each symbol: is next step's error arrow; is the same machine as before; is this step's error arrow. The error is fed through the identical machine .

PICTURE. Same box, but now the red error arrow goes in and a (hopefully shorter) red error arrow comes out.


Step 4 — Unroll: the error is applied times

WHAT. Apply the boxed law repeatedly, all the way back to the start.

WHY. We want a formula for the error at any step in terms of the initial error, so we can ask "does it die?"

Here means "apply the machine times" (an honest matrix power now). So the entire question of convergence becomes one question about a matrix power:

Does as , for every possible starting error ?

PICTURE. A chain of -boxes; the red error arrow gets shorter each box — or, if we are unlucky, longer.


Step 5 — Look at through its own natural directions (eigenvectors)

WHAT. A matrix multiply is hard to picture in general — it rotates and stretches. But every diagonalizable has special directions, called eigenvectors , along which it does nothing but stretch by a number (its eigenvalue): .

WHY. These are the tool for exactly this job. See Eigenvalues and Eigenvectors. Why eigenvectors and not, say, the raw matrix entries? Because along an eigen-direction, applying a hundred times is just multiplying by a hundred times — a scalar we understand completely. The tangled matrix becomes a bag of independent scalars.

Write the starting error as a combination of these directions (any vector can be, if the span the space):

The numbers say "how much of the error points along direction ." Now hit it with . Along each eigen-direction, just multiplies by , so multiplies by :

Each piece of the error is scaled by — a plain number raised to the -th power.

PICTURE. The error arrow drawn as a sum of two eigen-arrows; each is stretched by its own when acts.


Step 6 — When does die? The whole answer in one number

WHAT. Each component's fate is decided by . A number raised to higher and higher powers goes to zero iff its absolute value is below 1.

WHY. This is the heart. Look at three cases of one component (figure):

  • : . That piece of the error dies. ✓
  • : stays the same size forever. The error stalls — never converges. ✗
  • : blows up. The error explodes (diverges). ✗

For the whole error to vanish, every component must die. So we must have for all . The worst (largest) one is the bottleneck — and that largest absolute eigenvalue has a name.

And the speed: once the small components are gone, the error is dominated by the biggest , so each step shrinks the error by roughly the factor . Smaller ⇒ faster.

PICTURE. Three shrinking/steady/growing staircases of for the three cases.


Step 7 — The degenerate cases you must not skip

WHAT & WHY. The derivation assumed a few things. Here is what happens when they fail.

  • A zero diagonal entry, . Both methods divide by , so (Jacobi) or (Gauss-Seidel) is not invertible — Step 2 collapses. Fix: permute rows to put nonzeros on the diagonal before forming .
  • has a repeated eigenvalue and cannot be diagonalized. Step 5's clean split fails. The honest statement uses the Spectral Radius anyway: still holds (via the Jordan form, where a polynomial-times- factor still dies whenever ). So the boxed result survives.
  • Boundary . The error neither dies nor grows in the worst direction — the iteration does not converge (it may cycle or drift). This case belongs firmly on the "fail" side.
  • Non-strictly-dominant matrices. Strict diagonal dominance is only a sufficient shortcut. A matrix can flunk it yet still have and converge. The eigenvalue test is the true judge.

PICTURE. A flowchart-style figure: check → form → measure → verdict.


Step 8 — Watch it on a real matrix (numbers you can check)

WHAT. Take , the classic 1-D finite-difference block from a sparse PDE grid.

Split: , and , so the Jacobi machine is

Its eigenvalues: the inner matrix swaps components, so its eigenvalues are ; halving gives . Therefore

Contrast with the parent's diverging example : there , so the red error arrow grows — exactly the "explode" staircase of Step 6.


The one-picture summary

Everything on this page in one frame: the split makes the machine (Step 2); subtracting the truth turns the guess-law into the error-law (Step 3); unrolling gives (Step 4); eigen-directions turn the matrix power into scalars (Step 5); and those scalars die exactly when the biggest, , is under 1 (Step 6).

Recall Feynman retelling — say it like a story

We have a true answer sitting somewhere, and a guess with a red arrow pointing from the answer to the guess. We built a machine, , that takes any guess and makes a new one. Because the true answer stays put when fed through the machine, subtracting it shows the arrow obeys the same machine: each step, the red arrow gets sent through . Do that times and the arrow has been through exactly times. Now the trick: every machine has favorite directions where it only stretches, by a factor . Split the arrow into those directions; along each one, steps just means multiplying by that many times. A number below 1, multiplied by itself forever, fades to zero; a number above 1 explodes; a number equal to 1 sits there stubbornly. The arrow vanishes only if every one of its pieces fades — so the biggest stretch factor, , must be under 1. That single number decides both whether we win and how fast.

Recall Rapid self-check

Why does the constant vanish in the error law? ::: The true solution obeys ; subtracting it from the guess equation cancels . Convergence iff which single number is below 1? ::: , the spectral radius (largest ). What is the approximate per-step error shrink factor? ::: itself. What must you fix before even exists? ::: A zero diagonal entry — permute rows so is invertible.


Parent: 4.8.20 Iterative methods — Jacobi, Gauss-Seidel, convergence (Hinglish)