Partial differential equations (PDEs) expand ordinary differential equations (ODEs) to include multiple independent variables (coordinates):
Additional spatial coordinates are typically extensions of the ODE case and are usually posed and treated as boundary value problems (BVPs).
The time coordinate is almost always posed as an initial value problem (IVP) and tends to introduce complexity in the form of numerical stability constraints.
Classification of PDEs¶
Introducing time as a coordinate in PDEs raises the fundamental question of how information propagates from the initial condition or from events that occur during the solution.
try:
import executable_engineering as exe
except ImportError:
%pip install -q executable_engineering
import executable_engineering as exeElliptic Equations¶
Second-order equations of the form (with ):
are termed elliptic. The absence of a time-derivative term implies that information is not being propagated over time, but rather is instantaneously available everywhere in space—all transients have decayed and the system has reached a steady state (even if coefficients such as vary quasi-statically).
Laplace’s and Poisson’s equations (, ): electrostatic potential with charge density, steady-state heat conduction with a source, or velocity potential of an incompressible, irrotational fluid.
Helmholtz equation (): acoustic vibrations of a membrane or cavity, and quantum-mechanical wave functions in a potential well (obtained after separating time and space variables).
Solution Approaches¶
Solving elliptic equations requires solving a coupled system of algebraic (possibly nonlinear) equations simultaneously across the entire spatial mesh:
Initial guess: Nonlinear root finders require a sufficiently close initial guess. A common mitigation strategy is continuation (parametrically ramping up a physical parameter, such as gradually increasing the heat load in natural convection).
Convergence: Discretizing a fine mesh yields a high-dimensional system where root finders may wander into local minima or leave the feasible region; trust-region methods help mitigate this.
Parallelization: Under domain decomposition, elliptic coupling implies every subdomain instantaneously influences all others, creating heavy communication overhead unless accelerated by multigrid methods and preconditioners.
Parabolic Equations¶
Equations of the form:
propagate information in one temporal direction (forward in time) and govern diffusive processes. Diffusion naturally smooths out sharp discontinuities and high-frequency spatial oscillations, though numerical time-stepping can still suffer from severe stability restrictions.
Solution Schemes¶
Diffusion problems are solved via a time-marching scheme in which time is discretized as an IVP while the spatial operator is discretized as a BVP at each step:
Stiffness: Fine spatial grids introduce widely separated decay time scales, making parabolic PDEs stiff.
Ill-posed inverse problems: When back-calculating model parameters or initial states from later measurements (e.g., inferring thermal conductivity from a cooling profile), the smoothing nature of forward diffusion works against us—many distinct initial states diffuse into nearly identical smooth profiles.
Hyperbolic Equations¶
Equations of the form:
propagate information both forward and backward along characteristic lines at a finite wave speed. Replacing with leaves the governing equation invariant (time-reversal symmetry). Hyperbolic PDEs describe wave propagation (second-order) as well as pure advection (first-order, e.g., ).
Solution Schemes¶
Reduction of order: Second-order time derivatives can be decomposed into a coupled system of first-order equations in time.
Spectral methods: Systems with periodic boundary conditions are well-suited to Fourier spectral analysis, which avoids artificial numerical dispersion.
Reversibility: Time-reversal symmetry makes hyperbolic systems amenable to inverse reconstruction of earlier states from later wave measurements.
Solving Time-Dependent PDEs¶
The standard approach to solving time-dependent PDEs combines IVP time-marching with spatial BVP discretization:
Discretize the time derivative as an IVP relating the new state to the known state .
Discretize the spatial derivatives on a mesh of spacing using finite differences.
March forward in time, enforcing boundary conditions at each time step.
Consider the 1D parabolic heat equation with thermal diffusivity :
Notation¶
Spatial grid points are indexed with a subscript ().
Discrete time levels are indexed with a superscript , marching from known to unknown .
Explicit Euler Time-Stepping¶
Evaluating the spatial second derivative at the current time level yields the explicit (Forward Euler) scheme:

