Numerical Methods · Design background

Why 2D Needs a Different Trick Than 1D

Adding a second spatial dimension doesn't just add work — it tightens the rules. ADI is the standard way out, and it's built entirely from pieces you already have.

▶ Play the lab📖 Design background

1From one dimension to two

The 1D fin-stability lab derived an explicit stability limit from a single diffusion direction. A 2D plate diffuses heat in both $x$ and $y$ at once:

$$ \frac{\partial \theta}{\partial t} = \alpha\left(\frac{\partial^2\theta}{\partial x^2}+\frac{\partial^2\theta}{\partial y^2}\right) $$

Explicit time-stepping has to respect both directions' tendency to amplify error simultaneously, and the two effects add:

$$ \Delta t \le \frac{1}{2\alpha\left(\frac{1}{\Delta x^2}+\frac{1}{\Delta y^2}\right)} $$

With equal spacing in both directions, that's exactly half the 1D limit. Every dimension you add to a problem squeezes explicit time-stepping further — in 3D, it's worse again.

2The ADI idea: be implicit one direction at a time

A fully implicit 2D step would be unconditionally stable, but solving for every point's new value in terms of every other point's new value means a large, genuinely 2D linear system — expensive. Alternating Direction Implicit finds a middle path: split one time step into two half-steps, and in each half-step, be implicit in only one direction.

The ADI recipe (Peaceman-Rachford)

  1. Half-step 1: for each row (fixed $y$), solve implicitly in $x$ — a 1D tridiagonal system — while treating the $y$-direction term explicitly using the old values.
  2. Half-step 2: for each column (fixed $x$), solve implicitly in $y$ instead — using the intermediate result from half-step 1 — while now treating $x$ explicitly.

Each half-step is just the 1D implicit scheme from the fin-stability lab, applied row-by-row or column-by-column with the exact same Thomas algorithm. Swapping which direction is implicit each half-step is what makes the combined method stable in both directions, even though neither half-step alone is.

▶ In the lab

Set ADI to 5× the explicit-only limit and it stays smooth; set 2D Explicit to just 1.5× that same limit and it diverges within a few dozen steps. Open the lab →

3Stability is not the same thing as accuracy

It's tempting to read "unconditionally stable" as "any time step is fine" — it isn't. ADI's truncation error still grows with $\Delta t$, the same as any time-marching scheme; a huge step just won't diverge, it'll quietly give you a less accurate answer for the early transient (though it still relaxes to the correct steady state, since that's a fixed point of the scheme regardless of step size). Stability answers "will this number mean anything at all"; accuracy answers "how close is it to the truth." They're different questions, and a method can score well on one and only adequately on the other.

Key takeaways

EngineeringCandy · Learn · the design thinking behind the playground