Click canvas to launch trajectories. RK4 integrates the ODE system.
dx/dt = y, dy/dt = -sin(x) - 0.1y
RK4 integrates: k₁=f(t,y), k₂=f(t+h/2, y+hk₁/2), k₃=f(t+h/2, y+hk₂/2), k₄=f(t+h, y+hk₃). Update: y_{n+1} = yₙ + h/6(k₁+2k₂+2k₃+k₄). Global error O(h⁴) per step. Click anywhere to launch a trajectory from that initial condition.