Skip to main content

27  Multigrid Methods

A local iteration can quickly remove oscillations from an error while barely changing a smooth error. A coarse grid represents that smooth part with fewer unknowns. Multigrid combines the inexpensive local updates with corrections computed on successively coarser grids. We first analyze the updates, then derive the equation that the coarse correction must solve.

27.1 Oscillating Error and the Smoothing Property

Weighted Jacobi and Gauss–Seidel converge slowly as stand-alone solvers because smooth error components decay slowly. Their value as smoothers is that they reduce oscillatory error in a few sweeps. Unweighted Jacobi has a high-frequency exception, derived below. A Fourier analysis of the error makes this asymmetry precise, and multigrid is built on it. The smoother removes the oscillatory error components, and the remaining smooth error is passed to a coarser grid, where it becomes oscillatory and cheap to resolve.

Frequency-Dependent Error Decay in Jacobi Iteration For the 1D model problem, the Jacobi update reads \[ \begin{align} x_i^{(k+1)} = \tfrac{1}{2}\bigl(x_{i-1}^{(k)} + x_{i+1}^{(k)}\bigr) + \tfrac{1}{2}b_i. \end{align} \] Each new value is the average of its two neighbors plus a source term. Consider two extreme error profiles at some iteration:

  • Oscillatory error: neighboring values often have opposite signs, so averaging damps many high-frequency modes rapidly. The exact alternating mode is an exception for unweighted Jacobi: its sign flips without shrinking. Weighted Jacobi or Gauss–Seidel supplies the smoothing used in multigrid.

  • Smooth error (\(e_i \propto \sin(ij\pi h)\) for small mode index \(j\)): neighbors of node \(i\) carry nearly the same value as \(e_i\) itself, so their average barely moves things. The error barely changes per sweep.

Jacobi acts as a local averaging filter that pulls each value toward the mean of its neighbors. Oscillations cancel in that average, whereas smooth trends do not. Starting from a random initial guess, the error spans all frequencies. With weighted Jacobi or Gauss–Seidel, the oscillatory error is reduced first. The remaining smooth error motivates a correction on a coarser grid. Error and residual have different spectral weights, so both should be interpreted through the operator.

WarningExercise

(Observing oscillating error) Set \(n = 63\), \(\bb = \bzero\), and \(\bx^* = \bzero\), so the error equals the iterate exactly. Run Jacobi and Gauss–Seidel from the same random initial vector \(\bx^{(0)} \sim \mathcal{N}(0, \bI)\).

  1. Plot the error profile \(\be^{(k)} = \bx^{(k)}\) at iterations \(k = 0, 1, 3, 10, 20\). Describe how the spectral composition of the error changes. Observe the behavior of the high-frequency components.

  2. Decompose \(\be^{(k)}\) into Fourier mode amplitudes \(\hat{e}_j^{(k)} = \langle \be^{(k)}, \phi^{(j)}\rangle / \|\phi^{(j)}\|^2\) and plot \(|\hat{e}_j^{(k)}|\) vs. \(j\) at the same iterations. Which modes decay fast, which persist?

  3. The Jacobi iteration matrix has eigenvalues \(\mu_j = \cos(j\pi h)\). Use this to predict the amplitude of mode \(j\) after \(k\) sweeps as a function of the initial amplitude \(|\hat{e}_j^{(0)}|\). Does your plot match the prediction?

  4. After 20 sweeps, what does the remaining error look like? Argue, using the eigenvalue formula, why no fine-grid iteration alone can efficiently eliminate it, necessitating a coarse-grid correction.

NoteDefinition: Fourier Modes on a Uniform Grid

Consider the 1D model problem with the \(n \times n\) tridiagonal matrix \(\bA\) having \(2\) on the main diagonal and \(-1\) on the off-diagonals (the finite-difference discretization of \(-u'' = f\) on \([0,1]\) scaled by \(h^2\)). Let \(h = 1/(n+1)\). For the nested grids below take \(n=2m+1\). The Fourier modes are the vectors \[ \begin{align} \phi^{(k)}_j = \sin(kj\pi h), \quad j = 1,...,n, \quad k = 1,...,n. \end{align} \] These form an orthogonal basis for \(\fR^n\) (by discrete sine orthogonality) and diagonalize \(\bA\): \[ \begin{align} \bA\phi^{(k)} = \lambda_k\,\phi^{(k)}, \qquad \lambda_k = 2 - 2\cos(k\pi h) = 4\sin^2\!\Bigl(\frac{k\pi h}{2}\Bigr). \end{align} \] Small \(k\) yields long-wavelength (smooth) modes, while large \(k\) yields short-wavelength (oscillatory) modes.

