Skip to content

num::ode_rk4_2nd

Defined in header <ode/ode.hpp>

template <typename Accel = accel_fn, typename State = vec<real>>
requires vector_space<State> && std::invocable<Accel &, const State &, State &>
symplectic_result ode_rk4_2nd(Accel accel, State q0, State v0, ode_params p = {},
                              const symp_observer_fn &observer = {});

Integrate \(\ddot{q} = a(q)\) with fourth-order Nystrom Runge--Kutta.

observer, if given, is called as observer(t, q, v) after each step.