Differential equations
Laws written as rates of change, and how to solve them — exactly when possible, numerically always. Every simulation, from a game engine to a climate model, is a differential equation being integrated.
10 topics
Nature rarely tells us where things are; it tells us how they change: force determines acceleration, the number of infected determines new infections, the error determines the controller's correction. A differential equation states that law; solving it predicts the future from the present. Traditionally a separate course, it is included here in full because it is where calculus becomes simulation.
Topics
Ordinary differential equations
An equation relating an unknown function to its derivatives, . Its solutions are trajectories: given where you start, the equation says where you go next — the mathematical model of anything that evolves in time.
Initial value problems: existence and uniqueness
Picard–Lindelöf: if is Lipschitz in , then , has exactly one solution near . Determinism, mathematically: the present determines the future — and a simulation has a single right answer to approximate.
Separable equations
: put all the on one side and integrate, . Exponential growth and the logistic curve are solved this way.
First-order linear equations
, solved with an integrating factor . The response of every first-order system (thermometer, RC filter, simple capacitor charging) is an exponential approach to equilibrium.
Second-order linear equations (oscillations)
: springs, pendulums, circuits, suspensions. The roots of the characteristic equation decide whether the system oscillates (complex roots), returns smoothly (real roots) or resonates.
Systems of ODEs
Several coupled unknowns, . For linear systems the solution is and the eigenvalues of decide growth, decay and oscillation.
Euler's method
The simplest numerical ODE solver: follow the tangent for a small time step, . First order (error ), easy to destabilize — and, in its semi-implicit form, the default integrator of game physics.
Runge–Kutta methods
Sample the slope at several points inside the step and combine them to cancel error terms. The classic RK4 has
error : halve the step, divide the error by 16. Adaptive pairs (Dormand–Prince, ode45, solve_ivp)
adjust automatically.
Stiffness and implicit methods
Systems with very different time scales (a stiff spring on a slow body) force explicit methods to take tiny steps just to stay stable. Implicit methods, , are stable for any step at the price of solving an equation each step.
Partial differential equations
Equations for fields that depend on space and time, involving partial derivatives: heat diffusion, waves, fluid flow, electromagnetism, quantum mechanics. Solved numerically by discretizing space (finite differences, finite volumes, finite elements, spectral methods).
Where this area leads in computing
⚙ Robotics and control ★★★★★
⚛ Physics and simulation ★★★★★
- Classical mechanics★★★★★←Ordinary differential equations, Second-order linear equations (oscillations)
- Physics engines★★★★★←Ordinary differential equations, Initial value problems: existence and uniqueness, Second-order linear equations (oscillations), Euler's method, Stiffness and implicit methods
- N-body gravitational simulation★★★★★←Systems of ODEs, Runge–Kutta methods
- Heat equation and diffusion★★★★★←Partial differential equations
- Wave equation★★★★★←Partial differential equations
- Fluid dynamics and CFD★★★★★←Partial differential equations
- Finite element method★★★★★←Partial differential equations
- Population and epidemic models★★★★★←Ordinary differential equations, Separable equations, Systems of ODEs
- +1