Ordinary Differential Equations (ODEs) deal with functions of one variable (usually time). Partial Differential Equations (PDEs) deal with functions of multiple variables, such as the temperature at a position and time .
The Mother of All PDEs: The Laplacian
Most physical PDEs involve the Laplacian (), which is the divergence of the gradient (). In 1D, this is just (the second spatial derivative). It measures how much the value at a point differs from the average of its neighbors.
Three Classic PDEs
1. The Heat Equation (Diffusion)
Meaning: The rate of change in temperature () is proportional to how much “different” a point is from its neighbors. Heat flows from hot to cold to “smooth out” the distribution.
2. The Wave Equation
Meaning: Acceleration () is proportional to the local “curvature” of the medium. This models everything from guitar strings to light waves.
3. Laplace’s Equation (Equilibrium)
Meaning: The system has reached a state where every point is the average of its neighbors. This describes electric potentials in vacuum or the steady-state temperature of a plate.
Numerical Solution: The Finite Difference Method
Solving PDEs analytically is hard. Engineers use the Finite Difference Method, which replaces derivatives with differences on a grid.
Interactive Lab
import numpy as np
# Simulate 1D Heat Diffusion in a rod
L = 1.0 # Length
nx = 50 # Number of points
dx = L / (nx - 1)
alpha = 0.01 # Thermal diffusivity
dt = 0.001 # Time step
# Initial condition: hot spot in the middle
u = np.zeros(nx)
u[int(0.4*nx):int(0.6*nx)] = 100.0
# Time loop: simplified explicit scheme
for _ in range(100):
u_new = u.copy()
for i in range(1, nx-1):
# u_t = alpha * u_xx
u_new[i] = u[i] + alpha * dt / dx**2 * (u[i+1] - 2*u[i] + u[i-1])
u = u_new
print(f"Temperature at middle: {u[nx//2]:.2f}")
print("The heat has started to spread from the center to the edges.")
23print("The heat has started to spread from the center to the edges.")
24
Exercises
Knowledge Check
If a function satisfies Laplace's Equation ($\nabla^2 u = 0$), what can be said about its local behavior?
Answer: The value at any point is the average of the values at surrounding points.
Functions that satisfy Laplace's equation are called 'Harmonic' functions. They have the 'Mean Value Property', meaning a point's value is equal to the average of its neighbors.
If a function satisfies Laplace's Equation ($\nabla^2 u = 0$), what can be said about its local behavior?
Knowledge Check
In the Heat Equation ($u_t = \alpha u_{xx}$), what happens if the second derivative $u_{xx}$ is positive?
Answer: The temperature at that point will increase.
Positive $u_{xx}$ means the function is 'cupped up' (a local minimum compared to neighbors). Heat will flow *into* this cold spot, causing the temperature to rise ($u_t > 0$).
In the Heat Equation ($u_t = \alpha u_{xx}$), what happens if the second derivative $u_{xx}$ is positive?
Knowledge Check
Why are PDEs harder to solve than ODEs?
Answer: The solution depends on both boundary conditions (space) and initial conditions (time) simultaneously.
While an ODE usually just needs a starting point, a PDE needs to know what is happening at the 'edges' of the system (boundary conditions) for all time.