Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Integrators
Description
Implements fourth, fifth, and eighth order Runge-Kutta integration methods for time independent second order differential equations using the classic fourth order, Dormand-Prince fifth order, and Cooper-Verner eigth order coefficients respectively. The Gauss-Jackson coefficients are generated to arbitrary order, but using RKCV8 for the startup conditions necessarily restricts the order to eigth order at most, though correction steps can more or less minimise that loss. For some inputs RK4 instead of RKCV8 or RKDP5 may make more sense for startup.
Synopsis
- rk4 :: (Floating t, Eq t) => Integrator t
- rkdp5 :: (Floating t, Eq t) => Integrator t
- rkcv8 :: (Floating t, Eq t) => Integrator t
- timeIndepRK :: (Floating t, Eq t) => BTabTIndep t -> (Vec2 t -> Vec2 t) -> Vec2 t -> t -> Vec2 t
- data Integrator t
Documentation
rkdp5 :: (Floating t, Eq t) => Integrator t Source #
Dormand-Prince fifth order method. A less general RK method could avoid the final b calculation and the first f calculation of the next step with this one due to the coefficient choice.
timeIndepRK :: (Floating t, Eq t) => BTabTIndep t -> (Vec2 t -> Vec2 t) -> Vec2 t -> t -> Vec2 t Source #
timeIndepRK
implements the general Runge-Kutta form for a time independent
differential equation \(f\).
timeIndepRK
btab f yn dt
steps one step forward in the described
time-independent Runge-Kutta method where btab
describes the implementation
Butcher-Tableu, f
the differetial function, rn
the current position and
velocity, and dt
the integration time step.
Note that \(f\) operates on both position and velocity, i.e. it returns both \(\dot{\vec{r}}\) and \(\ddot{\vec{r}}\) and that the Butcher-Tableu's used must have the \(a_{ij}\) and \(b_i\) coefficients in reverse row order. That is, each row is in reverse order.
data Integrator t Source #
Data class encapsulating the concept of an integrator function