ConceptComplete

Finite Difference Methods for PDEs

Finite difference methods approximate partial derivatives on a discrete grid. They are the most direct approach to numerical PDEs and provide the clearest illustration of stability, consistency, and convergence concepts.


Discretization of Differential Operators

Definition8.1Finite Difference Approximations

On a grid with spacing hh, standard finite difference approximations include:

  • Forward: uâ€Č(x)≈u(x+h)−u(x)hu'(x) \approx \frac{u(x+h) - u(x)}{h} (O(h)O(h))
  • Backward: uâ€Č(x)≈u(x)−u(x−h)hu'(x) \approx \frac{u(x) - u(x-h)}{h} (O(h)O(h))
  • Central: uâ€Č(x)≈u(x+h)−u(x−h)2hu'(x) \approx \frac{u(x+h) - u(x-h)}{2h} (O(h2)O(h^2))
  • Second derivative: uâ€Čâ€Č(x)≈u(x+h)−2u(x)+u(x−h)h2u''(x) \approx \frac{u(x+h) - 2u(x) + u(x-h)}{h^2} (O(h2)O(h^2))

The five-point Laplacian on a 2D grid: ∇2u≈ui+1,j+ui−1,j+ui,j+1+ui,j−1−4ui,jh2\nabla^2 u \approx \frac{u_{i+1,j} + u_{i-1,j} + u_{i,j+1} + u_{i,j-1} - 4u_{i,j}}{h^2}.

ExampleSolving the Poisson Equation

The Poisson equation −∇2u=f-\nabla^2 u = f on the unit square with Dirichlet boundary conditions, discretized on an N×NN \times N grid, gives a system Au=fAu = f where AA is the (N−1)2×(N−1)2(N-1)^2 \times (N-1)^2 block tridiagonal matrix with the 5-point stencil. The matrix AA is SPD, sparse (at most 5 nonzeros per row), and has condition number Îș(A)=O(1/h2)=O(N2)\kappa(A) = O(1/h^2) = O(N^2).


Heat Equation: Explicit and Implicit Schemes

Definition8.2Forward Euler (FTCS) for Heat Equation

For ut=αuxxu_t = \alpha u_{xx}, the Forward Time Central Space (FTCS) scheme is ujn+1−ujnΔt=αuj+1n−2ujn+uj−1n(Δx)2\frac{u_j^{n+1} - u_j^n}{\Delta t} = \alpha \frac{u_{j+1}^n - 2u_j^n + u_{j-1}^n}{(\Delta x)^2}, or ujn+1=ujn+r(uj+1n−2ujn+uj−1n)u_j^{n+1} = u_j^n + r(u_{j+1}^n - 2u_j^n + u_{j-1}^n) where r=αΔt/(Δx)2r = \alpha\Delta t/(\Delta x)^2. The scheme is stable if and only if r≀1/2r \leq 1/2 (CFL condition), giving Δt≀(Δx)2/(2α)\Delta t \leq (\Delta x)^2/(2\alpha). This severe restriction makes FTCS impractical for fine grids.

Definition8.3Crank-Nicolson Scheme

The Crank-Nicolson scheme averages the explicit and implicit discretizations: ujn+1−ujnΔt=α2[ÎŽ2ujn+1(Δx)2+ÎŽ2ujn(Δx)2]\frac{u_j^{n+1} - u_j^n}{\Delta t} = \frac{\alpha}{2}\left[\frac{\delta^2 u_j^{n+1}}{(\Delta x)^2} + \frac{\delta^2 u_j^n}{(\Delta x)^2}\right] where ÎŽ2uj=uj+1−2uj+uj−1\delta^2 u_j = u_{j+1} - 2u_j + u_{j-1}. Crank-Nicolson is unconditionally stable (no CFL restriction) and second-order in both time and space: O((Δt)2+(Δx)2)O((\Delta t)^2 + (\Delta x)^2). It requires solving a tridiagonal system at each time step, costing O(N)O(N).


Wave Equation

RemarkCFL Condition for the Wave Equation

For utt=c2uxxu_{tt} = c^2 u_{xx}, the standard explicit scheme ujn+1=2ujn−ujn−1+λ2(uj+1n−2ujn+uj−1n)u_j^{n+1} = 2u_j^n - u_j^{n-1} + \lambda^2(u_{j+1}^n - 2u_j^n + u_{j-1}^n) where λ=cΔt/Δx\lambda = c\Delta t/\Delta x is stable iff λ≀1\lambda \leq 1 (CFL condition). At λ=1\lambda = 1 the scheme is exact (it reproduces d'Alembert's solution), a remarkable property not shared by other PDEs. The CFL condition has a physical interpretation: the numerical domain of dependence must contain the physical domain of dependence.