This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize for the AI-speak, we are working on rewriting it!
viv-lang.org

Notebooks · lib/ode/dopri5

Dormand and Prince's explicit 5(4) pair

Seven stages give a fifth-order solution and an embedded fourth-order one; their difference estimates the local error, and the step is accepted when that error, weighted by atol + rtol |y|, has RMS norm below 1. The seventh stage is evaluated at the new point, so it is the next step's first stage ("first same as last"): six evaluations per step.

The step controller is the elementary one SciPy's RK45 uses: the next step is h (0.9 / err)^(1/5), changed by at most a factor 10 up and 5 down, and not grown right after a rejection. The dense output is Hairer's fifth-order continuous extension, from the stages already computed.

Each accepted step also estimates h |lambda|, the step times the stiffest eigenvalue the stages saw (Hairer's test, Solving ODEs II, IV.2): 15 steps in a row with h |lambda| above 3.25 mark the problem stiff, which method = AUTO uses to change to Radau IIA.

J. R. Dormand and P. J. Prince, A family of embedded Runge-Kutta formulae, Journal of Computational and Applied Mathematics 6, 19-26 (1980), doi:10.1016/0771-050X(80)90013-3.

Look inside this program

  • Atlas

    The program’s map: every function and which calls which.

  • There’s no recorded run of this program yet.

Shift+Enter in a cell runs it and moves to the next. Running a cell runs every cell above it too, as one program.

[1]lines 25–227