Multigrid method
About this app
Solve the Laplace equation (Dirichlet) via multigrid: the error at each grid level as a stacked 3D wireframe relief. Smoothers (Jacobi/Gauss-Seidel) remove high frequencies, restriction/prolongation/coarse-grid solve the smooth remainder — V/W cycle step by step, with error history and a solution heatmap.
The idea behind multigrid
When solving the discretised Laplace equation −Δu = 0 with prescribed boundary values (a Dirichlet problem), simple iterations such as Jacobi or Gauss–Seidel remove high-frequency error components quickly but smooth components very slowly. Multigrid uses the fact that a smooth error looks oscillatory again on a coarser grid. It smooths on the fine grid, transfers the residual to a coarser grid (restriction), solves or smooths there, interpolates the correction back (prolongation) and smooths again. Applied recursively this gives V or W cycles whose convergence is nearly independent of grid size.
What the app shows
The problem is solved on the unit square with the 5-point difference stencil. The error e = u* − u is shown on every grid level as a wireframe relief, with the levels stacked, fine on top and coarse below. You can set the step size h (1/8, 1/16, 1/32), the smoother (Gauss–Seidel or damped Jacobi with ω = ⅔), the cycle (V, W or smoother only), the number of smoothing steps ν, vertical exaggeration and boundary values. Panels show the active level, ‖error‖₂, the reduction per cycle, the error history and the current solution as a heat map.
Try it yourself
Use “Step” to go through a V cycle one operation at a time and notice how smoothing makes the relief smooth but not smaller, and only the coarse-grid correction lowers it. Then compare “smoother only” with the V cycle in the error history: the plain smoother stalls, while the cycle cuts the error by a roughly constant factor per pass. Also try h = 1/32 and different boundary values.
Frequently asked questions
- How does a multigrid method work?
- It combines smoothing on the fine grid with a correction computed on a coarse grid. The smoother removes high-frequency errors, and the coarse grid handles the smooth components, which appear oscillatory there. The correction is interpolated back and smoothed again.
- What is the difference between a V-cycle and a W-cycle?
- A V cycle goes once from fine to coarse and back. A W cycle performs the coarse-grid correction twice on each coarse level, so the levels are visited more often. A W cycle costs more per pass but often reduces the error more.
- Why do Jacobi and Gauss–Seidel converge slowly on fine grids?
- They average locally with neighbouring points, which damps short-wavelength errors well. Smooth, long-wavelength errors barely change from point to point and are reduced only slightly per sweep. The finer the grid, the more error components are smooth in this sense.
- What can I adjust in the app?
- Grid spacing, smoother, cycle type, number of smoothing steps, relief exaggeration and four boundary value options. You step through single operations or whole cycles and watch the error history live.
Subject: Numerics
More from Numerics
A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps