The one-dimensional explicit diffusion scheme is stable when

PHYSICS · Multi-part · Fermi University Physics · Mathematical Methods for Physics · Computational Physics · Research software practice, verification and validation

Scientific Computing for Physicists, Ch A repository others can build on: collaboration, history and workflows

Problem

The one-dimensional explicit diffusion scheme is stable when α=DΔt/Δx2≤12\alpha = D\Delta t/\Delta x^2 \le \tfrac12. The main branch runs at D=1 cm2 s−1D=1\,\mathrm{cm^2\,s^{-1}}, Δx=1 cm\Delta x = 1\,\mathrm{cm}, Δt=0.1 s\Delta t = 0.1\,\mathrm{s}, giving α=0.1\alpha=0.1, and passes its known-answer test. Branch A triples the time step to Δt=0.3 s\Delta t = 0.3\,\mathrm{s} (all else unchanged) and reruns the same test: α=0.3≤12\alpha = 0.3 \le \tfrac12, test passes. Branch B halves the grid spacing to Δx=0.5 cm\Delta x = 0.5\,\mathrm{cm} (all else unchanged) and reruns the same test: α=1×0.1/0.52=0.4≤12\alpha = 1\times0.1/0.5^2 = 0.4 \le \tfrac12, test passes. The two branches edit different lines (one sets Δt\Delta t, the other sets Δx\Delta x), so a reviewer merges them without a textual conflict and writes: "Both branches individually pass the known-answer test at α≤12\alpha \le \tfrac12, so the merge is safe." ((a)) Compute the diffusion number α\alpha that the merged code actually runs at, and say whether it is stable. ((b)) Find the error in the reviewer's argument: name the property of α\alpha that the argument overlooks. ((c)) State a test, run after every merge, that would have caught this before release.

Browse the problem library