Mathematics / Adaptive RKF45 Integration
FREE TO EXPLORE
LABORATORY 34 · MATHEMATICS

Adaptive RKF45 Integration lab report

A worked adaptive rkf45 integration lab report with iteration data tables, logarithmic graphs, calculations, uncertainty and conclusions.

WORKED EXAMPLE · BENCHMARK OBSERVATIONS

A complete example laboratory report.

Simulated demonstration data.

This report illustrates formal numerical analysis, iteration tracking, and convergence rate extraction. Replace its observations with your own computational telemetry when preparing a practical submission.

Student: __________________Student ID: __________________Course: __________________Date: __________________Partner: __________________Instructor: __________________

1. Title and aim

Adaptive Step-Size Control & Embedded Runge-Kutta-Fehlberg (RKF45). Implement the embedded Runge-Kutta-Fehlberg (RKF45) algorithm, evaluate the six-stage shared Butcher tableau, compute the embedded local truncation error estimate, and verify the fifth-order O(h⁵) local error scaling governing optimal step-size adaptation.

2. Abstract

Six computational trials were executed across standardized inputs Step = 1.0 to Step = 6.0 for Adaptive Step-Size Control & Embedded Runge-Kutta-Fehlberg (RKF45). An ordinary least-squares regression yielded an empirical Fehlberg Local Error Exponent (α) of 5.000 order (difference from theoretical reference = 0.0000%). The empirical telemetry conclusively validates the theoretical model and complexity scaling with R² = 1.000000.

3. Apparatus and fixed settings

4. Theory and graph choice

In realistic computational physics and engineering simulations—from planetary spacecraft trajectories navigating close lunar flybys to chemical combustion fronts—dynamical timescales change by orders of magnitude along a single trajectory. Forcing a fixed step size results in either intolerable inaccuracy in violent regions or massive computational waste in smooth regions. Erwin Fehlberg made a historic breakthrough in 1969 by designing embedded Runge-Kutta pairs: two Runge-Kutta methods of orders p and p + 1 sharing the exact same intermediate stage evaluations. By subtracting the two solutions, the solver obtains a rigorous estimate of the local truncation error without performing any extra function evaluations, enabling automatic closed-loop PI step size adaptation. In this computational laboratory, we implement the embedded RKF45 algorithm, analyze the six-stage Butcher tableau, and verify the fifth-order O(h⁵) local error scaling.

ln(E_local) = α · ln(h) + ln(C)

The mathematical regression linearizes the relationship into the form y = mx + b. Here, the independent variable x represents Logarithmic Time Step ln(h), and the dependent variable y represents Logarithmic Local Error ln(E_local). The slope m directly extracts Fehlberg Local Error Exponent (α), while the intercept b accounts for residual baseline offsets.

5. Method

  1. Set up dy/dt = -y² + t on t ∈ [0, 2] with initial state y(0) = 0.5 and user-specified error tolerance TOL = 10⁻⁶.
  2. Set step sizes h = 0.20 / 2^{k-1} across refinement settings k = 1 to 6 to analyze local error scaling.
  3. Compute k₁, k₂, k₃, k₄, k₅, k₆ using Fehlberg's rational weight matrix in 64-bit precision.
  4. Compute difference E_local = h |(1/360) k₁ - (128/4275) k₃ - (2197/75240) k₄ + (1/50) k₅ + (2/55) k₆|.
  5. Calculate recommended next step h_{opt} = 0.9 · h · (TOL / E_local)^{0.2} with safety clamping [0.2, 5.0].
  6. Plot ln(E_local) versus ln(h) and compute the linear regression slope to verify α = 5.000 with R² = 1.000000.

6. Observations and calculation table

All iterative observations use strictly controlled 64-bit IEEE 754 precision buffers. Residuals are computed relative to the ordinary least-squares regression line.

Table 1. Six simulated observations; x and y represent transformed mathematical metrics.
No.Local Step Size Level (k) (step)Embedded Local Error Estimate |y₅ - y₄| (local error)Logarithmic Time Step ln(h)Logarithmic Local Error ln(E_local)Fitted yResidual
11.07.1e-05-1.6094-9.5470-9.54700.0000
22.02e-06-2.3026-13.0130-13.01300.0000
33.00.0-2.9957-16.4785-16.47850.0000
44.00.0-3.6889-19.9445-19.94450.0000
55.00.0-4.3820-23.4100-23.41000.0000
66.00.0-5.0752-26.8760-26.87600.0000

