Skip to content

num::ode_rk45

Defined in header <ode/ode.hpp>

template <typename RHS = ode_rhs_fn, typename State = vec<real>>
requires vector_space<State> && std::invocable<RHS &, real, const State &, State &>
ode_result ode_rk45(RHS f, State y0, ode_params p = {},
                    const observer_fn &observer = {});

Integrate \(\dot{y} = f(t, y)\) with adaptive Dormand--Prince RK45.

observer, if given, is called as observer(t, u) after each accepted step.