Computing Library › Numerical Methods
Numerical Methods

The Method of Lines

The method of lines discretizes space first, converting a PDE into a large system of ODEs to be integrated in time by any suitable solver.

Separating space and time

The method of lines (MOL) is a strategy for solving time-dependent PDEs by handling the spatial and temporal discretizations separately. First, discretize all spatial derivatives (by finite differences, finite volumes, finite elements, or spectral methods), leaving time continuous. This turns the PDE into a large coupled system of ordinary differential equations, one per spatial degree of freedom, each describing how a nodal value evolves in time.

Then any ODE integrator, explicit or implicit, adaptive or fixed-step, can advance the semi-discrete system. This separation lets developers mix and match well-tested spatial and temporal building blocks and reuse mature ODE-solver software.

The semi-discrete system

After spatial discretization the system takes the form du/dt = F(u, t), where u collects all nodal unknowns and F encodes the discretized spatial operator plus sources and boundary conditions. The eigenvalues of the Jacobian of F determine stiffness and thus which time integrator is appropriate: widely spread eigenvalues signal stiffness and favor implicit methods.

Advantages and caveats

MOL cleanly decouples the two error sources and lets each be controlled independently. Its main caveat is that not every PDE is well served by a strict split; hyperbolic problems in particular may need the space and time discretizations designed together (as in Lax-Wendroff or discontinuous Galerkin with SSP time stepping) to preserve stability and avoid oscillations.

MOL is the conceptual backbone of most time-dependent transport and MHD codes, making it easy to swap spatial schemes and time integrators as accuracy and stability demands change.