NoteTheorem: Eigenvalues of the Jacobi Iteration Matrix

For the 1D model problem, the Jacobi iteration matrix \(\bT_J = \bI - \tfrac{1}{2}\bA\) has eigenvalues \[ \begin{align} \mu_k = \cos(k\pi h), \quad k = 1, ..., n, \end{align} \] with eigenvectors \(\phi^{(k)}\). After \(\nu\) Jacobi sweeps, mode \(k\) of the error is scaled by \(\mu_k^\nu = \cos^\nu(k\pi h)\).

Since \(\bD = 2\bI\), the Jacobi iteration matrix is \(\bT_J = \bI - \frac{1}{2}\bA\). Applying \(\bT_J\) to the eigenvector \(\phi^{(k)}\): \[ \begin{align} \bT_J\phi^{(k)} &= \left(\bI - \frac{1}{2}\bA\right)\phi^{(k)} = \phi^{(k)} - \frac{1}{2}\bA\phi^{(k)} \\ &= \phi^{(k)} - \frac{1}{2}\lambda_k\phi^{(k)} = \left(1 - \frac{\lambda_k}{2}\right)\phi^{(k)}. \end{align} \] This calculation uses a general fact: if \(\bA\bv=\lambda\bv\), then \((\bI-c\bA)\bv=(1-c\lambda)\bv\). The eigenvector is unchanged, and only its eigenvalue changes. Here \(c=1/2\).

Substituting \(\lambda_k = 2 - 2\cos(k\pi h)\) yields \[ \begin{align} 1 - \frac{\lambda_k}{2} = 1 - (1 - \cos(k\pi h)) = \cos(k\pi h). \end{align} \] For an initial error \(\be^{(0)}=\sum_k c_k\phi^{(k)}\), applying the iteration \(\nu\) times gives \(\be^{(\nu)}=\sum_k c_k\mu_k^\nu\phi^{(k)}\). This follows by applying the matrix to each basis vector separately and using linearity. It justifies the statement about each mode after repeated sweeps.

Therefore \(\bT_J\phi^{(k)} = \cos(k\pi h)\phi^{(k)}\).

NoteDefinition: Low- and High-Frequency Modes

With respect to a grid of mesh size \(h = 1/(n+1)\), partition the \(n\) Fourier modes by frequency:

  • Low-frequency (smooth) modes: \(k = 1, ..., \lfloor n/2 \rfloor\), where \(k\pi h \in (0, \pi/2)\). These satisfy \(\mu_k = \cos(k\pi h) \in (0,1)\), and for small \(k\), \(\mu_k \approx 1 - (k\pi h)^2/2 \approx 1\), so these modes decay slowly.

  • High-frequency (oscillatory) modes: \(k = \lfloor n/2 \rfloor + 1, ..., n\), where \(k\pi h \in [\pi/2, \pi)\).

TipRemark

Standard Jacobi (\(\omega = 1\)) is a poor smoother, because the highest-frequency mode (\(k = n\)) satisfies \(\mu_n = \cos(n\pi h) = \cos(\pi n/(n+1)) \approx -1\), so the iterate oscillates in sign rather than decaying. Weighted (damped) Jacobi with \(\omega = 2/3\) fixes this by controlling the entire high-frequency band.

NoteDefinition: Weighted Jacobi Iteration

The weighted Jacobi method introduces a damping parameter \(\omega \in (0,1)\): \[ \begin{align} \bx^{(k+1)} = \bx^{(k)} + \omega\bD^{-1}\bigl(\bb - \bA\bx^{(k)}\bigr), \end{align} \] with iteration matrix \(\bT_\omega = \bI - \omega\bD^{-1}\bA\) and eigenvalues \[ \begin{align} \mu_k(\omega) = 1 - \omega(1 - \cos(k\pi h)). \end{align} \] The standard multigrid choice is \(\omega = 2/3\).

