Chapter 24 Quiz — PDEs and Finite Differences
Twenty questions to check that the stencil, the explicit step, the CFL condition, and the boundary conditions are solid before you move on. Aim for 16/20. Anything below that, revisit the section named in the "Topics to review" map at the end. Answers and one-line rationales are in the key.
Multiple choice
Q1. What distinguishes a partial differential equation from an ordinary one? - (a) It has more than one solution. - (b) Its unknown depends on several variables, so it involves partial derivatives. - (c) It cannot be solved on a computer. - (d) It is always nonlinear.
Q2. The five-point stencil approximates which operator? - (a) The gradient $\nabla u$. - (b) The first time derivative $\partial u/\partial t$. - (c) The Laplacian $\nabla^2 u$. - (d) The divergence $\nabla\cdot\mathbf{v}$.
Q3. In the square-grid five-point stencil $(u_{i+1,j}+u_{i-1,j}+u_{i,j+1}+u_{i,j-1}-4u_{i,j})/h^2$, what is the role of the $1/h^2$? - (a) Cosmetic; it can be dropped. - (b) It converts a neighbour comparison into an actual second derivative. - (c) It enforces the boundary conditions. - (d) It guarantees stability.
Q4. A scheme is explicit when:
- (a) the new values are given by a formula in already-known values only.
- (b) it requires solving a linear system each step.
- (c) it is unconditionally stable.
- (d) it uses implicit none.
Q5. The 2D explicit (FTCS) heat scheme is stable when: - (a) $\alpha\Delta t/h^2 \le 1$. - (b) $\alpha\Delta t/h^2 \le 1/2$. - (c) $\alpha\Delta t/h^2 \le 1/4$. - (d) always — the heat equation is unconditionally stable.
Q6. You halve the grid spacing $h$ but keep $\alpha$ and $\Delta t$ fixed in an explicit 2D heat run. The diffusion number $r$: - (a) halves. - (b) is unchanged. - (c) doubles. - (d) quadruples.
Q7. A Dirichlet boundary condition fixes the boundary's: - (a) value. - (b) gradient (normal derivative). - (c) second derivative. - (d) time derivative.
Q8. A zero-Neumann edge (u(1) = u(2)) physically means:
- (a) the edge is held at a fixed temperature.
- (b) the edge is insulated — no heat crosses it.
- (c) the domain wraps around at that edge.
- (d) the edge temperature is undefined.
Q9. Which scheme is typically unconditionally stable (no timestep limit)? - (a) FTCS explicit. - (b) An implicit (e.g. backward-Euler / Crank–Nicolson) step. - (c) The five-point stencil. - (d) None; all explicit schemes have limits.
Q10. On a structured grid, a point's neighbours are found by: - (a) looking them up in a stored connectivity list. - (b) simple index arithmetic, $(i\pm1,j)$ and $(i,j\pm1)$. - (c) a nearest-neighbour search. - (d) solving a linear system.
True/False (justify in one line)
Q11. True or false: The heat equation and the diffusion equation are the same mathematics with $u$ reinterpreted.
Q12. True or false: Running an explicit heat solver exactly at $r = 1/4$ is perfectly safe and recommended.
Q13. True or false: For the wave equation, the CFL condition is the Courant number $C = c\Delta t/h \le 1$, meaning a wave may cross at most one grid cell per timestep.
Q14. True or false: You may safely overwrite u in place during the FTCS sweep, because the stencil only
reads nearby cells.
Q15. True or false: The explicit stability limit scales as $\Delta t \sim h$, so halving $h$ only doubles the number of steps.
Short answer
Q16. In one sentence, what does the diffusion number $r = \alpha\Delta t/h^2$ collect, and why does it control both accuracy and stability?
Q17. Why must the FTCS update be computed from a snapshot of the old field (two buffers, or a fresh Laplacian array) rather than in place?
Q18. Name the two error sources in the FTCS heat solver and their orders (time and space).
What does this code print?
Q19. A $5$-node 1D rod, ends u(1)=0, u(5)=100, interior 0, one FTCS step with r = 0.25. What is
u(4) after the step?
u_new(4) = u(4) + 0.25_dp*(u(5) - 2.0_dp*u(4) + u(3))
Q20. With the 2D stencil and r = 0.5, a checkerboard interior cell starts at 1.0 with two interior
neighbours at -1.0 and two boundary neighbours at 0.0. What is its value after one step, and what does the
sign-and-magnitude change tell you?
u_new(2,2) = u(2,2) + 0.5_dp*(u(1,2)+u(3,2)+u(2,1)+u(2,3) - 4.0_dp*u(2,2))
Answer Key
| Q | Answer | Rationale |
|---|---|---|
| 1 | b | A PDE's unknown depends on several variables → partial derivatives w.r.t. each. |
| 2 | c | The five-point stencil is the discrete Laplacian $\nabla^2 u$. |
| 3 | b | Dividing by $h^2$ turns a neighbour comparison into a true second derivative (with units). |
| 4 | a | Explicit = new value is a formula in known (current-step) values; no system to solve. |
| 5 | c | 2D FTCS is stable iff $r = \alpha\Delta t/h^2 \le 1/4$. |
| 6 | d | $r \propto 1/h^2$, so halving $h$ quadruples $r$. |
| 7 | a | Dirichlet fixes the boundary value. |
| 8 | b | Zero-Neumann = zero gradient = insulated, no heat flux. |
| 9 | b | Implicit schemes are typically unconditionally stable. |
| 10 | b | Structured grid → neighbours by index arithmetic, no stored connectivity. |
| 11 | True | Identical equation; "heat" vs "diffusion" is just the interpretation of $u$. |
| 12 | False | At $r=1/4$ the worst mode has $|G|=1$ — marginally stable; round-off/nonlinearity can push it over. Stay safely below. |
| 13 | True | That is the original (hyperbolic) CFL condition. |
| 14 | False | In-place overwrite mixes time levels — it silently becomes Gauss–Seidel, a different scheme. |
| 15 | False | Diffusion limit scales as $\Delta t \sim h^2$; halving $h$ needs $4\times$ more steps. |
| 16 | — | It collects physics ($\alpha$), timestep ($\Delta t$), and grid ($h$); the update multiplies the stencil by $r$, so it sets both the step size and the amplification factor. |
| 17 | — | FTCS is defined on the old neighbours $u^n$; in-place updates feed new values into later points, changing the scheme. |
| 18 | — | Time: $O(\Delta t)$ (forward-Euler, first order). Space: $O(h^2)$ (central second difference). |
| 19 | 25.0 |
$0 + 0.25(100 - 0 + 0) = 25$. |
| 20 | -2.0 |
$1 + 0.5(0 - 1 + 0 - 1 - 4) = 1 - 3 = -2$: sign flips and magnitude grows → unstable, $r=0.5 > 1/4$. |
Topics to review by question
| Questions | Section to review |
|---|---|
| 1, 11 | §24.1 (heat/wave equations, PDEs) |
| 2, 3 | §24.2 (five-point stencil, the $1/h^2$ scaling) |
| 4, 9, 16, 17, 18, 19 | §24.3 (explicit vs implicit, FTCS, snapshot update) |
| 5, 6, 12, 13, 15, 20 | §24.4 (CFL / stability, the diffusion number) |
| 7, 8, 14 | §24.5 (boundary conditions) |
| 10 | §24.6 (structured grids) |