Math & ModelingAdvancedExperiment simulation~25 min

Differential Equations and Dynamic Systems

Most laws of science describe how fast something changes rather than what it equals: a hot drink cools faster when it is hotter, a spring pulls harder the further it is stretched, and a population grows faster when it is bigger. Equations that link a quantity to its rate of change are called differential equations. Set the starting conditions, change the parameters and watch six classic models unfold, then see how a computer solves them one small step at a time.

10
0.3
1
—
—
—
—
—
—
—
—
—
—
—
—

How to use this simulator

  1. Choose a model. Set the starting values and parameters with the sliders, then press Start; Step forward advances a little at a time and Reset starts again.
  2. The blue curve is the computer’s step-by-step (RK4) solution and the dashed orange curve is the exact formula, where one exists. Press Keep this curve, change a value and run again to compare up to three runs.
  3. For the spring, drag the mass and let go, or use the damping buttons. The animation and the graph show the same x(t).
  4. For the coupled system, try the presets and tap the phase plane to launch trajectories.
  5. For Euler’s method, change the step size h and step through the solution; compare the table with the exact values.

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]:

EigenvaluesEquilibrium
Real, both negativeStable node: everything flows straight in
Real, both positiveUnstable node: everything flows out
Real, opposite signsSaddle: in along one direction, out along the other (unstable)
Complex, negative real partStable spiral
Complex, positive real partUnstable spiral
Purely imaginaryCentre: 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

EquationSolution and meaning
dN/dt = kNN = N₀e^(kt); N quantity, t time, k growth (k > 0) or decay (k < 0) constant
Doubling time / half-lifeln 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 = 0m mass (kg), b damping (N·s/m), k stiffness (N/m), x displacement (m); ω₀ = √(k/m)
Critical dampingb = 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 + dyEquilibrium 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.

Knowledge check

Differential Equations and Dynamic Systems: test your understanding

Answer each question to get instant feedback and an explanation. Use the simulator to check your thinking.

10 questions3 basic5 intermediate2 advanced

0 of 10 answered

  1. Q1BasicFor dN/dt = kN with k = −0.2, what happens to N over time?
    Show answer

    Answer: B. It decays exponentially towards 0

    The solution is N = N₀e^(−0.2t). A negative k means the rate of change is negative and proportional to N, so N shrinks ever more slowly towards 0.

  2. Q2IntermediateA quantity follows dN/dt = kN with k = 0.35 per hour. Roughly how long does it take to double?
    Show answer

    Answer: C. 2 hours

    The doubling time is ln 2 / k ≈ 0.693 / 0.35 ≈ 2 hours. It does not depend on the starting amount.

  3. Q3BasicA cup of tea at 90 °C cools in a 20 °C room following dT/dt = −k(T − 20). When is it cooling fastest?
    Show answer

    Answer: A. Right at the start, when the temperature difference is largest

    The cooling rate is proportional to the gap T − 20. The gap is largest at the start, so the temperature falls fastest then, and more and more slowly afterwards.

  4. Q4BasicIn the Newton’s law of cooling model, what temperature does the object approach in the long run?
    Show answer

    Answer: D. The room (ambient) temperature Tₐ

    T(t) = Tₐ + (T₀ − Tₐ)e^(−kt), and e^(−kt) → 0, so T → Tₐ. In this model it approaches Tₐ but never exactly reaches it.

  5. Q5IntermediateA mass on a spring obeys m x″ + b x′ + k x = 0 with m = 1, k = 9. Which damping b makes it critically damped?
    Show answer

    Answer: C. b = 6

    Critical damping is b = 2√(mk) = 2√9 = 6. Smaller b gives oscillations that die away (underdamped); larger b gives a slow creep back (overdamped).

  6. Q6IntermediateIn the spring simulation you double the mass and keep k and b the same (still underdamped). What do you predict?
    Show answer

    Answer: B. It oscillates more slowly, because ω₀ = √(k/m) gets smaller

    The natural angular frequency √(k/m) falls by a factor of √2, so the period gets about 41% longer. Heavier masses respond more sluggishly to the same spring.

  7. Q7IntermediateFor logistic growth dN/dt = rN(1 − N/K), at what value of N is the growth rate largest?
    Show answer

    Answer: D. N = K/2

    rN(1 − N/K) is a parabola in N with its peak halfway between its zeros at 0 and K. That is why the S-shaped curve is steepest at K/2.

  8. Q8AdvancedFor the system x′ = ax + by, y′ = cx + dy, the matrix has eigenvalues −0.5 ± 2i. What do trajectories near the origin look like?
    Show answer

    Answer: C. Spirals that wind into the origin

    The imaginary part makes solutions rotate, and the negative real part makes them shrink like e^(−0.5t): a stable spiral.

  9. Q9IntermediateEuler’s method uses yₙ₊₁ = yₙ + h·f(tₙ, yₙ). What happens to the error at a fixed time if you halve the step size h?
    Show answer

    Answer: A. It roughly halves

    Euler’s method is first order: its global error is roughly proportional to h. Halving h about halves the error, at the cost of twice as many steps.

  10. Q10AdvancedIn the simulator, Euler’s method for dy/dt = −y with h = 2.2 zig-zags and grows instead of decaying. Why?
    Show answer

    Answer: D. Each step multiplies y by 1 − h = −1.2, whose size is greater than 1, so the numbers grow

    For y′ = −y, one step gives yₙ₊₁ = (1 − h)yₙ. This decays only if |1 − h| < 1, that is h < 2. With h = 2.2 the factor is −1.2, so the values flip sign and grow: the method is unstable.

References and further reading

  1. Strang, G., & Herman, E. (2016). Calculus Volume 2, Chapter 4: Introduction to Differential Equations. OpenStax. openstax.org (opens in a new tab)
  2. Boyce, W. E., DiPrima, R. C., & Meade, D. B. (2017). Elementary Differential Equations and Boundary Value Problems (11th ed.). Wiley.
  3. Strogatz, S. H. (2015). Nonlinear Dynamics and Chaos (2nd ed.). Westview Press.
  4. Burden, R. L., Faires, J. D., & Burden, A. M. (2016). Numerical Analysis (10th ed.), Chapter 5: Initial-Value Problems for Ordinary Differential Equations. Cengage.

This simulator is a simplified educational model. Found an error? Let us know. See our educational disclaimer.