NoteTheorem: Smoothing Property of Weighted Jacobi

For the 1D model problem with \(\omega = 2/3\), the smoothing factor \[ \begin{align} \bar{\mu} = \max_{\lfloor n/2\rfloor < k \leq n}\,|\mu_k(2/3)| \leq \frac{1}{3}. \end{align} \] That is, every high-frequency component of the error is reduced by at least \(2/3\) in a single weighted Jacobi step.

The weighted Jacobi error matrix is \[ \begin{align} \bT_\omega=\bI-\omega\bD^{-1}\bA. \end{align} \] For this matrix \(\bD=2\bI\). A sine mode of index \(k\) has eigenvalue \(2-2\cos(k\pi h)\) under \(\bA\). Substituting it into the error matrix gives its amplification factor \[ \begin{align} \mu_k(\omega) &=1-\tfrac\omega2[2-2\cos(k\pi h)]\\ &=1-\omega+\omega\cos(k\pi h). \end{align} \] For \(\omega=2/3\), this is \(1/3+(2/3)\cos(k\pi h)\).

Because \(n=2m+1\) and \(h=1/(n+1)\), a high-frequency index satisfies \(k\geq m+1\). Hence \(k\pi h\in[\pi/2,\pi)\) and \(-1<\cos(k\pi h)\leq0\). It follows that \[ \begin{align} -\tfrac13<\mu_k(2/3)\leq\tfrac13, \qquad |\mu_k(2/3)|\leq\tfrac13. \end{align} \] After \(\nu\) sweeps, the coefficient of this mode is multiplied by \(\mu_k(2/3)^\nu\), whose magnitude is at most \(3^{-\nu}\). The sine modes form an orthogonal basis, so the same norm contraction holds for any combination restricted to this high-frequency band. No such bound is being asserted here for the low-frequency band.

TipRemark

After \(\nu\) weighted Jacobi sweeps, every high-frequency error component is reduced by \((1/3)^\nu\). The remaining error is dominated by smooth modes, which are nearly constant on the scale of \(h\). This smooth, slowly-varying error is the target of the coarse-grid correction in multigrid.

NoteExample

Eigenvalue spectrum of \(\bT_{2/3}\) for \(n = 15\), \(h = 1/16\).

The eigenvalues \(\mu_k = 1 - \tfrac{2}{3}(1 - \cos(k\pi/16))\) for selected \(k\):

  • \(k = 1\) (smoothest): \(\mu_1 \approx 0.981\) (minimal decay per sweep).

  • \(k = 4\): \(\mu_4 = 1 - \tfrac{2}{3}(1 - \cos(\pi/4)) \approx 0.804\) (slow decay).

  • \(k = 8\): \(\mu_8 = 1 - \tfrac{2}{3}(1 - \cos(\pi/2)) = 1/3 \approx 0.333\).

  • \(k = 12\): \(\mu_{12} = 1 - \tfrac{2}{3}(1 - \cos(3\pi/4)) \approx -0.138\) (rapid decay).

  • \(k = 15\) (most oscillatory): \(\mu_{15} \approx -0.330\) (magnitude bounded by \(1/3\)).

Modes \(k \geq 8\) all satisfy \(|\mu_k| \leq 1/3\), confirming the smoothing property. Modes \(k \leq 7\) range from \(0.63\) to \(0.98\) and are essentially untouched by the smoother.

27.2 The Two-Grid Correction Scheme

A smooth error on a fine grid of mesh size \(h\) looks oscillatory on a coarser grid of mesh size \(2h\). More precisely, the smooth fine-grid modes (\(k < n/2\)) oscillate at wavelength \(> 2h\) and are well-represented on the coarse grid. Once the high-frequency components have been attenuated by the smoother, the remaining error lives in a low-dimensional smooth subspace that a direct solve on a coarse grid of size \(n/2\) can eliminate efficiently.

NoteDefinition: Prolongation Operator