Each grid point at the new time step depends only on three known values at time level . Use the slider below to increase past the stability threshold .
def forward_euler_heat(T0, alpha, dx, dt, num_steps):
T = T0.copy()
T_history = [T.copy()]
r = alpha * dt / dx**2
for _ in range(num_steps):
T[1:-1] = T[1:-1] + r * (T[:-2] - 2.0 * T[1:-1] + T[2:])
T_history.append(T.copy())
return np.array(T_history)
exe.display_source(exe.forward_euler_heat)
fig = exe.plot_forward_euler_heat()
fig.show()Von Neumann Stability Analysis¶
To determine when spatial oscillations grow or decay, von Neumann stability analysis expands the spatial profile in Fourier modes (with wave number and ) and defines the amplification factor via . Stability requires for all wave numbers .
Substituting a Fourier mode into the Forward Euler update gives:
Since , the amplification factor lies in . Requiring yields the 1D stability limit (and its 2D/3D extensions on a uniform grid of spacing ):
Because scales with , halving the grid spacing forces a fourfold reduction in time step—a severe stiffness penalty shared by explicit diffusion schemes.
Implicit Euler Time-Stepping¶
Evaluating the spatial finite difference at the new time level yields the Backward (Implicit) Euler scheme:

Von Neumann analysis gives the amplification factor , which satisfies for all . Backward Euler is unconditionally stable, at the cost of solving a tridiagonal linear system at each time step.
def backward_euler_heat(T0, alpha, dx, dt, num_steps):
T = T0.copy()
T_history = [T.copy()]
n = len(T)
r = alpha * dt / dx**2
A = (
np.diag((1.0 + 2.0 * r) * np.ones(n), 0)
+ np.diag(-r * np.ones(n - 1), -1)
+ np.diag(-r * np.ones(n - 1), 1)
)
A[0, :] = 0.0
A[0, 0] = 1.0
A[-1, :] = 0.0
A[-1, -1] = 1.0
for _ in range(num_steps):
b = T.copy()
T = np.linalg.solve(A, b)
T_history.append(T.copy())
return np.array(T_history)
exe.display_source(exe.backward_euler_heat)
fig = exe.plot_backward_euler_heat()
fig.show()Crank-Nicolson Method¶
Backward Euler is only first-order accurate in time (), whereas central differencing in space is second-order (). The Crank-Nicolson method achieves second-order accuracy in both time and space by averaging the explicit and implicit spatial discretizations at levels and :

The left-hand matrix has the exact same tridiagonal sparsity as Backward Euler, delivering accuracy and unconditional stability for virtually identical computational cost per step.
def crank_nicolson_heat(T0, alpha, dx, dt, num_steps):
T = T0.copy()
T_history = [T.copy()]
n = len(T)
r = alpha * dt / (2.0 * dx**2)
A = (
np.diag((1.0 + 2.0 * r) * np.ones(n), 0)
+ np.diag(-r * np.ones(n - 1), -1)
+ np.diag(-r * np.ones(n - 1), 1)
)
B = (
np.diag((1.0 - 2.0 * r) * np.ones(n), 0)
+ np.diag(r * np.ones(n - 1), -1)
+ np.diag(r * np.ones(n - 1), 1)
)
A[0, :] = 0.0
A[0, 0] = 1.0
A[-1, :] = 0.0
A[-1, -1] = 1.0
for _ in range(num_steps):
b = B @ T
b[0] = T[0]
b[-1] = T[-1]
T = np.linalg.solve(A, b)
T_history.append(T.copy())
return np.array(T_history)
exe.display_source(exe.crank_nicolson_heat)
fig = exe.plot_pde_method_comparison()
fig.show()Summary¶
Implicit time-steppers are invaluable for stiff parabolic PDEs, but each time step requires solving a coupled system of equations. For large 2D/3D meshes, direct factorization () becomes prohibitively expensive, necessitating iterative linear solvers.
Explicit time-steppers are conditionally stable—which restricts —but require no simultaneous equation solving or nonlinear root finding:
No dependence on initial guesses for root finders
Guaranteed per-step update without convergence failures
Trivial parallelization across high-performance computing (HPC) nodes
Minimal memory footprint (no system matrix assembly)
When does the cost of implicit linear/nonlinear iterations outweigh the small time-step restriction of an explicit method? It depends on the problem:
General multiphysics solvers (e.g., COMSOL, ANSYS) typically default to implicit time-stepping to handle coupled stiff physics over long time scales.
Specialized short-duration or massive-mesh solvers often prefer explicit methods that advance millions of degrees of freedom without matrix assembly—such as LS-DYNA (high-velocity impact, crash, and drop tests) and explicit CFD packages (e.g., FLOW-3D).