A1329 of 55
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

A13 · Lesson 29 · Multigrid

Why simple iterations stall on smooth errors, and how coarse grids fix it

Lessons 27 and 28 showed that Jacobi and conjugate gradients slow down as a grid is refined: the model problem needs millions of Jacobi sweeps or thousands of CG steps on a large grid. The reason is specific. Simple iterations remove rough, rapidly varying error almost at once, but smooth error barely moves, because each update only looks at its neighbors. Multigrid turns that weakness into a method: smooth error looks rough on a coarser grid, so solve for it there. The result solves the model problem in a fixed number of cycles whatever the grid size, with work proportional to the number of unknowns. The same idea, used as a preconditioner, makes CG converge in a handful of steps.

  • The curve shows how much one sweep of weighted Jacobi multiplies each Fourier mode of the error, against the mode's frequency θ (0 is smoothest, π roughest), for the 1D model problem.
  • With ω = 1 (plain Jacobi), the roughest mode isn't damped at all: its factor is −1.
  • With ω=23, every mode from θ = π/2 to π shrinks by at least a factor of 3 per sweep. The smooth modes near θ = 0 still barely shrink: that's the job left for the coarse grid.

Predict

A 2D model problem has a million unknowns (1000 × 1000). Roughly how many multigrid V-cycles gain 6 digits?

Name it

Smoothing

For the 1D model problem, weighted Jacobi multiplies the error mode with frequency θ by

g(θ)=1−2ωsin2⁡θ2.

The smooth modes, θ near 0, have g≈1−ωθ22, barely below 1. For the rough half, π2≤θ≤π, choosing ω=23 makes |g|≤13: a few sweeps make the error smooth, though not small. Gauss–Seidel smooths similarly.

The coarse-grid correction

Once the error e is smooth, it can be represented on a grid with twice the spacing. Compute the residual r=b−Au, restrict it to the coarse grid, solve Acec=rc there (where the problem is 2, 4 or 8 times smaller), interpolate ec back and add it to u. Modes that were smooth on the fine grid are only half as smooth on the coarse one, so the coarse grid's own smoothing handles them.

The V-cycle

Apply the idea recursively: smooth, restrict, recurse down to a tiny grid solved directly, then interpolate and smooth on the way back up. The work is a geometric series. In d dimensions each coarser grid has 2−d as many points, so a V-cycle costs about 11−2−d times the work on the finest grid: 2 in 1D, 43 in 2D, 87 in 3D. Each cycle cuts the error by a fixed factor, typically 0.1, so the total work is O(n).

Preconditioning

CG's steps grow as κ. A preconditioner M is an approximation to A that's cheap to solve with; CG applied to M−1A converges at a rate set by κ(M−1A). Common choices: the diagonal (Jacobi), incomplete Cholesky (Cholesky that drops fill), and one multigrid V-cycle, which makes κ(M−1A) bounded independent of the grid.

Worked example

For weighted Jacobi with ω=23 on the 1D model problem with h = 1/64, how fast are the roughest, the middle and the smoothest modes damped?

Show the solution
  1. The roughest mode, θ = π. g=1−43=−13
  2. The middle mode, θ = π/2. g=1−43⋅12=13
  3. The smoothest mode, θ = πh. g=1−43sin2⁡π128=0.9992
  4. What that means. Three sweeps cut every rough mode by at least 27, while the smoothest mode needs about 1250 sweeps just to fall by a factor of e.
  5. How multigrid uses it. That's the signature of every simple iteration on elliptic problems, and it's exactly what multigrid exploits: three sweeps, then hand the smooth remainder to the coarse grid.

Answer each sweep multiplies the roughest mode by −13, the middle mode by 13 and the smoothest by 0.9992.

Worked example

How much work does one V-cycle take on a 2D grid with 1024×1024 unknowns, with two smoothing sweeps on each level going down and coming up?

Show the solution
  1. The levels. They have 10242, 5122, 2562, … points, a quarter as many each time, down to a tiny grid.
  2. Sweeps on all levels. Four sweeps per level (two down, two up) cost 4(1+14+116+⋯)=4×43=5.3 fine-grid sweeps, plus residual and transfer work of the same order.
  3. The whole cycle. So a V-cycle costs about as much as 8 to 10 Jacobi sweeps on the fine grid, and gains about a digit.
  4. Compare with Jacobi. Six digits take some 60 sweep-equivalents, against the 2.9 million sweeps plain Jacobi would need on a grid this size.

Answer about 5.3 fine-grid sweeps plus transfers, roughly the cost of 8 to 10 Jacobi sweeps.

Worked example

Compare the number of iterations Jacobi, CG and multigrid need for 6 digits on the 2D model problem with N = 1000 points per side.

Show the solution
  1. Jacobi. ρ=cos⁡πh with h=11001, so the count is ln⁡10−6ln⁡ρ≈2.8×106 sweeps.
  2. CG's condition number. κ≈4(N+1)2π2 so κ=637.
  3. CG's steps. κ2ln⁡210−6≈4600
  4. Multigrid. About 6 V-cycles.
  5. Compare the work. Each step of each method costs O(n) work, so the counts compare total work directly, and only multigrid's count doesn't grow when N does.

Answer about 2.8×106 Jacobi sweeps, 4600 CG steps and 6 multigrid V-cycles.

Check

Weighted Jacobi on the 1D model problem with ω = 0.67.

(a)

What does one sweep multiply the mode with θ = 0.5π by?

Check

In d = 2 dimensions, each coarser grid has 2−d as many points. How many fine-grid sweeps' worth of smoothing does a V-cycle with one sweep per level cost?

Check

A V-cycle cuts the error by 0.2. How many cycles gain 6 digits?

Check

A preconditioner lowers the condition number from 10000 to 10. By about what factor does it cut CG's step count?

Check

A multigrid hierarchy halves an N×N grid until it's 4 × 4. With N = 1024, how many levels are there, counting both ends?

Check

Why do Jacobi and Gauss–Seidel need so many sweeps on fine grids?

Check

Weighted Jacobi on the 1D model problem, with θ written as t and ω as w.

Step 1

What factor multiplies the error mode with frequency θ?

Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.

Check

On the 1D model problem with N = 31 interior points, start with the error e=sin⁡πx+sin⁡31πx and apply 3 sweeps of weighted Jacobi with ω=23 to Ae=0: e←e+ω2(ei+1−2ei+ei−1), with zero ends. Set smooth and rough to the remaining amplitudes of the two modes (project onto each sine).

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Explain why

Why does a coarse grid solve the problem that slows simple iterations?

Practice

Keep practicing

7 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.