The prolongation (or interpolation) operator \(\bP: \fR^{m} \to \fR^{n}\) (where \(m = (n-1)/2\) for grids satisfying \(n = 2m+1\)) transfers a coarse-grid vector to the fine grid by linear interpolation. For a coarse-grid vector \(\bv \in \fR^m\), the fine-grid vector \(\bP\bv \in \fR^n\) is defined by \[ \begin{align} (\bP\bv)_{2j} = v_j, \qquad (\bP\bv)_{2j-1} = \tfrac{1}{2}(v_{j-1} + v_j), \quad j = 1, ..., m, \end{align} \] with boundary conventions \(v_0 = v_{m+1} = 0\) and the final midpoint value \((\bP\bv)_{2m+1}=v_m/2\). In matrix form, \(\bP\) is \(n \times m\) with entries \(1\) at coarse-grid points and \(\tfrac{1}{2}\) weights at fine-grid midpoints.

NoteDefinition: Restriction Operator

The restriction operator \(\bR: \fR^{n} \to \fR^{m}\) transfers a fine-grid vector to the coarse grid. The standard full-weighting restriction averages each coarse point with its fine-grid neighbors: \[ \begin{align} (\bR\bw)_j = \tfrac{1}{4}w_{2j-1} + \tfrac{1}{2}w_{2j} + \tfrac{1}{4}w_{2j+1}, \quad j = 1, ..., m. \end{align} \] In matrix form, \(\bR = \tfrac{1}{2}\bP^T\). This choice ensures that the Galerkin coarse-grid operator \(\bA_c = \bR\bA\bP\) is SPD whenever \(\bA\) is SPD.

TipRemark

The relationship \(\bR = \tfrac{1}{2}\bP^T\) is called the variational principle and preserves symmetry and positive definiteness of \(\bA_c\), since \(\bP\) has full column rank. Accuracy of the coarse space requires a separate approximation argument. For the physical scaling \(\bA=h^{-2}\operatorname{tridiag}(-1,2,-1)\), \(\bA_c\) is the natural \(2h\) finite-difference matrix. If the factor \(h^{-2}\) is omitted on the fine grid, the inherited coarse matrix is \(\tfrac14\operatorname{tridiag}(-1,2,-1)\). This special property simplifies analysis but does not hold in general for variable-coefficient or higher-dimensional problems.

Let \(\boldsymbol\epsilon=\bx^*-\tilde{\bx}\) be the correction we would like to make. Although it is unknown, its equation is known: \(\bA\boldsymbol\epsilon=\br\). Approximate the correction by a prolongated coarse vector \(\bP\be_c\), and require the restricted residual of this equation to vanish. This gives \[ \begin{align} \bR(\br-\bA\bP\be_c)=\bzero, \qquad (\bR\bA\bP)\be_c=\bR\br. \end{align} \] This derives both the coarse matrix and its right-hand side. We transfer the residual because it supplies an equation for the unknown error.

NoteDefinition: Two-Grid Correction Scheme

Given \(\bA\bx = \bb\) on the fine grid, one step of the two-grid (TG) method from an iterate \(\bx^{(0)}\) is:

  1. Pre-smoothing: Apply \(\nu_1 \geq 0\) smoother steps to get \(\tilde{\bx}\).

  2. Residual: Compute \(\br = \bb - \bA\tilde{\bx}\).

  3. Restrict: Form the coarse residual \(\br_c = \bR\br \in \fR^m\).

  4. Coarse solve: Solve \(\bA_c\be_c = \br_c\) exactly for \(\be_c \in \fR^m\).

  5. Prolong and correct: Set \(\hat{\bx} = \tilde{\bx} + \bP\be_c\).

  6. Post-smoothing: Apply \(\nu_2 \geq 0\) smoother steps to \(\hat{\bx}\) to get \(\bx^{(1)}\).

The coarse-grid system \(\bA_c\be_c = \br_c\) solves the residual equation: if \(\bx^* - \tilde{\bx}\) is smooth and lies in the range of \(\bP\), this recovers the error exactly.

NoteTheorem: Ideal Coarse-Grid Correction

If the error \(\boldsymbol{\epsilon} = \bx^* - \tilde{\bx}\) lies in the range of \(\bP\) (i.e., \(\boldsymbol{\epsilon} = \bP\boldsymbol{\delta}\) for some \(\boldsymbol{\delta} \in \fR^m\)), then the two-grid correction recovers the exact solution: \(\hat{\bx} = \bx^*\).

