A way of stepping a diffusion equation forward in time.
Put this on a grid, with the value at height and time . The second derivative in space becomes , and what’s left to decide is which time level you write that at. The old one gives you directly but only works if , which is impractical on a fine grid. The new one has no timestep limit but is first order in time and damps gradients more than it should.
Crank-Nicolson uses both, with weight each:
That’s the trapezoidal rule, so the scheme sits at and comes out second order in as well as , still with no timestep limit. In exchange each step needs a linear system solved. Row only involves , and , so the matrix is tridiagonal and the Thomas algorithm does it in .
Having no timestep limit doesn’t mean no trouble. The scheme is A-stable but not L-stable, so the shortest wavelengths the grid holds oscillate instead of decaying, and you get wiggles near steep gradients.
On Mars
In the escape model the hydrogen flux picks up two extra terms, gravitational settling and thermal diffusion:
The coefficients get longer but the matrix stays tridiagonal. The bottom boundary is the density handed up from the GCM, the top is the effusion velocity at the exobase. Going implicit matters here because goes like , so it grows by orders of magnitude toward the top of the column and the explicit limit up there would be milliseconds against a 10 s timestep.