Download the sample observations (CSV) ↓

7. Worked calculation for one observation

For step k = 1.0: Logarithmic mesh coordinate x = ln(h) = -1.6094. Logarithmic error y = ln(E) = α · ln(h) + ln(C) = -9.5470. Empirical error: 0.000071.

8. Graph, gradient and final calculation

-29.48-5.49-23.84-4.42-18.21-3.34-12.58-2.27-6.95-1.19Logarithmic Time Step ln(h)Logarithmic Local Error ln(E_local)

Circular markers represent empirical computational observations. The solid line represents the ordinary least-squares linear fit.

x̄ = -3.34230; ȳ = -18.21150
Σ(x − x̄)² = 8.40810
Σ(x − x̄)(y − ȳ) = 42.04050
m = Σ(x − x̄)(y − ȳ) / Σ(x − x̄)² = 5.00000000
b = ȳ − mx̄ = -1.50000000
ln(E) = 5.0000 · ln(h) + -1.5000 ⟹ α = 5.000 (theoretical α = 5.0)

9. Uncertainty and comparison

Percentage difference = |estimate − theoretical value| / |theoretical value| × 100 = 0.0000%.

For n = 6 observations, Σresidual² = 4.1021e-29; s² = Σresidual²/(n − 2). Gradient standard error = √[s²/Σ(x − x̄)²] = 1.1044e-15. Intercept standard error = √[s²(1/n + x̄²/Σ(x − x̄)²)] = 3.9159e-15.

Propagating the fit parameters yields a fit standard error of 1.1044e-15 order, with an ideal coefficient of determination R² = 1.000000.

In computational mathematics and numerical analysis, errors arise from algorithmic discretization, finite precision IEEE 754 floating-point arithmetic (machine epsilon ε_mach ≈ 2.22 × 10⁻¹⁶ for 64-bit double precision), and condition number propagation. The ordinary least-squares fit across n = 6 standardized observations provides standard errors for the gradient and intercept. Because the mathematical recurrence is evaluated with high numerical precision, the residual sum of squares is vanishingly small, yielding a coefficient of determination R² ≥ 0.999999 and confirming the theoretical mathematical model.

10. Result and discussion

Fehlberg Local Error Exponent (α) = 5.000 order
Theoretical reference value: 5.000 order

The empirical benchmark observations provide rigorous quantitative verification of Adaptive Step-Size Control & Embedded Runge-Kutta-Fehlberg (RKF45). In numerical analysis, scientific computing, and computational mathematics, algorithms are characterized by their asymptotic operational scaling, stability, and convergence rates. Across all six observations, the empirical slope m = 5.0000 confirms the theoretical model with near-zero residual variance. Furthermore, comparison with alternative algorithmic paradigms underscores critical trade-offs between memory footprint, condition number sensitivity, and operational throughput. The algorithm's behavior confirms the mathematical predictions established by numerical analysis literature.

11. Precautions and limitations

RKF45 is an explicit embedded pair; on stiff differential equations, the step controller will drastically shrink h to satisfy stability rather than accuracy. The simulation evaluates the embedded local truncation error of the six-stage RKF45 algorithm across step sizes h = 0.20 / 2^{k-1}. The local error estimate scales with the fifth power of h. The logarithmic regression ln(E_local) = α·ln(h) + ln(C) extracts the asymptotic order α = 5.000 with R² = 1.000000.

12. Conclusion

This computational laboratory investigation quantitatively verified the mathematical formulation and asymptotic scaling of Adaptive Step-Size Control & Embedded Runge-Kutta-Fehlberg (RKF45). Through rigorous tracking across six observation points, we confirmed an empirical Fehlberg Local Error Exponent (α) of 5.000 order matching the theoretical reference 5.000 order within 0.0000% error. The investigation demonstrates why this method serves as an indispensable tool in modern computational science.