Suppose the error before correction has the form \(\boldsymbol\epsilon=\bx^*-\tilde{\bx}=\bP\boldsymbol\delta\). The vector \(\boldsymbol\delta\) need not be known. We show that the coarse equations recover it.

Use the exact equation \(\bA\bx^*=\bb\) to express the computable residual as \[ \begin{align} \br=\bb-\bA\tilde{\bx} =\bA(\bx^*-\tilde{\bx}) =\bA\boldsymbol\epsilon=\bA\bP\boldsymbol\delta. \end{align} \] Restriction gives \[ \begin{align} \br_c=\bR\br=\bR\bA\bP\boldsymbol\delta =\bA_c\boldsymbol\delta. \end{align} \] By definition the algorithm solves \(\bA_c\be_c=\br_c\). Thus \(\be_c\) and \(\boldsymbol\delta\) satisfy the same coarse linear system. The coarse matrix is nonsingular, so the solution is unique and \(\be_c=\boldsymbol\delta\).

Now prolongate and add: \[ \begin{align} \hat{\bx}=\tilde{\bx}+\bP\be_c =\tilde{\bx}+\bP\boldsymbol\delta =\tilde{\bx}+(\bx^*-\tilde{\bx})=\bx^*. \end{align} \] This proves exact correction for errors in the range of \(\bP\). It does not claim that an arbitrary smooth error is exactly in that range. Approximation of other errors is a separate part of multigrid convergence theory (Briggs et al. 2000).

WarningExercise

Take \(n=7\), \(\bA=\operatorname{tridiag}(-1,2,-1)\), \(\bb=\mathbf1\), and \(\bx^{(0)}=\bzero\). Write out \(\bP\) and \(\bR\), and compute \(\bA_c=\bR\bA\bP\). Compare the true residual norms after four weighted Jacobi sweeps and after a two-grid step with two pre- and two post-sweeps. Count the coarse solve as well as the smoothing work. Does a lower residual alone establish a lower total cost?

27.3 The Multigrid V-Cycle

The two-grid method replaces the fine-grid iteration matrix with one that damps all error components, at the cost of an exact coarse-grid solve. For large problems the coarse grid may itself be large. Multigrid applies the idea recursively. Instead of solving the coarse-grid problem exactly, it applies the two-grid scheme again at the coarser level, and so on, until the coarsest grid is trivially small (a single unknown). This gives the V-cycle.

NoteDefinition: Multigrid Grid Hierarchy

For \(n = 2^L - 1\), define \(L\) nested grids with mesh sizes \(h_\ell = 2^{-\ell}\), giving \(n_\ell = 2^\ell - 1\) interior points at level \(\ell = 1, ..., L\). The finest grid is \(\ell = L\) (mesh size \(h\)) and the coarsest is \(\ell = 1\) (a single point). At each level \(\ell\) we have a system matrix \(\bA_\ell\) (built via Galerkin: \(\bA_{\ell-1} = \bR_\ell\bA_\ell\bP_\ell\)), restriction \(\bR_\ell: \fR^{n_\ell} \to \fR^{n_{\ell-1}}\), and prolongation \(\bP_\ell: \fR^{n_{\ell-1}} \to \fR^{n_\ell}\).

NoteDefinition: Multigrid V-Cycle

\(\mathtt{MG}(\ell,\, \bx,\, \bb)\): one multigrid V-cycle at level \(\ell\), returning an improved approximation to \(\bA_\ell\bx = \bb\):

  1. Base case (\(\ell = 1\)): return \(\bA_1^{-1}\bb\) (exact solve on a \(1 \times 1\) system).

  2. Pre-smoothing: \(\bx \leftarrow S_\ell^{\nu_1}(\bx,\,\bb)\) (\(\nu_1\) steps of the smoother at level \(\ell\)).

  3. Restrict residual: \(\br_{\ell-1} \leftarrow \bR_\ell(\bb - \bA_\ell\bx)\).

  4. Coarse-grid correction: \(\be_{\ell-1} \leftarrow \mathtt{MG}(\ell-1,\,\bzero,\,\br_{\ell-1})\).

  5. Correct: \(\bx \leftarrow \bx + \bP_\ell\be_{\ell-1}\).

  6. Post-smoothing: \(\bx \leftarrow S_\ell^{\nu_2}(\bx,\,\bb)\) (\(\nu_2\) steps of the smoother).

  7. Return \(\bx\).

