The purple bob is a high-accuracy reference (RK4, dt=0.002s). The orange bob
runs your chosen method at your chosen timestep. A good simulation stays close
to the reference and conserves energy; a poor one — large dt with plain Euler —
visibly drifts and gains or loses energy it shouldn't have.
θ'' = −(g/L)·sin(θ)
Euler: θ_{n+1} = θ_n + ω_n·dt, ω_{n+1} = ω_n − (g/L)sin(θ_n)·dt
RK4: four weighted slope evaluations per step (much smaller error per dt)
E = ½L²ω² + gL(1 − cosθ) (should stay constant — undamped pendulum)
- Timestep dt — how coarsely time is sliced; larger dt is cheaper (fewer steps/s) but less accurate.
- Method — Euler is simple but only first-order accurate; RK4 is fourth-order, far more accurate per step.
- Energy drift — the practical accuracy metric simulation engineers watch: it should hover near 0%.
This trade-off — accuracy vs computational cost — is exactly what "evaluating simulation performance" means in practice.