Skip to content
Tutorials Center
My learning

Topics

Lesson 23 of 47 ยท Partial Differential Equations

Chapter overview: partial differential equations

See the big picture of numerical PDEs: heat, wave and Laplace equations, why grids work, and what every lesson in this chapter covers.

Most of physics is written in partial differential equations (PDEs). Heat flows through a metal bar, a guitar string vibrates, an electric potential settles around a charged plate: each of these involves a quantity that depends on several variables at once, such as position and time. Only a few PDEs have neat pencil-and-paper solutions. For everything else, you teach the computer to approximate the answer on a grid.

This chapter builds that skill with the three classic model equations. If you can simulate these three, you can read and adapt almost any PDE solver you meet later.

Three cards showing a heat bump spreading, a wave pulse splitting in two, and a coloured grid for the Laplace equation
The three model PDEs: heat spreads, waves travel, and the Laplace equation describes a state of balance.

What you will learn

  • Why a PDE is turned into a set of ordinary arithmetic steps on a grid.
  • How the heat, wave and Laplace equations differ in behavior and in the numerical method they need.
  • What stability, accuracy and convergence mean in practice.
  • What each of the next four lessons teaches.

Key terms

Partial derivative: the rate of change of a quantity with respect to one variable while the others are held fixed.

Grid (mesh): a set of points in space and time where we store approximate values.

Finite difference: a formula that replaces a derivative by a difference of grid values.

Boundary condition: the value (or slope) the solution must have at the edge of the region.

Stability: small errors stay small instead of growing step after step.

The big idea: derivatives become differences

A second derivative at a grid point is estimated from its neighbors:

Text
โˆ‚ยฒu/โˆ‚xยฒ โ‰ˆ (u[j+1] โˆ’ 2ยทu[j] + u[jโˆ’1]) / ฮ”xยฒ

Do the same for time and each PDE turns into a rule that says "the new value at this point is a combination of old values nearby". The computer then applies the rule millions of times. The error of this central difference shrinks like ฮ”xยฒ: halve the spacing and the error drops by a factor of about four.

Three behaviors, three methods

Heat equation

Diffuses Peaks flatten
Marches in time Step by step
Watch the step size FTCS needs r โ‰ค 1/2
1 / 4

Mathematicians call the three families parabolic (heat), hyperbolic (wave) and elliptic (Laplace). The names matter for one practical reason: they tell you how information moves. In a parabolic problem it spreads out everywhere instantly but weakly. In a hyperbolic problem it moves at a finite speed. In an elliptic problem every point depends on the whole boundary at once, so you solve for all points together.

What each lesson covers

Try it

A PDE of the form Aยทu_xx + Bยทu_xy + Cยทu_yy + โ€ฆ = 0 is classified by the sign of Bยฒ โˆ’ 4AC. The tool below applies that rule. It is a calculator for the classification only, not a solver.

Python Classify a second-order PDE

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A second experiment: how fast does the central-difference error shrink? We estimate the second derivative of sin(x) at x = 1 (exact value โˆ’sin 1).

Python Error of the three-point second derivative

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Each time dx is halved the error falls by about a factor of four: second-order accuracy.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which PDE describes a steady state with no time variable?

    The Laplace equation has only space variables. Its solution is the state that remains once everything has settled.
  2. 2. What does a finite difference do?

    A finite difference approximates a derivative using values at neighboring grid points.
  3. 3. If a second-order scheme has spacing 0.1 and error 4e-4, roughly what error do you expect at spacing 0.05?

    Second order means error scales with dx squared. Halving dx divides the error by 4.
  4. 4. In which type of PDE does information travel at a finite speed?

    Hyperbolic equations such as the wave equation carry disturbances at a finite speed.

Summary

  • A PDE is solved numerically by storing values on a grid and replacing derivatives with differences.
  • Heat (parabolic) spreads, wave (hyperbolic) travels, Laplace (elliptic) describes balance.
  • Each type needs its own method and its own stability rule.
  • Always test a new solver on a case with a known exact answer.

Next: The heat equation and the FTCS scheme