ODE and PDE solvers: finite differences and stability
NUM · Chapter 512 min readAsked at Optiver, Citadel Securities, Akuna, SIG
Assumes Linear algebra in practice: factorisations and conditioning.
After this lesson you should be able to
- Set up a finite-difference grid for the Black–Scholes PDE.
- State the stability condition for an explicit scheme.
- Choose between explicit, implicit and Crank–Nicolson.
The Black–Scholes equation is a diffusion equation run backwards in time, and finite differences solve it on a grid. The subject has one central pitfall — an explicit scheme that looks correct and blows up — and understanding why is most of what an interview will ask.
Proposition 5.1
Setting up the grid
Discretise in the underlying and in time, impose the payoff as the terminal condition, and step backwards. The boundary conditions come from the economics: a call is worth nothing at zero spot and behaves like the forward minus the discounted strike at high spot.
Holds when
- Work in rather than : it makes the coefficients constant and the grid uniform in a variable that actually behaves uniformly.
- Put a grid node exactly at the strike, or the kink smears across two nodes and the convergence rate falls.
- Truncate the spatial domain at several standard deviations, and check the answer is insensitive to where.
| Aspect | Explicit | Implicit | Crank–Nicolson |
|---|---|---|---|
| Each step | Direct arithmetic | Solve a tridiagonal system | Solve a tridiagonal system |
| Stability | Conditional | Unconditional | Unconditional |
| Accuracy in time | |||
| Cost per step | Lowest | Low — tridiagonal is | Low |
| Weakness | Tiny time steps required | First-order only | Oscillates near a discontinuity |
Equation 5.3
The explicit stability condition
Halving the space step requires quartering the time step. Refining the grid therefore costs eight times the work, not twice.
- The quadratic dependence is what makes this so restrictive.
The rest of this lesson is in Premium
You have read the opening. 11 more sections follow, including 5 worked examples and 3 quick checks.
Nothing is charged for 7 days, and you can cancel before then. Or read Complexity: reading it off, and deriving it in full, free.