Numerical Methods for PDEs: Finite Differences

the method of lines

/ M-O-L /

Solving a time-dependent PDE means juggling derivatives in both space and time at once, which is awkward. The method of lines is a clean divide-and-conquer trick: discretize ONLY the space derivatives, leaving time continuous. This converts the single PDE into a big system of ordinary differential equations in time — one ODE for the value at each grid point — which you then hand to any off-the-shelf ODE solver. You split a two-dimensional problem into two one-dimensional ones you already know how to do.

Concretely, take the heat equation u_t = alpha*u_xx. Lay down a space grid and replace u_xx at node j by the central second-difference (u_{j-1} - 2u_j + u_{j+1})/h^2, but do NOT touch the time derivative. Now u_j is still a function of time, and you have du_j/dt = alpha*(u_{j-1} - 2u_j + u_{j+1})/h^2 for every j — a coupled system of N ODEs, written compactly as du/dt = A*u where A is the (sparse, tridiagonal) finite-difference matrix. The name comes from the picture: each grid point traces out a 'line' in time, and you evolve all those lines together. Then you choose a time integrator: forward Euler reproduces FTCS, backward Euler reproduces BTCS, the trapezoidal rule reproduces Crank-Nicolson, and a Runge-Kutta or BDF method gives you something fancier — all from the same semi-discrete system.

The power of this view is modularity and reuse. Instead of inventing a new fully-discrete scheme for every PDE, you separate the space discretization (your choice of stencil) from the time integration (the entire mature toolbox of ODE solvers, with their adaptive step control, stability regions, and stiffness handling). It also clarifies WHY explicit schemes for diffusion are so restricted: the ODE system du/dt = A*u is STIFF — the matrix A from the second-difference has eigenvalues ranging down to about -4*alpha/h^2, enormously negative, so an explicit ODE solver's stability region forces a tiny step, exactly the parabolic CFL limit in disguise. The honest caveat: MOL only directly addresses time-dependent (evolution) PDEs, and a poor pairing of a high-order space stencil with a low-order time integrator wastes accuracy.

For u_t = u_xx on 100 interior nodes with h = 0.01, MOL produces du/dt = A*u where A is 100x100, tridiagonal, with -2/h^2 = -20000 on the diagonal. Feed this to a stiff ODE solver (e.g. a BDF method) and it adapts its own time step; feed it to forward Euler and you are back to FTCS with its k <= h^2/2 straitjacket.

Discretize space only: the PDE becomes du/dt = A*u, a big ODE system.

The semi-discrete ODE system from a diffusion operator is STIFF (eigenvalues scale like -1/h^2), so pairing MOL with an explicit ODE solver re-imposes the same harsh step limit as FTCS — the parabolic CFL condition in disguise. To exploit MOL's freedom you generally want an implicit or stiffly-stable integrator (backward Euler, BDF).

Also called
MOLsemi-discretization半離散化線法