ẏ Simulation
How a computer predicts motion: differential equations, numerical integrators, stability and chaos.
- 01
Derivative
is the instantaneous rate of change of at : the slope of the tangent line to the graph, defined as the limit of slopes of secant lines.
- 02
Definite integral
is the limit of Riemann sums: the signed area between the graph and the axis, or, more generally, the total accumulated by a rate over .
- 03
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.
- 04
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.
- 05
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. - 06
Systems of ODEs
Several coupled unknowns, . For linear systems the solution is and the eigenvalues of decide growth, decay and oscillation.
- 07
Dynamical systems
A state and a rule that moves it forward: continuous () or discrete (). The questions change from "find the formula" to "what happens in the long run?" — and every iterative algorithm, from gradient descent to a recurrent network, is a discrete dynamical system.
- 08
Equilibria and stability
An equilibrium is stable if nearby states stay nearby (and asymptotically stable if they return). Linearize: if every eigenvalue of the Jacobian has negative real part, it is asymptotically stable.
- 09
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.
- 10
Chaos and sensitivity to initial conditions
Deterministic systems whose nearby trajectories separate exponentially, with . Prediction is possible only up to a horizon of about : better measurements buy time only logarithmically.
- 11
Physics engines
Software that advances a world of bodies in small time steps: accumulate forces, integrate velocities and positions (semi-implicit Euler or Verlet), detect collisions, resolve contacts. A numerical ODE solver tuned for speed and stability rather than accuracy.