module Physics.Hpysics.ODE where import Physics.Hpysics.Types import Physics.Hpysics.Utils type Integrator = (FloatType -> Vec4 -> Vec4) -- function to integrate f(t,x) -> FloatType -- step size dt -> FloatType -- t0 -> Vec4 -- x0 -> Vec4 -- state at t0+dt eulerIntegrator :: Integrator eulerIntegrator f dt t0 x0 = x0 `add4` dt `scale4` f t0 x0