Ordinary differential equations

Level UniversityDifficulty ★★★★★Concept⌖ Open in the map

What is it?

An equation relating an unknown function to its derivatives, y′=f(t,y)y' = f(t, y). Its solutions are trajectories: given where you start, the equation says where you go next — the mathematical model of anything that evolves in time.

Why does it exist?

Most laws of science are local in time: Newton's F=maF = ma, radioactive decay, chemical kinetics, population growth. They do not give the state as a formula of tt but the rate at which it changes given the current state. ODEs are how those laws are written, and solving them is how predictions are made.

Intuition

Picture a slope field: at every point (t,y)(t, y) a tiny arrow with slope f(t,y)f(t, y). A solution is a curve that is tangent to the arrows everywhere — like a leaf carried by a stream. Different starting points give different curves; the initial condition picks one.

Formal definition

An ODE of order nn: F(t,y,y′,…,y(n))=0F\big(t, y, y', \dots, y^{(n)}\big) = 0. Any order-nn ODE can be rewritten as a first-order system 𝐲′=𝐟(t,𝐲)\mathbf{y}' = \mathbf f(t, \mathbf y) with 𝐲∈ℝn\mathbf y \in \R^n (introduce y1=y,y2=y′,…y_1 = y, y_2 = y', \dots) — the form numerical solvers use.

Formulas

y′=f(t,y),y(t0)=y0y' = f(t, y), \qquad y(t_0) = y_0
m x¨=F(x,x˙,t)  ⟺  {x˙=vv˙=F(x,v,t)/mm\,\ddot x = F(x, \dot x, t) \iff \begin{cases}\dot x = v\\ \dot v = F(x, v, t)/m\end{cases}
Newton's law as a first-order system

Example

Cooling: T′=−k(T−Troom)T' = -k(T - T_{\text{room}}). Solution T(t)=Troom+(T0−Troom)e−ktT(t) = T_{\text{room}} + (T_0 - T_{\text{room}})e^{-kt}. A CPU heat sink, a cup of coffee and an RC circuit obey the same equation.

Why does it matter?

Physics engines, circuit simulators (SPICE), epidemiological models, pharmacokinetics, orbital mechanics and control systems are ODE solvers wrapped in domain knowledge. In AI, neural ODEs make the network itself a differential equation, and diffusion models generate images by integrating one backwards in time.

Where it shows up in computing

  • Physics engines★★★★★fundamentalPhysics and simulation

    A physics engine integrates x˙=v\dot x = v, v˙=F/m\dot v = F/m for every body, every frame.

  • Classical mechanics★★★★★fundamentalPhysics and simulation

    Newton's second law is a second-order ODE.

  • Population and epidemic models★★★★★fundamentalPhysics and simulation

    Logistic growth, predator–prey and SIR epidemics are ODE models.

  • Control theory★★★★★fundamentalRobotics and control

    Plants and controllers are described by ODEs; control designs their closed-loop behaviour.

Where it shows up in AI

  • Neural ODEs★★★★★fundamentalAI and machine learning

    A neural ODE defines the hidden state by h′(t)=fθ(h,t)h'(t) = f_\theta(h, t) and calls an ODE solver as a layer.

Where is it used?

Computing topics reachable from here, through the chain of ideas that leads to them:

What depends on it

Exercises

1Computation

Rewrite y′′+3y′+2y=sin⁡ty'' + 3y' + 2y = \sin t as a first-order system.

Solution

With y1=yy_1 = y, y2=y′y_2 = y': y1′=y2y_1' = y_2, y2′=sin⁡t−2y1−3y2y_2' = \sin t - 2y_1 - 3y_2.

2Applied

A server room at 35 °C cools to 30 °C in 10 min with the AC at 20 °C. When does it reach 22 °C?

Solution

T−20=15e−ktT - 20 = 15e^{-kt}; 10=15e−10k⇒k=ln⁡(1.5)/1010 = 15e^{-10k} \Rightarrow k = \ln(1.5)/10. 2=15e−kt⇒t=10ln⁡7.5/ln⁡1.5≈49.72 = 15e^{-kt} \Rightarrow t = 10\ln 7.5/\ln 1.5 \approx 49.7 min.

↑ ↓ to navigate · ↵ · Esc