Explicit Finite Differences: Too Many Time Steps or Too Many Space Steps?

Coding · Medium · Free problem

You are solving a parabolic PDE, say the heat equation $u_\tau = u_{xx}$ obtained from the Black-Scholes equation, with the explicit finite difference scheme. Which is the worse mistake: using too many time steps, or using too many space steps? Explain, and state the precise condition involved. Does the same concern apply to the implicit scheme?

Hints

  1. Write out the explicit update $u_j^{n+1} = a u_{j-1}^n + (1 - 2a)u_j^n + a u_{j+1}^n$ with $a = \delta\tau/\delta x^2$ and ask what happens to the weight $1 - 2a$ as $\delta x$ shrinks with $\delta\tau$ fixed.
  2. Stability (von Neumann): a Fourier mode $u_j^n = g^n e^{i\theta j}$ is multiplied by $g = 1 - 4a\sin^2(\theta/2)$ each step; $|g| \le 1$ for all $\theta$ requires $a \le 1/2$.
  3. Halving $\delta x$ quadruples $a$ unless $\delta\tau$ is cut by four; adding time steps only lowers $a$, so extra time steps cost time but never stability.

Worked Solution

How to Think About It: Both errors add work, but only one can destroy the answer. Stability of the explicit scheme depends on the *ratio* $a = \delta\tau/\delta x^2$. More time steps shrink $\delta\tau$ and hence $a$: safe. More space steps shrink $\delta x$ and grow $a$ like $1/\delta x^2$: eventually unstable.

Quick Estimate: Suppose you use $N = 400$ time steps on $[0, 0.1]$ ($\delta\tau = 2.5 \times 10^{-4}$) and start with $J = 20$ space intervals on $[0, 1]$: $a = 2.5\times10^{-4}/(0.05)^2 = 0.1$, fine. Refine to $J = 50$: $a = 2.5\times10^{-4}/(0.02)^2 = 0.625 > 0.5$, and the computed solution reaches $10^{53}$ instead of $O(1)$. Conversely, with $J = 20$ fixed, going from $N = 100$ ($a = 0.4$, error $10^{-3}$) to $N = 10{,}000$ ($a = 0.004$, error $7\times10^{-4}$) just costs a hundred times more work.

Formal Solution:

*Step 1 -- The scheme and its weights.* The explicit scheme is $$u_j^{n+1} = a\,u_{j-1}^n + (1 - 2a)\,u_j^n + a\,u_{j+1}^n, \qquad a = \frac{\delta\tau}{\delta x^2}.$$ If $a \le 1/2$ all three weights are nonnegative and sum to $1$, so each new value is a convex combination of old values and $\max_j |u_j^{n}|$ can never grow (a discrete maximum principle). If $a > 1/2$ the middle weight is negative and this argument fails.

*Step 2 -- Von Neumann stability analysis.* Insert a Fourier mode $u_j^n = g^n e^{i\theta j}$: $$g = 1 + a\left(e^{i\theta} - 2 + e^{-i\theta}\right) = 1 - 2a(1 - \cos\theta) = 1 - 4a\sin^2(\theta/2).$$ The mode is amplified unless $|g| \le 1$ for every $\theta$. The worst case is $\theta = \pi$ (the sawtooth mode), where $g = 1 - 4a$; requiring $g \ge -1$ gives $$a = \frac{\delta\tau}{\delta x^2} \le \frac12.$$ For $a > 1/2$ the sawtooth mode grows by $|1 - 4a| > 1$ per step: at $a = 0.625$ that is $1.5^{400} \approx 10^{70}$ over $400$ steps, which matches the blow-up seen numerically.

*Step 3 -- Time steps versus space steps.* Holding $\delta x$ fixed and adding time steps reduces $\delta\tau$, so $a$ falls and the condition is satisfied more comfortably; the only cost is run time (and slightly more accumulated rounding). Holding $\delta\tau$ fixed and adding space steps raises $a \propto 1/\delta x^2$; halving $\delta x$ quadruples $a$, so a modest refinement crosses the threshold and the scheme diverges. To refine the space grid safely you must refine time quadratically, $\delta\tau \propto \delta x^2$, which makes fine explicit grids expensive. Hence too many space steps is the worse mistake.

*Step 4 -- Implicit and Crank-Nicolson.* For the implicit scheme the amplification factor is $g = 1/(1 + 4a\sin^2(\theta/2))$, which satisfies $0 < g \le 1$ for every $a > 0$; for Crank-Nicolson $g = (1 - 2a\sin^2(\theta/2))/(1 + 2a\sin^2(\theta/2))$, with $|g| \le 1$ for every $a$. Both are unconditionally stable, so the time and space steps can be chosen independently for accuracy alone. Numerically, at $a = 0.64$ the implicit and Crank-Nicolson errors were $2\times10^{-4}$ and $5\times10^{-5}$ while the explicit scheme produced $10^{176}$.

Answer: Too many space steps is worse. The explicit scheme is stable only if $a = \delta\tau/\delta x^2 \le 1/2$ (all weights $a$, $1 - 2a$, $a$ nonnegative; von Neumann factor $1 - 4a\sin^2(\theta/2)$). Extra time steps shrink $a$ and only waste computation, whereas shrinking $\delta x$ with $\delta\tau$ fixed raises $a$ quadratically and makes the solution blow up. Implicit and Crank-Nicolson schemes are unconditionally stable, so the concern does not apply to them.

Intuition

The explicit scheme is a weighted average of three neighbours with weights $a$, $1 - 2a$, $a$; it is a discrete diffusion and behaves well only while all weights are nonnegative, i.e. $a = \delta\tau/\delta x^2 \le 1/2$. Refining the space grid without shrinking the time step quadratically pushes $a$ past that limit and the highest-frequency mode is amplified by a factor near $|1 - 4a| > 1$ every step, so the solution explodes exponentially. Extra time steps can only lower $a$, so they are merely wasteful. This asymmetry is why practitioners either accept the $\delta\tau \propto \delta x^2$ cost of explicit schemes or switch to implicit or Crank-Nicolson, which are stable for any step ratio.

Open the full interactive solver →