Finite Difference Methods for PDEs
A partial differential equation is a statement about a continuum: it fixes, at every one of an uncountable infinity of points, a local relation between a field and its derivatives. A computer holds only finitely many numbers, so the first act of any numerical method is a surrender of the continuum — we keep the field only at the nodes of a grid and rebuild each derivative from the handful of nodal values that surround it. That rebuilding is the finite difference method: replace by a slope between neighbours, replace by a curvature among three, and the differential equation collapses into a large, sparse system of ordinary algebra. It is the oldest discretization of differential equations and still the one you reach for first, because every piece of it can be re-derived from a single tool — Taylor's theorem. Three questions decide whether the algebra is worth solving. Consistency asks whether each stencil actually reproduces the operator it replaces as the spacing ; Taylor expansion answers it and hands over the truncation error as a bonus. Stability asks whether the errors that rounding and truncation inject at one step stay bounded as the march proceeds, or grow without limit; a one-line Fourier substitution — von Neumann's device — answers it. Convergence, the property we actually want, asks whether the numbers approach the true solution. The remarkable gift of the field, the Lax equivalence theorem, is that for a consistent scheme on a well-posed linear problem the third question reduces to the second: stability is exactly convergence. So the whole subject turns on two tractable calculations — a Taylor expansion and an amplification factor — standing in for one intractable one.
- Finite difference methods keep a field only at grid nodes and rebuild every derivative as a Taylor-derived combination of neighbours, turning a PDE into a sparse algebraic system.
- The central second difference is second-order accurate, with leading error — symmetry buys the extra order by cancelling odd terms.
- Explicit schemes (FTCS for the heat equation) are cheap but only conditionally stable, needing the diffusion number .
- Implicit schemes (BTCS, Crank–Nicolson) cost a linear solve each step but are unconditionally stable; Crank–Nicolson is also second order in time.
- Von Neumann analysis reads stability off the amplification factor of a single Fourier mode: stable exactly when its size never exceeds 1.
- The hyperbolic CFL condition demands the numerical domain of dependence contain the physical one.
- Key idea: Replace each derivative by a Taylor-derived difference quotient on a grid; the PDE becomes algebra. Convergence then follows from consistency (truncation error → 0) plus stability (errors not amplified), as guaranteed by the Lax equivalence theorem.
Where this lives today
Finite differences remain the backbone of large-scale scientific computing, precisely because their stencils map so naturally onto structured grids and modern hardware. In computational electromagnetics the FDTD (finite-difference time-domain) method — Yee's 1966 staggered-grid leapfrog for Maxwell's equations, governed by exactly the CFL condition derived above — designs antennas, photonic devices, and the absorption of radio waves in tissue. Exploration seismology propagates elastic waves through kilometre-scale earth models with high-order difference operators to image oil reservoirs and, in reverse, to locate earthquakes. Numerical weather prediction and climate modelling still run finite-difference (and finite-volume) dynamical cores over the sphere, the direct descendants of the 1950 ENIAC forecast, now integrated on tens of thousands of processors. Quantitative finance prices exotic options by Crank–Nicolson on the Black–Scholes convection–diffusion equation, using projected solvers for the free boundary of American options. And a whole subfield of high-performance computing is devoted to stencil optimization — the memory-bandwidth-bound art of streaming these neighbour sums through GPU caches — because for structured problems the humble five-point Laplacian, wrapped in a multigrid solver, still outruns almost everything else. The open frontiers are non-smooth: provably stable high-order schemes for shocks and steep gradients (ENO/WENO, summation-by-parts operators) and structure-preserving discretizations that conserve energy or respect a discrete maximum principle exactly.
The physical picture
Picture the unknown field sampled only on the nodes of a chessboard. A derivative is no longer a limit but a recipe that mixes a few neighbouring squares: the slope across two squares stands in for , and the curvature among three — how far the middle square sits below the average of its flanks — stands in for . The PDE then reads, at every square, "this combination of my neighbours must equal that combination", and the collection of all those local statements is one giant simultaneous system. For a steady problem it is a single sparse linear solve; for an evolving one it is a rule that marches the whole board forward one tick at a time. The first figure shows the canonical stencil — the five-point Laplacian — that encodes "centre minus the average of four neighbours".
Accuracy is bought entirely from cancellation. A one-sided (forward) difference leaves the first uncancelled Taylor term at order ; placing the sample symmetrically kills the leading odd term and leaves order . Recruit more neighbours with cleverly chosen weights and you annihilate more Taylor coefficients, climbing to fourth order and beyond. Stability is a different concern and it lives in time. Decompose the numerical field into Fourier ripples; each ripple is multiplied by an amplification factor every step. If every stays no larger than one in magnitude the errors decay or hold; if a single mode has it grows geometrically and eventually swamps the answer. The second figure plots exactly that factor for the explicit heat scheme and shows the knife-edge at .
The core equations
A finite difference method is a dictionary that translates each derivative into a weighted sum of nodal values. The three difference quotients below are the whole vocabulary for one dimension; every scheme in the article is assembled from them. The first is the cheapest and least accurate — a one-sided slope whose Taylor remainder is first order in .
where: — grid spacing; — first derivative being approximated; — a point in supplied by the Taylor remainder. The remainder is exact, not an estimate: the error is a genuine multiple of evaluated somewhere in the cell. Sampling symmetrically about makes the even-order Taylor terms cancel in the difference, lifting the accuracy to second order at no extra node count — the workhorse first-derivative stencil.
where: — values at the two neighbouring nodes. The leading error is : halving cuts it fourfold. Adding rather than subtracting the two neighbour expansions cancels the odd terms and isolates the curvature — the single most important stencil in the subject, since it is the discrete second derivative that appears in every diffusion, wave, and potential problem.
where: — second derivative; — fourth derivative setting the leading error. In two dimensions the same construction along and gives the five-point Laplacian of the first figure. Applied to the heat equation with a forward time difference and this central space difference, we get the FTCS (forward-time, centred-space) scheme — the prototype explicit marcher.
where: — the approximation to ; — thermal diffusivity; — time and space steps. Every quantity on the right is known at level , which is what makes it explicit. Solving (4) for the single unknown gives an update that needs no linear solve — but, as the derivations show, it pays for that with a stability leash set by the diffusion number .
where: — the mesh ratio or diffusion number, the only combination of that matters for stability. Stability demands . Evaluating the space difference at the new time level instead couples all three unknowns in one row, giving the fully implicit BTCS scheme — a tridiagonal solve per step, but stable for any .
where: , now with no upper bound. The price of unconditional stability is inverting a tridiagonal matrix, which the Thomas algorithm does in work. Averaging the explicit and implicit spatial operators — the trapezoidal rule in time — gives Crank–Nicolson, which keeps unconditional stability and gains second-order time accuracy.
where: is the central second difference. This is the default production scheme for parabolic problems, from heat transfer to option pricing. Stability of any of these is decided by one substitution: feed in a single Fourier mode and watch its per-step growth.
where: — the amplification factor of the mode of wavenumber ; . The whole of von Neumann analysis is: compute , then read off the condition . For hyperbolic problems the constraint is geometric rather than diffusive — the Courant number caps how far a signal may travel per step.
where: — the physical signal (wave) speed; — the Courant number. The numerical stencil must be able to "reach" the physical characteristic, or it cannot possibly converge.
The goal is to show, with the truncation error made fully explicit, that the three-point combination is a second-order accurate stand-in for , and to see why the accuracy is second and not first order. We expand both neighbours to high order, add them so the odd derivatives annihilate, isolate , and identify the first surviving error term as — the number that governs how fast the stencil converges under refinement and that quietly reappears as the leading term of every modified-equation analysis.
Step 1. Write Taylor's theorem for the two neighbours about the node : , keeping terms through fourth order and carrying the signs symbolically. Why: everything the stencil "knows" about the function is contained in these two expansions; the art is only in how we combine them.
Step 2. Add the two expansions. Every term with an odd power of appears once with a and once with a and cancels, leaving . Why: the cancellation of odd terms is the whole mechanism — it is what makes a symmetric stencil "see" curvature cleanly without contamination from the slope or the third derivative.
Step 3. Subtract and divide by to obtain . Rearranged, the stencil equals with an error of exactly at leading order. Why: this is consistency made quantitative — the difference operator reproduces the differential operator as , and the rate is .
Step 4. Read the consequence. Because the error scales as , halving the grid spacing shrinks the truncation error by a factor of four; a convergence study that plots error against on log axes should show a slope of . Why: the exponent in is the single most useful number about a scheme, and Taylor's theorem hands it to us before we run a single grid. *As a concrete check: applied to at with , the stencil returns against the exact , matching the predicted error exactly.*
Go deeper · Derivation B · 1 minVon Neumann stability of the explicit heat scheme
The aim is to derive the famous ceiling on the explicit FTCS scheme by the method that dominates the whole field — insert one Fourier mode, extract its amplification factor, and demand the factor never exceed one in magnitude. This turns a question about the growth of arbitrary errors into a short trigonometric calculation, and it exposes the deep fact that the shortest representable wave, not the smoothest, is the one that dictates the time step.
Step 1. Substitute the separable grid mode with into the explicit update , giving . Why: the scheme is linear and constant-coefficient, so Fourier modes are its eigenfunctions — each evolves independently by a scalar factor , and superposition handles any initial error.
Step 2. Cancel the common and collapse the exponentials with , so . Why: the whole per-step behaviour of the mode has been reduced to one real number , because for this scheme turns out to be purely real.
Step 3. Apply the half-angle identity to get the clean form . Why: written this way the dependence on the mode is isolated in a single factor that ranges over , so we can immediately find the worst case.
Step 4. Impose , i.e. . The right inequality holds for every ; the left requires for all . The most dangerous mode is the shortest one, , where , giving , hence . Why: stability is a statement about the worst mode, and here the sawtooth at the grid Nyquist limit is it — the one you would least expect to care about sets the entire time step. *As a concrete illustration: at the Nyquist mode has , so ; ten steps amplify it by — the exponential blow-up that makes the instability immediately visible.*
Go deeper · Derivation C · 2 minThe CFL condition from the domain of dependence
The purpose here is to explain, for the advection equation , why an explicit scheme cannot converge unless its numerical domain of dependence swallows the physical one — a purely geometric argument that yields the Courant–Friedrichs–Lewy bound without any Fourier algebra at all. The idea is due to the 1928 paper that founded the whole discipline, and it captures a necessary condition that no amount of cleverness in the stencil weights can evade.
Step 1. Recall the exact solution: is constant along the characteristics , so the value at depends on the initial data at the single point , the foot of the characteristic through . Why: this is the physical domain of dependence — the exact answer is determined by exactly one point of the initial line.
Step 2. Track information through an explicit three-point stencil. After steps a node can only have been influenced by initial nodes within cells, that is within of its position, over an elapsed time . Why: each step, the stencil reaches one cell left and right, so the numerical domain of dependence is a discrete cone widening at the fixed rate .
Step 3. Demand containment. The scheme can converge to the true solution only if the physical characteristic foot lies inside the numerical cone: , which cancels to . Why: if the exact answer depends on data the scheme literally never looks at, refining the grid cannot help — the numbers converge, if at all, to the wrong thing.
Step 4. Interpret the bound. says a signal may cross at most one cell per step. Unlike the parabolic , this scales as , a far gentler penalty under refinement, and at exactly the 1D scheme becomes perfect. Why: CFL is a necessary condition for any explicit hyperbolic scheme; von Neumann analysis of a specific scheme (upwind, leapfrog) then confirms whether it is also sufficient. *For the 1D leapfrog wave scheme, gives zero numerical dispersion — the "magic time step" — while diverges, exactly as the cone argument predicts.*
Limiting cases
How the stencils and their stability constraints behave in the characteristic regimes:
| Case | Result | Meaning |
|---|---|---|
| Grid refinement | Consistency: the truncation error vanishes at the scheme's order . But work grows and rounding error eventually dominates, setting a practical optimal — you cannot refine forever. | |
| Explicit parabolic | FTCS is stable only below this ratio; halving forces a fourfold cut in — the punishing diffusion time-step penalty. | |
| Hyperbolic CFL | The numerical domain of dependence must contain the physical characteristic cone; the penalty scales only linearly, . | |
| Implicit (Crank–Nicolson) | Unconditionally stable — no step-size cap — at the cost of a tridiagonal solve each step. Second order in both space and time. | |
| Magic time step | zero numerical dispersion (1D) | The leapfrog wave scheme reproduces d'Alembert propagation exactly; every Fourier mode travels at the right speed. A 1D-only miracle. |
Worked examples
1 · The stability budget of an explicit heat solve (fully worked)
A metal bar has thermal diffusivity . You discretize with FTCS on a grid of spacing . What is the largest stable time step, what happens to a hot node in one step at , and how does the budget change if you refine to ?
Step 1. Stability requires , so . Any larger step and the scheme diverges no matter how accurate the stencil.
Step 2. Take a node sitting at between two cold neighbours at : the update is . At it becomes (a physical, smoothing half-step); at it becomes (the node fully empties in one step — the stability edge); at it becomes , an unphysical overshoot to negative temperature that is the visible face of instability.
Step 3. Confirm with the amplification factor. At the Nyquist mode () has , so ; after ten steps a rounding-level ripple is amplified by . At , : the mode neither grows nor decays — marginal stability.
Step 4. Refine the space step to . The budget falls to — a factor of four smaller for a factor of two in . Halving the mesh quadruples the number of time steps and doubles the spatial nodes, so an explicit heat solve costs roughly more work per refinement level. This penalty is exactly why implicit schemes exist.
2 · Laplace's equation on a small grid by hand
Solve on the unit square with the top edge held at and the other three edges at , using a coarse grid with a block of interior nodes. Get the exact nodal values, then watch Gauss–Seidel iteration converge to them.
Step 1. The five-point stencil at each interior node says — every interior value is the average of its four neighbours. Label the interior nodes (top row, adjacent to the hot edge) and (bottom row). Left–right symmetry gives and .
Step 2. Write the two independent equations. Top node: , so . Bottom node: , so . Substitute: , giving and . The nodes nearer the hot wall are hotter, as they must be.
Step 3. Now solve the same system iteratively, as one must for large grids where direct inversion is too costly. Gauss–Seidel sweeps the four nodes in order, each time overwriting a node with the average of its current neighbours. Starting from all zeros, the natural-order sweeps give: sweep 1 → ; sweep 2 → ; sweep 3 → ; sweep 4 → .
Step 4. The iterates march steadily toward the exact , gaining roughly one correct digit every few sweeps. On a real grid this same relaxation — accelerated by successive over-relaxation (SOR) or wrapped in a multigrid cycle — is how sparse Laplace and Poisson systems with millions of unknowns are actually solved. Exact: top nodes 37.5, bottom nodes 12.5; Gauss–Seidel reaches them from zero without ever forming the matrix.
Physics of the portrait
Finite differences are as old as the calculus, but the method became a science — with a theory of when it may be trusted — in the middle of the twentieth century, driven by the twin engines of the Manhattan Project and the first electronic computers. No one embodies that transformation more completely than the mathematician whose name is now attached to the stability test at the heart of this article.
Origins · 1 minJohn von Neumann and how this was discovered
Von Neumann was the rarest kind of mathematician — one who reshaped pure fields (set theory, operator algebras, the axioms of quantum mechanics, game theory) and then turned the same intellect on the most concrete engineering problems of his age. During the Second World War, computing shock waves and implosion hydrodynamics for the atomic-bomb project at Los Alamos, he confronted the practical menace that a finite difference scheme could dissolve into meaningless oscillation for no visible reason. His response was the Fourier-mode stability analysis this article uses throughout: decompose the numerical error into grid waves, track the amplification factor of each, and demand that none grow. The method was so effective and so simple that it spread by word of mouth before it was ever properly published — it appears in the 1951 paper of O'Brien, Hyman and Kaplan and is credited to him throughout. Von Neumann was simultaneously midwifing the stored-program computer (the "von Neumann architecture") and, with Charney and Fjørtoft, ran the first numerical weather forecast on ENIAC in 1950 — a finite difference integration of the atmosphere that took nearly 24 hours of computing to predict 24 hours of weather. He did not live to see how completely his stability criterion would come to govern the numerical solution of every evolution equation; he died of cancer in 1957 at fifty-three. The theory was completed by others — Peter Lax and Robert Richtmyer proved in 1956 that consistency and stability are together equivalent to convergence — but the working tool, the one an engineer reaches for to check a new scheme, is still von Neumann's single Fourier mode.
Going further
Texts. G. D. Smith, Numerical Solution of Partial Differential Equations: Finite Difference Methods, 3rd ed. (the classic student text on stability and consistency) · R. D. Richtmyer & K. W. Morton, Difference Methods for Initial-Value Problems (the rigorous reference for Lax equivalence and von Neumann analysis) · J. C. Strikwerda, Finite Difference Schemes and Partial Differential Equations · R. J. LeVeque, Finite Difference Methods for Ordinary and Partial Differential Equations · Stone & Goldbart, Mathematics for Physics, and Arfken & Weber, Mathematical Methods for Physicists (the numerical-PDE chapters set in a physics context). Every difference stencil and its truncation order follows directly from Taylor's theorem. The key amplification factors are: for FTCS with worst case ; with always for Crank–Nicolson; and the domain-of-dependence bound for the explicit advection stencil. The Laplace worked example yields exact nodal values and , approached by the Gauss–Seidel iterates shown above.
Prerequisites. Taylor's theorem with remainder · Order Symbols and Gauge Functions · Linear algebra of sparse systems · Fourier series and modes. Leads to. Asymptotic Series and Poincaré Expansions · Finite Element Methods · Spectral methods.
Ask the tutor: Ask me to von-Neumann-analyse any scheme you like — hand me its update rule and I'll extract the amplification factor and tell you exactly when it blows up.
Is a finite difference scheme just "replacing derivatives by slopes"?
That is the right first picture, but the substance is which slopes and at what cost. Replacing by is the easy half; the hard half is that the discrete problem has its own personality. It has a truncation error you must control (consistency), it can amplify tiny errors into garbage (stability), and only when both are handled does it approximate the true solution (convergence). The Lax equivalence theorem is what ties these together. So "replace derivatives by slopes" is the recipe, but "consistency plus stability equals convergence" is the theory that tells you when the recipe is safe to eat.
Why does refining the grid sometimes make the answer worse?
Because refinement helps only if the scheme is stable. Truncation error does fall as you shrink — that is consistency — but an unstable scheme amplifies errors geometrically each step, and refining a time-marching scheme usually forces more steps, giving instability more chances to act. The explicit heat equation is the classic trap: if you halve but keep fixed, the diffusion number quadruples, and once it crosses the grid-scale mode blows up. The fix is to respect the stability limit (shrink as ) or switch to an unconditionally stable implicit scheme like Crank–Nicolson.
What is the difference between explicit and implicit schemes, really?
An explicit scheme computes each new value from values already known, so one update is a cheap arithmetic formula with no system to solve — but stability leashes the time step (the or CFL limits). An implicit scheme couples the unknowns at the new time level, so each step is a linear solve — for 1D problems a tridiagonal one, cheap by the Thomas algorithm — but in exchange you often win unconditional stability and can take much larger steps. The trade is per-step cost against step-size freedom. For stiff problems (small diffusion length, fine grids) implicit wins decisively; for wave problems where you want small steps anyway, explicit schemes like leapfrog and FDTD are usually preferred.
How does von Neumann analysis actually prove stability?
It exploits that a linear, constant-coefficient scheme treats Fourier modes as independent eigenfunctions. You insert a single mode , and the update collapses to a scalar relation , where — the amplification factor — is pure trigonometry in . Any initial error is a superposition of such modes, each multiplied by its own every step, so the error stays bounded exactly when for every . The method is a necessary and sufficient stability test for these problems and reduces to finding the worst-case mode — often the grid-Nyquist sawtooth . Its main limitation is that it assumes constant coefficients and periodic (or infinite) domains; boundaries and variable coefficients need more care.
Why is Crank–Nicolson usually preferred over the fully implicit BTCS scheme?
Both are unconditionally stable, so stability is not the discriminator — accuracy is. BTCS evaluates the spatial operator entirely at the new time level and is only first order in time, so its errors scale as . Crank–Nicolson averages the spatial operator over the old and new levels (the trapezoidal rule in time), which centres the time derivative and makes the scheme second order in both time and space, with errors scaling as . Since the per-step cost is identical — a tridiagonal solve either way — Crank–Nicolson gives far more accuracy for the same work, or equal accuracy at much larger steps. The one caveat: BTCS damps grid-scale oscillations more aggressively, so for very rough initial data Crank–Nicolson can ring, which is sometimes cured by a few damped BTCS start-up steps (Rannacher smoothing).
Do finite differences still matter now that finite elements and spectral methods exist?
Very much so. Finite elements shine on complicated geometries and unstructured meshes; spectral methods give exponential accuracy for smooth solutions on simple domains. But finite differences own the middle: structured grids, simple domains, and problems where raw throughput matters. Their stencils map perfectly onto the regular memory access patterns that GPUs and vector units love, so FDTD electromagnetics, seismic imaging, and weather cores remain finite-difference for performance reasons. They are also the easiest schemes to reason about — the entire consistency-and-stability theory in this article is elementary — which makes them the natural teaching vehicle and the first thing to try. The methods are complements, not competitors, and most large simulation codes mix them.