Skip to content

num::ode::debug::verify_order_of_accuracy

Defined in header <ode/debug.hpp>

template <class Advance>
void verify_order_of_accuracy(
    Advance &&advance, const vec<real> &y0, real t0, real t1, real claimed_order,
    real slack = 0.4, std::source_location loc = std::source_location::current());

Measure the observed order of accuracy of a one-step integrator.

Integrates with steps \(h\) and \(h/2\) against a reference at \(h/16\). The error ratio approaches \(2^p\), so its \(\log_2\) recovers \(p\).

Parameters

  • advance: Callable (real t0, real t1, real h, const vec<real> &y0, vec<real> &y1).
  • y0: Initial state.
  • t0: Start of the integration interval.
  • t1: End of the integration interval.
  • claimed_order: The order the method advertises.
  • slack: Tolerated shortfall in the measured order.
  • loc: Call site reported in the diagnostic.