4.8.20 · D4Numerical Methods

Exercises — Iterative methods — Jacobi, Gauss-Seidel, convergence

2,164 words10 min readBack to topic

Throughout, is the system, the -th guess, unless stated. We use the splitting from the parent note ( = diagonal, = strictly-lower part, = strictly-upper part).


L1 · Recognition

Exercise 1.1 — Read off , ,

Given write down , , and so that (remember is the strictly-lower part).

Recall Solution 1.1

WHAT we do: copy the diagonal into , the below-diagonal entries (negated) into , the above-diagonal entries (negated) into . Below-diagonal entries of are . Since 's strictly-lower part is , we set . Above-diagonal entries are , so . Check:

Exercise 1.2 — Is it strictly diagonally dominant?

For the same , decide whether it is strictly diagonally dominant (SDD): in every row.

Recall Solution 1.2
  • Row 1:
  • Row 2:
  • Row 3: ✓ All rows pass, so is SDD. By the parent's sufficient condition, both Jacobi and Gauss-Seidel converge for any start.

Exercise 1.3 — Match method to iteration matrix

State which method has iteration matrix and which has , and say in one sentence what physical difference the formulas encode.

Recall Solution 1.3

is Jacobi; is Gauss-Seidel. Difference: Jacobi inverts only (all old values used together); Gauss-Seidel inverts the whole lower-triangular , i.e. it absorbs the just-updated components into the same sweep.


L2 · Application

Exercise 2.1 — Two Jacobi sweeps

Solve by Jacobi, starting from . Report and to 4 decimals. (Exact solution is .)

Recall Solution 2.1

Jacobi rearranges each row for its own variable using only old values:

  • (from ): , . So .
  • (from ): , . So . Already bracketing .

Exercise 2.2 — Two Gauss-Seidel sweeps (same system)

Repeat Exercise 2.1 with Gauss-Seidel. Report and .

Recall Solution 2.2

Gauss-Seidel uses the fresh inside the -equation:

  • : ; then . So .
  • : ; then . So . Compare with Jacobi's : Gauss-Seidel is already within of the answer — visibly faster.

Exercise 2.3 — Compute a residual and decide to stop

Using the Gauss-Seidel iterate , compute the residual and its max-norm . With tolerance , do we stop?

Recall Solution 2.3

Recall = biggest absolute component = . Since , we do not stop yet — one more sweep is needed.


L3 · Analysis

Exercise 3.1 — Predict convergence by eigenvalues

For build , find its eigenvalues and , and state whether Jacobi converges and roughly how fast.

Recall Solution 3.1

, (off-diagonal entries of , since ). Why these eigenvalues (show the characteristic polynomial): for a matrix , set : So converges, and the error shrinks by a factor each sweep. Rate as digits per sweep: one decimal digit means dividing the error by ; each sweep multiplies by , so we need sweeps with , i.e. sweeps per digit.

Exercise 3.2 — A borderline non-SDD matrix

. First test SDD, then compute and decide whether Jacobi converges. Finally, give a genuinely non-SDD companion matrix that still converges, to see that SDD is only sufficient.

Recall Solution 3.2

SDD test on the given : Row 1: ✓; Row 2: ✓. So this is strictly diagonally dominant (barely, but strictly), and convergence is already guaranteed by the sufficient condition. Compute for the given : , so (the off-diagonal entries, negated per ). Characteristic polynomial: , so Hence Jacobi converges (error roughly halves per sweep), consistent with the SDD guarantee. Now the "sufficient not necessary" point. Take the genuinely non-SDD companion : Row 1 gives , so is not SDD. Its Jacobi matrix is , with and so converges even though SDD failed. That is the whole lesson of L3.

Exercise 3.3 — Forecast-then-verify a divergence

. Forecast from diagonal dominance, then compute to confirm, and give a one-row-swap fix.

Recall Solution 3.3

Forecast: Row 1: — badly non-dominant, likely diverges. (since ). Why these eigenvalues: , so Hence diverges.Fix: swap the two rows to get , which is SDD (, ) — now it converges.

The three L3 cases live on one picture. The teal and orange curves ( and ) collapse toward zero — that is convergence — while the plum curve () rockets upward off the plot: divergence. The dashed line marks error ; a method converges exactly when its bounding curve dives below and stays below it. This is the visual meaning of "."

Figure — Iterative methods — Jacobi, Gauss-Seidel, convergence

L4 · Synthesis

Exercise 4.1 — Compare Jacobi vs Gauss-Seidel spectral radii

For compute both and , and verify the model-problem relation .

Recall Solution 4.1

, , . Jacobi: . Why its eigenvalues: , so , giving . Gauss-Seidel: , . Why its eigenvalues: is upper-triangular, so its eigenvalues sit on the diagonal — and (formally ). Thus . Indeed ✓ — Gauss-Seidel converges twice as fast (in digit terms) here.

Exercise 4.2 — Build the update for a Gauss-Seidel sweep

For the SDD matrix of Exercise 1.1 with , perform one Gauss-Seidel sweep from . Report to 4 decimals.

Recall Solution 4.2

Rows: , , . Gauss-Seidel, in order, always using the newest available:

  • .
  • .
  • . So .

L5 · Mastery

Exercise 5.1 — Prove the error recurrence gives geometric decay

Let with fixed point . Show for any induced norm, and explain why is the sharp condition even when .

Recall Solution 5.1

Subtract the fixed-point equation from the iteration: Taking any induced (operator) norm and using sub-multiplicativity repeatedly: If this already forces . But can exceed while the iteration still converges: the sharp fact is (Gelfand's formula). Hence , independent of any single norm. The norm bound is a convenient sufficient handle; is the exact truth.

Exercise 5.2 — Design intuition for SOR

Successive Over-Relaxation (SOR — Successive Over-Relaxation) blends the old iterate with a Gauss-Seidel step: . For the model matrix of Exercise 4.1, Gauss-Seidel has . Argue qualitatively why a well-chosen ("over-relaxation") can beat , and state the range of that keeps SOR convergent for a symmetric positive-definite matrix.

Recall Solution 5.2

Why over-relax ()? Gauss-Seidel takes a "safe" step toward the solution. If the successive corrections keep pointing the same direction — which they do for smooth SPD problems, where the error is dominated by one slowly-decaying eigenvector — then each safe step is systematically too short. Multiplying the correction by extrapolates further along that consistent direction, so we cover the remaining distance in fewer sweeps. Setting recovers plain Gauss-Seidel; ("under-relaxation") shortens the step, useful only when Gauss-Seidel would overshoot. Convergence range (Ostrowski–Reich): for a symmetric positive-definite , the SOR iteration converges if and only if Outside that band the extrapolation overshoots so hard that and the error grows. Inside it there is a single optimal that minimises ; for the 2D model-Laplacian grid, as the mesh is refined, giving a dramatic speedup over Gauss-Seidel. Such large sparse systems are exactly where iterating beats Gaussian Elimination — see Finite Difference Methods for PDEs for their origin and Sparse Matrices for why the per-sweep cost stays near .


Recap

Recall Which is faster on the model matrix

, and by how much? Gauss-Seidel: vs Jacobi , so — twice as many correct digits per sweep.

Recall What is the exact necessary-and-sufficient convergence condition?

(spectral radius below one); SDD is only a sufficient shortcut.