Calling \(\mathtt{MG}\) once as the coarse-grid solver in step 4 gives the V-cycle. Calling it twice gives the W-cycle, which is more robust on difficult problems at higher cost.

TipRemark

A single V-cycle descends from the finest level \(L\) to the coarsest level \(1\) (the down stroke'') applying pre-smoothing and restriction, then ascends back (theup stroke’’) applying prolongation and post-smoothing. Typical choices are \(\nu_1 = \nu_2 = 1\) or \(2\). The W-cycle replaces the single recursive call in step 4 with two calls, more aggressively correcting smooth error with work governed by \(W(n)=2W(n/2)+O(n)\) in one dimension, hence \(O(n\log n)\). In two or three dimensions, geometric coarsening gives a smaller recursion ratio and a W-cycle can still cost \(O(n)\).

TipRemark

(Mesh-independent convergence) For the standard Dirichlet Poisson problem, suitable smoothing and coarse-grid approximation give a V-cycle contraction in the energy norm with a factor \(q<1\) independent of mesh size. This is a convergence theorem about the whole cycle, not a consequence of the smoothing estimate alone. Its proof is beyond the present development; see (Briggs et al. 2000). For a new discretization, transfer rule, or smoother, uniform convergence needs to be established again. The complexity estimate below is independent of that convergence question.

WarningExercise

Let \(\bC=\bI-\bP(\bR\bA\bP)^{-1}\bR\bA\). Prove that \(\bC\bP=\bzero\) and \(\bC^2=\bC\). For \(\bR=c\bP^T\) with \(c>0\), show that \(\bP^T\bA\bC=\bzero\) and that \(\bC\) is an orthogonal projection in the energy inner product. Deduce \(\|\bC\be\|_{\bA}\leq\|\be\|_{\bA}\). Why does this only give a nonexpansive map, rather than a mesh-independent strict contraction?

TipRemark

For classical iterations on the 1D Poisson problem, \(\rho(\bT_J) = \cos(\pi h) \approx 1 - \pi^2h^2/2 \to 1\) as \(h \to 0\), requiring \(O(h^{-2})=O(n^2)\) Jacobi iterations for a fixed reduction of the slowest mode. With the V-cycle, the number of iterations to reach a fixed tolerance is bounded by a constant independent of \(n\). The cost per V-cycle is \(O(n)\) (geometric series over levels), making the total cost \(O(n)\), which is the optimal asymptotic complexity for this class of problems.

NoteTheorem: \(O(n)\) Complexity of the V-Cycle

Assume a fixed number of smoothing sweeps, \(O(n_\ell)\) work for smoothing, residuals, and transfers at level \(\ell\), and geometric coarsening. For \(L\) levels with \(n=n_L\) unknowns on the finest level, each V-cycle requires \(O(n)\) floating-point operations, independent of the number of levels \(L\).

Let \(n=n_L\) denote the number of unknowns on the finest level. The fixed number of sweeps means there is a constant \(C\), independent of level and problem size, such that all local work at level \(\ell\) is at most \(Cn_\ell\). This includes residuals and transfers as assumed in the statement.

In a V-cycle there is only one recursive call to the next coarser level. Thus every level is visited once on descent and ascent, with that work already included in \(C\). The nested-grid sizes satisfy \[ \begin{align} n_\ell+1=2^\ell =\frac{2^L}{2^{L-\ell}} =\frac{n+1}{2^{L-\ell}}. \end{align} \] Consequently \(n_\ell\leq(n+1)2^{-(L-\ell)}\). Summing the local bounds and the constant coarsest solve gives \[ \begin{align} W(n)&\leq C\sum_{\ell=1}^L n_\ell+C_0\\ &\leq C(n+1)\sum_{j=0}^{L-1}2^{-j}+C_0\\ &\leq2C(n+1)+C_0. \end{align} \] For \(n\geq1\), \(n+1\leq2n\), so this is bounded by a constant times \(n\). This proves the work bound for one V-cycle. A linear bound for the complete solution additionally requires a number of cycles bounded independently of the mesh.

NoteExample

