Mathwords logoMathwords

Dormand–Prince Method — Definition, Formula & Example

The Dormand–Prince method is an adaptive Runge–Kutta method for solving differential equations. Each step produces two estimates, one of 5th order and one of 4th order, from the same seven slope evaluations. The gap between them tells the solver whether to shrink or grow the next step.

The Dormand–Prince method (DOPRI5, 1980) is an explicit, 7-stage embedded Runge–Kutta pair of orders 5(4) for y′=f(t,y)y' = f(t, y). It uses local extrapolation, meaning it advances with the order-5 solution yn+1y_{n+1} and uses the order-4 solution y^n+1\hat{y}_{n+1} only to estimate the error. It also has the FSAL (first same as last) property. The 7th stage k7=f(tn+1,yn+1)k_7 = f(t_{n+1}, y_{n+1}) equals k1k_1 of the next step, so each step after the first costs only 6 new evaluations of ff.

Key Formula

yn+1=yn+h(35384k1+5001113k3+125192k4−21876784k5+1184k6),hnew=0.9 h(tolerr)1/5y_{n+1} = y_n + h\left(\tfrac{35}{384}k_1 + \tfrac{500}{1113}k_3 + \tfrac{125}{192}k_4 - \tfrac{2187}{6784}k_5 + \tfrac{11}{84}k_6\right), \qquad h_{\text{new}} = 0.9\,h\left(\frac{\text{tol}}{\text{err}}\right)^{1/5}
Where:
  • kik_i = Stage slopes ki=f(tn+cih,  yn+h∑j<iaijkj)k_i = f\big(t_n + c_i h,\; y_n + h\sum_{j<i} a_{ij}k_j\big) with nodes c=0,15,310,45,89,1,1c = 0, \tfrac15, \tfrac{3}{10}, \tfrac45, \tfrac89, 1, 1; the weights shown sum to 1
  • yn, yn+1y_n,\ y_{n+1} = Current value and the order-5 value the method keeps
  • hh = Current step size
  • err\text{err} = Error estimate ∣yn+1−y^n+1∣|y_{n+1} - \hat{y}_{n+1}|, where y^n+1\hat{y}_{n+1} is the embedded order-4 value
  • tol\text{tol} = Error tolerance you choose
  • 0.90.9 = Safety factor that keeps the new step slightly conservative

Worked Example

Problem: A DOPRI5 solver takes a step of size h=0.2h = 0.2 and returns an order-5 value yn+1=1.491824y_{n+1} = 1.491824 and an order-4 value y^n+1=1.491826\hat{y}_{n+1} = 1.491826. The tolerance is tol=6.4×10−5\text{tol} = 6.4 \times 10^{-5}. Should the step be accepted, which value is kept, and what step size comes next?
Step 1: Estimate the local error from the difference between the two embedded solutions.
err=∣1.491824−1.491826∣=2×10−6\text{err} = |1.491824 - 1.491826| = 2 \times 10^{-6}
Step 2: Since err<tol\text{err} < \text{tol}, accept the step. Dormand–Prince keeps the more accurate order-5 value. This is local extrapolation. The final slope k7k_7 is saved as the next step's k1k_1.
2×10−6<6.4×10−5  ⟹  yn+1=1.4918242 \times 10^{-6} < 6.4 \times 10^{-5} \implies y_{n+1} = 1.491824
Step 3: The error is far below the tolerance, so the step size grows. The ratio is 6.4×10−52×10−6=32\tfrac{6.4 \times 10^{-5}}{2 \times 10^{-6}} = 32, and 321/5=232^{1/5} = 2.
hnew=0.9×0.2×321/5=0.9×0.2×2=0.36h_{\text{new}} = 0.9 \times 0.2 \times 32^{1/5} = 0.9 \times 0.2 \times 2 = 0.36
Answer: The step is accepted. The solver keeps yn+1=1.491824y_{n+1} = 1.491824 and tries the next step with h=0.36h = 0.36, which needs only 6 new evaluations of ff because of FSAL.

Why It Matters

DOPRI5 is the default nonstiff ODE solver in MATLAB (ode45) and SciPy (solve_ivp with method 'RK45'). Engineers and physics students use it for orbit, circuit, and population models. Knowing how it controls step size helps you pick sensible tolerances and explains why the solver slows down near rapid changes.

Common Mistakes

Mistake: Assuming Dormand–Prince works like Runge–Kutta–Fehlberg and advances with the order-4 value.
Correction: Fehlberg's classic RKF45 advances with the order-4 value. Dormand–Prince chooses coefficients that make the order-5 value accurate and keeps that one. The order-4 value only supplies the error estimate.

Related Terms