Butcher Stage Evaluator
Evaluates intermediate vector fields k₁ = f(t, y), k₂ = f(t + h/2, y + h k₁/2), k₃ = f(t + h/2, y + h k₂/2), k₄ = f(t + h, y + h k₃).
Implement the classical four-stage Runge-Kutta (RK4) algorithm for nonlinear dynamical systems, analyze the Butcher tableau, evaluate the four intermediate slope evaluations k₁, k₂, k₃, k₄, and verify the fourth-order O(h⁴) global truncation error convergence. Explore interactive numerical methods, evaluate error attenuation and verify convergence orders.
Ready to execute Step = 1.
Adjust Step, then execute computation.
Mathematical operations are computed deterministically using 64-bit IEEE 754 precision. Residuals reflect ordinary least-squares regression across successive observations.
RK4 is an explicit algorithm: on stiff problems with rapid decay modes, it requires impractically small time steps to maintain stability. The simulation executes classical RK4 for time steps h = 0.20 / 2^{k-1} on the nonlinear test IVP y' = y cos(t). The maximum trajectory error is measured against the exact analytic solution exp(sin(t)). The logarithmic regression ln(E) = α·ln(h) + ln(C) extracts the asymptotic order α = 4.000 with R² = 1.000000.
Evaluates intermediate vector fields k₁ = f(t, y), k₂ = f(t + h/2, y + h k₁/2), k₃ = f(t + h/2, y + h k₂/2), k₄ = f(t + h, y + h k₃).
Assembles the weighted Simpson-like increment y_{n+1} = y_n + (h/6) [k₁ + 2 k₂ + 2 k₃ + k₄].
Computes exact reference solution y(t) = exp(sin(t)) to determine instantaneous and maximum global error.
Demonstrates why achieving order p = 5 requires 6 stages, making 4-stage RK4 the sweet spot of computational efficiency.
Plots the stability boundary |1 + z + z²/2 + z³/6 + z⁴/24| = 1 in the complex z = λh plane.
Computes ordinary least-squares slope on (ln(h), ln(E_max)) to verify fourth-order convergence α = 4.000.
Implement the classical four-stage Runge-Kutta (RK4) algorithm for nonlinear dynamical systems, analyze the Butcher tableau, evaluate the four intermediate slope evaluations k₁, k₂, k₃, k₄, and verify the fourth-order O(h⁴) global truncation error convergence. Standardized input settings: 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 step.
Set up dy/dt = y cos(t) with y(0) = 1.0 on t ∈ [0, π], verifying the exact solution y(t) = exp(sin(t)).
Assign step sizes h = 0.20 / 2^{k-1} across refinement levels k = 1 to 6 (h ∈ [0.20, 0.10, 0.05, 0.025, 0.0125, 0.00625]).
At each time step, compute initial slope k₁, two midpoint trial slopes k₂ and k₃, and endpoint trial slope k₄.
Advance state vector via y_{n+1} = y_n + (h/6) [k₁ + 2k₂ + 2k₃ + k₄] and update time t_{n+1} = t_n + h.
Sample trajectory across all time nodes and record maximum absolute error E_max = ||y(t_n) - y_n||_∞.
Plot ln(E_max) versus ln(h) and compute the linear regression gradient to confirm α = 4.000 with R² = 1.000000.
Points are your recorded observations. The solid regression line validates Runge-Kutta Fourth-Order (RK4) mathematical scaling.
| # | Time Step Setting (k) (step) | RK4 Global Error ||y - y_num||_∞ (error) | Logarithmic Time Step ln(h) | Logarithmic Global Error ln(E_max) | Remove |
|---|
No readings yet. Execute a computation and record it.