wanna mathMath ain't scary (not anymore)
4-Tier Textbook Index • Vol → Mod → Ch → Lab

Engineering Mathematics Volumes I–VI

6 Volumes • 20 Modules • 85 ChaptersFull Matrix →
4-Tier Statistics Index • Vol S → Mod → Ch → Lab

Interactive Statistics (S.1–S.6)

6 Modules • 18 ChaptersStatistics Index →
CHAPTER 6.2.5 • 2DPublished Interactive Labs~30 min study

Euler, Heun & Runge-Kutta (RK4) Trajectory Stepping

Inspect the four intermediate slope probes (k₁, k₂, k₃, k₄) inside a single step h to see how RK4 achieves fourth-order accuracy.

Engineering & Physical Application Context

Orbital propagator integration, flight dynamics simulation, autonomous vehicle MPC rollouts, and thermal transient circuit solvers.

Governing Mathematical Formulation
yn+1=yn+h6(k1+2k2+2k3+k4)y_{n+1} = y_n + \frac{h}{6}(k_1 + 2k_2 + 2k_3 + k_4)
Volume VI • Module 6.21 Interactive Lab(s)

The Question You Should Ask

Why does forward Euler drift rapidly along curved differential equations—and how do four slope probes (k1,k2,k3,k4)(k_1, k_2, k_3, k_4) inside one step match fourth-order Simpson integration?

In Simple Words & Math

Stepping across [tn,tn+h][t_n, t_n+h] using only the initial tangent k1=f(tn,yn)k_1 = f(t_n, y_n) accumulates O(h)O(h) global error, while Heun's method averages start and predicted-end tangents to reach O(h2)O(h^2).

Classical fourth-order Runge–Kutta (RK4) probes the interval midpoint twice (k2,k3k_2, k_3) and weights the four slopes with Simpson's (1,2,2,1)/6(1, 2, 2, 1)/6 ratios, matching Taylor curvature through h4h^4 without ever computing symbolic partial derivatives.

4-Step Pedagogical Chapter Rhythm • Geometric Intuition First
Ch. 6.2.5
STEP 1 • GEOMETRIC QUESTION

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?

STEP 2 • INTERACTIVE LAB EXPLORATION

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₄.

STEP 3 • SYMBOLIC FORMALIZATION
yn+1=yn+h6(k1+2k2+2k3+k4)y_{n+1} = y_n + \frac{h}{6}(k_1 + 2k_2 + 2k_3 + k_4)
STEP 4 • EDGE CASES & NEXT BRIDGE

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!

Interactive Laboratories in Chapter 6.2.5
Initializing Interactive Laboratory
LOADING MODULE

Preparing interactive canvas & numerical solver…

wanna math drafting viewport

Taylor Matching, Simpson Equivalence & Step Stability

1. EULER VS. HEUN PREDICTOR
yn+1Heun=yn+h2 ⁣(f(tn,yn)+f(tn+1,yn+hk1))y_{n+1}^{\text{Heun}} = y_n + \frac{h}{2}\!\left(f(t_n,y_n) + f(t_{n+1}, y_n + h k_1)\right)

Euler freezes the left-edge slope across the entire interval (O(h)O(h) global error), whereas Heun averages start and predicted-end tangents (O(h2)O(h^2)).

2. BUTCHER WEIGHTS & SIMPSON LINK
kˉ=16(k1+2k2+2k3+k4)→f(t)Simpson’s 13\bar{k} = \frac{1}{6}(k_1 + 2k_2 + 2k_3 + k_4) \xrightarrow{f(t)} \text{Simpson's } \frac{1}{3}

Sampling two refined midpoint slopes (k2,k3k_2, k_3) doubles midpoint weight to match exact Taylor derivatives through h4h^4 (O(h4)O(h^4) global).

3. NUMERICAL STABILITY REGION
y′=λy  ⟹  ∣1+hλ∣≤1    (Euler),∣RRK4(hλ)∣≤1y' = \lambda y \implies |1 + h\lambda| \le 1 \;\;(\text{Euler}), \quad |R_{\text{RK4}}(h\lambda)| \le 1

Stiff equations force explicit Euler below h=2/∣λ∣h = 2/|\lambda|; exceeding this threshold triggers exponentially growing sign-flipping oscillations.

Truncation Order & Step Stability • Ch. 6.2.5

Local vs. Global Truncation Error & RK4 Stability

Open ODE Stepper Formulas →
1. LOCAL VS. GLOBAL ORDER

Accumulating N=(T−t0)/hN = (T-t_0)/h steps drops convergence by one power of hh: local O(h5)O(h^5) per RK4 step yields global O(h4)O(h^4) error at final time TT.

2. DERIVATIVE-FREE TAYLOR MATCH

When f(t,y)=f(t)f(t, y) = f(t) depends purely on time, RK4 reduces identically to Simpson's 1/3 quadrature rule across [tn,tn+h][t_n, t_n + h]!

3. EXPLICIT STABILITY GUARD

For decay y′=λyy' = \lambda y (λ<0\lambda < 0), Forward Euler blows up beyond h>2/∣λ∣h > 2/|\lambda|, while RK4 extends stability up to h≈2.785/∣λ∣h \approx 2.785/|\lambda|.

Chapter 6.2.5 Laboratory Specifications

1 Interactive Lab(s)
LAB 6.2.5.1Component: RungeKuttaSlopeLab

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₄.

k1=f(tn,yn),  k2=f(tn+h2,yn+h2k1)k_1 = f(t_n, y_n),\; k_2 = f(t_n + \tfrac{h}{2}, y_n + \tfrac{h}{2}k_1)