Multigrid vs. classical iterations on the 2D Poisson problem.

Discretize \(-\Delta u = f\) on the unit square with an \(n \times n\) grid (\(h = 1/(n+1)\)), giving \(N = n^2\) unknowns. Approximate iteration counts to reduce the residual by \(10^{-8}\), and total work in units of \(N\) multiplications:

The table states asymptotic work for a fixed tolerance under the model assumptions. Actual cycle counts depend on the right-hand side, initial error, norm, and stopping test; measure them in the implementation exercises below.

WarningExercise

(Smoothing property) For the \(n = 15\) 1D model problem:

  1. Compute the eigenvalues \(\mu_k\) of the standard Jacobi (\(\omega = 1\)) and weighted Jacobi (\(\omega = 2/3\)) iteration matrices. Plot \(|\mu_k|\) as a function of \(k\) on a single figure.

  2. Starting from a random initial error \(\be^{(0)} \in \fR^{15}\), apply 3 steps of each method. Plot the initial and final errors, and describe qualitatively how each method reshapes the error.

  3. Identify the ``worst-case’’ mode (largest \(|\mu_k|\)) for each method over the high-frequency range \(k > 7\). Why is the standard Jacobi smoother inadequate for multigrid?

WarningExercise

(Two-grid implementation) Implement the two-grid correction scheme for the 1D model problem with \(n = 2^m - 1\) interior points.

  1. Write restrict(r) using the full-weighting formula and prolongate(e) using linear interpolation for transferring between a fine grid and the next coarser grid.

  2. Implement two\_grid(A, b, x0, nu1, nu2) with \(\nu_1\) pre-smoothing and \(\nu_2\) post-smoothing steps of weighted Jacobi (\(\omega = 2/3\)) and an exact coarse-grid solve via np.linalg.solve.

  3. For \(m = 6\) (\(n = 63\)), plot residual norm versus iteration count for: (a) weighted Jacobi alone, (b) repeated two-grid cycling. Use a semi-log scale. Estimate the per-cycle convergence factor \(\rho\) for the two-grid method.

WarningExercise

(Multigrid V-cycle) Extend the two-grid implementation to a full V-cycle.

  1. Implement vcycle(x, b, A\_list, level, nu1, nu2) recursively. At level 1 (a single unknown), solve exactly. Test first on the two-grid case to verify it matches your two-grid implementation.

  2. Run the V-cycle on the 1D Poisson problem with \(n = 2^{10} - 1 = 1023\) and \(\nu_1 = \nu_2 = 1\). Measure the empirical convergence factor \(\rho_k = \|\br^{(k)}\| / \|\br^{(k-1)}\|\) for \(k = 1, ..., 15\). Is it approximately constant (mesh-independent)?

  3. Repeat for \(n = 2^{12} - 1 = 4095\). Compare the convergence factors. Then vary \(\nu_1 = \nu_2 \in \{1, 2, 3\}\) and report the convergence factor versus the extra cost per cycle.

TipRemark

(Choosing a solver) The structure of the coefficient matrix determines the method. The following summary collects the recommendations of the preceding sections.

  1. Dense symmetric positive definite. Cholesky factorization (the referenced result), with \(n^3/3\) flops and no pivoting.

  2. Large sparse symmetric positive definite. Preconditioned conjugate gradients (the referenced section) or multigrid, with \(O(\operatorname{nnz}(\bA))\) work per iteration.

  3. Dense general square. Gaussian elimination with partial pivoting (the referenced result), with \(2n^3/3\) flops and the backward error of the referenced result.

  4. Large sparse general square. Preconditioned GMRES (the referenced section).

  5. Overdetermined with full column rank. Householder QR (the referenced result), which avoids the squared condition number of the normal equations.

  6. Rank-deficient or nearly rank-deficient. The SVD (the referenced result), which determines the numerical rank and the minimum-norm solution.

NoteFurther reading

Saad and Greenbaum give complementary treatments of Krylov methods and preconditioning (Saad 2003; Greenbaum 1997). The original conjugate-gradient and GMRES papers remain readable (Hestenes and Stiefel 1952; Saad and Schultz 1986). For multigrid, the tutorial by Briggs, Henson, and McCormick is a natural next step (Briggs et al. 2000).