Euler vs. Heun vs. RK4 Slope Probe Magnifier
Adjust step size h and zoom into a single time step [t_n, t_n + h] to compare k₁, k₂, k₃, k₄.
Inspect the four intermediate slope probes (k₁, k₂, k₃, k₄) inside a single step h to see how RK4 achieves fourth-order accuracy.
Orbital propagator integration, flight dynamics simulation, autonomous vehicle MPC rollouts, and thermal transient circuit solvers.
Why does forward Euler drift rapidly along curved differential equations—and how do four slope probes inside one step match fourth-order Simpson integration?
Stepping across using only the initial tangent accumulates global error, while Heun's method averages start and predicted-end tangents to reach .
Classical fourth-order Runge–Kutta (RK4) probes the interval midpoint twice () and weights the four slopes with Simpson's ratios, matching Taylor curvature through without ever computing symbolic partial derivatives.
Why does Euler drift rapidly off curved trajectories—and how do four intermediate slope probes (k₁, k₂, k₃, k₄) with weights (1, 2, 2, 1)/6 achieve O(h⁴) global accuracy?
Coarsen step size h ∈ [0.15, 1.1] and scrub the magnified step index [t_n, t_n + h] to compare global trajectories alongside all four live slope needles k₁..k₄.
Test the Stiff Relaxation preset near h = 0.75: Forward Euler crosses 2/|λ| and oscillates violently while RK4 tracks the decaying solution—closing all 6 textbook volumes!
Preparing interactive canvas & numerical solver…
wanna math drafting viewport
Euler freezes the left-edge slope across the entire interval ( global error), whereas Heun averages start and predicted-end tangents ().
Sampling two refined midpoint slopes () doubles midpoint weight to match exact Taylor derivatives through ( global).
Stiff equations force explicit Euler below ; exceeding this threshold triggers exponentially growing sign-flipping oscillations.
Accumulating steps drops convergence by one power of : local per RK4 step yields global error at final time .
When depends purely on time, RK4 reduces identically to Simpson's 1/3 quadrature rule across !
For decay (), Forward Euler blows up beyond , while RK4 extends stability up to .
Adjust step size h and zoom into a single time step [t_n, t_n + h] to compare k₁, k₂, k₃, k₄.
Time-varying forcing tests phase accuracy: notice how Euler phase-leads/overshoots peaks when h ≥ 0.4.