fhat. GitHub Workspace

Dormand-Prince RK45

Solve a general ODE to a requested tolerance, with output at any time.

errorO(h5)cost6 f / stepexplicit · adaptive steps · dense output

Also known as DOPRI5, ode45

Placeholderv0.1.2Example

Use with your agent

Use the fhat method "dormand-prince-rk45" (https://fhat.dev/methods/dormand-prince-rk45/SKILL.md) for this problem. Check first whether it applies.

Placeholder (demo). Description only: there is no reference implementation or verification for this entry yet. It belongs to a demonstration set of textbook methods.

What it does

Each step computes two solutions, of order 5 and order 4, from the same seven stages. Their difference estimates the local error, which drives the step size up or down to meet the requested tolerance. The last stage of one step is the first stage of the next (FSAL), so each accepted step costs six new evaluations. A built-in interpolant gives output at any time between steps without shortening them.

When to use

  • General non-stiff ODEs, including damped, driven or velocity-dependent dynamics.
  • When you do not know a good step size, the dynamics speed up and slow down, or you need output at prescribed times.

When not to use (and what to use instead)

Situation Use instead
Very long runs of a conservative mechanical system where energy must not drift stormer-verlet or yoshida4 at a fixed step
Stiff problem: the step size collapses and runs become very slow backward-euler, or a higher-order stiff solver (BDF, Radau IIA; not in this library)
Holonomic constraints (fixed bond lengths) A constrained integrator such as RATTLE (not in this library)

Key facts

Order 5 with an embedded order-4 error estimate, explicit, adaptive step size, dense output, not symplectic, conditionally stable, six new evaluations per accepted step.

Sources

The methods shown are examples. More research methods are coming.