RigorMed
← Research resources

Mathematics and physics

How to check time-step convergence for an ODE solver

Choose a quantity of interest such as the endpoint, peak, or event time. Refine the time step and compare the same output or event across runs.

Mathematics and physics

Gather equations, initial values, integration interval, parameters, solver version, and the required accuracy. Write the comparison quantities and tolerances before inspecting the results.

Fixed-step methods can use a sequence of step sizes. For adaptive methods, record tolerances and maximum step separately from output sampling times.

How to do it

  1. Freeze the model and comparison times

    Hold equations, parameters, initial values, and end time fixed. Align outputs at common times. For events, record the event function and crossing direction.

  2. Refine systematically

    For fixed-step methods, try halving the step. For adaptive methods, tighten rtol and atol under otherwise comparable settings and assess max_step separately when needed. Compare the most important states and events.

  3. Choose a reference

    Use an analytic solution when available. Otherwise use a justified finer solution or independent numerical method and describe limitations of that reference.

  4. Report errors, cost, and decisions

    Save settings, work or runtime, and the largest relevant differences. If estimating observed order, explain the error and ratios used. Investigate roundoff, stiffness, events, and settings when refinement stops improving results.

Worked example

Teaching example y′ = −y with y(0) = 1, using explicit Euler to t = 1. The exact value exp(−1) is about 0.367879.

Worked example
Time stepEuler endpointAbsolute error
0.250.316406About 0.051473
0.1250.343609About 0.024271
0.06250.356074About 0.011805

Errors roughly halve as the step is halved, consistent with first-order behavior in this example. A real report should include relevant time intervals, events, and the chosen reference.

Common questions

Does a denser t_eval make a solution more accurate?

t_eval specifies output times. Internal step size and error control follow the solver settings.

Is a stable endpoint enough?

Check peaks or event times if the study relies on them. Intermediate errors can differ from endpoint error.

Verified sources

The official sources below were checked on 2026-11-13. Access conditions and update dates are rechecked before publication.

  1. SciPy — solve_ivp reference
  2. NASA NPARC — Examining Temporal Convergence

RigorMed workspace

Review my time-step convergence record

Bring equations, solver settings, outputs at several resolutions, and common comparison times. Prepare an error table and report notes for review.