std::function< void(real t, const Vector &q, const Vector &v)> SymplecticCallback
std::function< void(real t, const Vector &y, Vector &dydt)> ODERhsFn
Right-hand side callable: fills dydt = f(t, y) in-place.
ODEResult ode_rk45(ODERhsFn f, Vector y0, real t0, real t1, real rtol=1e-6, real atol=1e-9, real h0=1e-3, idx max_steps=1000000, StepCallback on_step=nullptr)
constexpr T ipow(T x) noexcept
Compute x^N at compile time via repeated squaring.
SymplecticResult ode_yoshida4(AccelFn accel, Vector q0, Vector v0, real t0, real t1, real h, SymplecticCallback on_step=nullptr)
SymplecticResult ode_verlet(AccelFn accel, Vector q0, Vector v0, real t0, real t1, real h, SymplecticCallback on_step=nullptr)
ODEResult ode_rk4(ODERhsFn f, Vector y0, real t0, real t1, real h, StepCallback on_step=nullptr)
Classic 4th-order Runge-Kutta (fixed step).
std::function< void(real t, const Vector &y)> StepCallback
std::function< void(const Vector &q, Vector &acc)> AccelFn
ODEResult ode_euler(ODERhsFn f, Vector y0, real t0, real t1, real h, StepCallback on_step=nullptr)
Result returned by general ODE integrators.
Vector y
Final state vector.
idx steps
Number of (accepted) steps taken.
bool converged
Always true for fixed-step; false if rk45 hit max_steps.
Result returned by symplectic integrators.
Vector v
Final generalised velocities.
Vector q
Final generalised positions.
idx steps
Number of steps taken.