Learning objectives
- Explain what a differential equation, an initial condition and a parameter are.
- Solve and interpret dN/dt = kN, Newton’s law of cooling and the logistic equation, including their equilibria.
- Describe how mass, stiffness and damping control a spring’s motion, and classify under-, critically and overdamped motion.
- Read a phase plane and classify the equilibrium of a two-variable linear system.
- Carry out Euler’s method, explain the role of the step size, and recognise numerical instability.
What a differential equation is
A differential equation relates an unknown function to its derivatives, its rates of change. For example dN/dt = 0.3N says “N grows at a rate equal to 30% of its current size per unit time”. On its own it describes a whole family of solutions; an initial condition such as N(0) = 10 picks out one of them. Parameters(like 0.3) are constants that change the behaviour. An equilibrium is a value where the rate of change is zero, so the system stays put; it is stable if nearby solutions move towards it andunstable if they move away.
A slope field (direction field) draws, at many points, a short segment with the slope the equation demands there. Solution curves follow these segments, so you can see the behaviour without solving anything.
Exponential growth and decay
dN/dt = kN: the rate of change is proportional to the amount. Its solution isN(t) = N₀e^(kt). If k > 0 the quantity grows, doubling every ln 2 / k; if k < 0 it decays, halving every ln 2 / |k| (the half-life). The only equilibrium is N = 0. This model describes compound interest, radioactive decay, the early growth of bacteria and the discharge of a capacitor.
Newton’s law of cooling
dT/dt = −k(T − Tₐ), with k > 0: an object’s temperature changes at a rate proportional to the difference between it and its surroundings. The solution is T(t) = Tₐ + (T₀ − Tₐ)e^(−kt), so the gap to the surroundings decays exponentially and halves every ln 2 / k. Tₐ is a stable equilibrium. The model assumes a constant surrounding temperature, a constant coefficient k and a uniform temperature inside the object; it works well for modest temperature differences when heat is lost mainly by convection.
Oscillation and damping
A mass m on a spring of stiffness k, slowed by a damper with coefficient b, obeys m x″ + b x′ + k x = 0, where x is the displacement from equilibrium. The spring pulls back with force −kx and the damper resists motion with force −bx′. Without damping the mass oscillates in simple harmonic motion with angular frequency ω₀ = √(k/m) and period 2π√(m/k).
- Underdamped (b² < 4mk): it oscillates with an amplitude that shrinks like e^(−bt/2m).
- Critically damped (b² = 4mk): it returns to equilibrium as fast as possible without overshooting.
- Overdamped (b² > 4mk): it creeps back slowly without oscillating.
A pendulum behaves similarly for small swings: using the small-angle approximation sin θ ≈ θ, it obeys θ″ = −(g/L)θ. (Veylora’s pendulum simulator solves the full non-linear equation instead.)
Logistic growth
dN/dt = rN(1 − N/K) starts like exponential growth but slows as N approaches thecarrying capacity K, because the factor (1 − N/K) shrinks. The solution is the S-shaped curve N(t) = K / (1 + ((K − N₀)/N₀)e^(−rt)). Growth is fastest at N = K/2. N = 0 is an unstable equilibrium and N = K a stable one; if N starts above K it falls back towards K. The logistic equation is a mathematical model used for the spread of new products, rumours, some chemical reactions and, as a first approximation, populations; it is not a law that every real system obeys.
Coupled systems and phase planes
Two quantities can change together: x′ = ax + by, y′ = cx + dy. Instead of graphing each against time, a phase plane plots y against x, with arrows showing the direction (x′, y′) at each point. The equilibrium is at the origin, and its type is set by the eigenvalues of the matrix [a b; c d]:
| Eigenvalues | Equilibrium |
|---|---|
| Real, both negative | Stable node: everything flows straight in |
| Real, both positive | Unstable node: everything flows out |
| Real, opposite signs | Saddle: in along one direction, out along the other (unstable) |
| Complex, negative real part | Stable spiral |
| Complex, positive real part | Unstable spiral |
| Purely imaginary | Centre: closed orbits |
Equivalently: det < 0 gives a saddle; otherwise the trace (a + d) decides stability (negative is stable) and trace² − 4det decides between nodes (positive) and spirals (negative). Along a real eigenvector v the solution is simply e^(λt)v. The undamped spring is exactly such a system with x′ = v and v′ = −(k/m)x, which is a centre.
Numerical solutions and Euler’s method
Most differential equations cannot be solved with a formula, so computers step forward in time. The simplest method,Euler’s method, follows the tangent line for one step of length h:
yₙ₊₁ = yₙ + h · f(tₙ, yₙ), tₙ₊₁ = tₙ + h
Here yₙ is the current estimate, h the time step, f(tₙ, yₙ) the rate of change given by the equation, and yₙ₊₁ the next estimate. Each step makes a small error, and the errors add up; for Euler’s method the total error is roughly proportional to h, so halving h about halves it. Large steps can be inaccurate or even unstable: for dy/dt = −y, each step multiplies y by (1 − h), so if h > 2 the values flip sign and grow even though the true solution decays. The lab’s main simulations use the fourth-order Runge–Kutta method (RK4), which combines four slope estimates per step and has an error roughly proportional to h⁴.
Formula reference
| Equation | Solution and meaning |
|---|---|
| dN/dt = kN | N = N₀e^(kt); N quantity, t time, k growth (k > 0) or decay (k < 0) constant |
| Doubling time / half-life | ln 2 / |k| |
| dT/dt = −k(T − Tₐ) | T = Tₐ + (T₀ − Tₐ)e^(−kt); Tₐ ambient temperature, k > 0 cooling constant |
| m x″ + b x′ + k x = 0 | m mass (kg), b damping (N·s/m), k stiffness (N/m), x displacement (m); ω₀ = √(k/m) |
| Critical damping | b = 2√(mk) |
| dN/dt = rN(1 − N/K) | N = K / (1 + ((K − N₀)/N₀)e^(−rt)); r growth rate, K carrying capacity |
| x′ = ax + by, y′ = cx + dy | Equilibrium type from the eigenvalues of [a b; c d] |
| yₙ₊₁ = yₙ + h·f(tₙ, yₙ) | Euler’s method with step size h |
Real-world applications
- Medicine: drug levels in the blood often decay exponentially, which sets how often doses are taken.
- Forensics: Newton’s law of cooling helps estimate time of death from body temperature (with many corrections in practice).
- Engineering: car suspensions and door closers are designed to be close to critically damped; buildings use dampers against earthquakes.
- Electronics: circuits with resistors, capacitors and inductors obey the same equations as springs and dampers.
- Epidemiology and economics: coupled differential equations model how infections spread and how markets adjust.
- Computing: weather forecasts, spacecraft trajectories and video-game physics all step differential equations forward numerically.
Interesting facts
- Newton’s 1701 paper on cooling was published anonymously.
- Leonhard Euler described his step-by-step method in 1768, long before computers existed to carry it out.
- The logistic equation was introduced by Pierre-François Verhulst in 1838.
- Edward Lorenz discovered chaos in 1963 while numerically solving just three coupled differential equations for a simple weather model.
Common misconceptions
- “A differential equation has one answer.” It has a family of solutions; an initial condition picks one.
- “Cooling happens at a steady rate.” The rate depends on the temperature gap, so cooling slows down.
- “More damping always stops a spring faster.” Beyond critical damping the return gets slower again.
- “The computer’s answer is exact.” Numerical methods are approximations whose accuracy depends on the step size.
- “Exponential growth goes on forever.” In real systems limits, such as a carrying capacity, eventually slow it down.
What the simulator simplifies
All the models are idealised: constant parameters, a perfectly linear spring and damper, a uniform object temperature and a constant room temperature. The simulations use RK4 with small fixed steps; they agree with the exact solutions to many digits, and the difference is shown in the readouts. Time is speeded up or slowed down for display, so “time” in the exponential and logistic models has no fixed unit. The coupled system is linear; real systems are often non-linear, but near an equilibrium they usually behave like their linear approximation.
Important terms
- Differential equation
- An equation linking a function to its rates of change.
- Initial condition
- The starting value that selects one solution.
- Parameter
- A constant in the equation, such as k, r or b, that changes the behaviour.
- Equilibrium
- A state where all rates of change are zero.
- Damping
- A force that resists motion and removes energy from an oscillation.
- Carrying capacity
- The stable maximum K in the logistic model.
- Phase plane
- A plot of one variable against another, with arrows showing how the state moves.
- Euler’s method
- A numerical method that follows the tangent for one step at a time.
Key takeaways
- Differential equations describe change; initial conditions choose the solution.
- Proportional change gives exponentials; change towards a target gives exponential approach (cooling, logistic near K).
- Springs oscillate at √(k/m), and damping decides whether they overshoot.
- Eigenvalues classify the equilibria of linear systems.
- Numerical methods step forward in time; smaller steps are more accurate, and too-large steps can be unstable.