Copyright | Copyright (c) 2009-2017 David Sorokin <david.sorokin@gmail.com> |
---|---|

License | BSD3 |

Maintainer | David Sorokin <david.sorokin@gmail.com> |

Stability | experimental |

Safe Haskell | None |

Language | Haskell2010 |

Tested with: GHC 8.0.1

This module defines auxiliary functions such as interpolation ones that complement the memoization, for example. There are scan functions too.

## Synopsis

- initDynamics :: Dynamics m a -> Dynamics m a
- discreteDynamics :: Dynamics m a -> Dynamics m a
- interpolateDynamics :: Dynamics m a -> Dynamics m a
- scanDynamics :: MonadFix m => (a -> b -> a) -> a -> (Dynamics m a -> Simulation m (Dynamics m a)) -> Dynamics m b -> Simulation m (Dynamics m a)
- scan1Dynamics :: MonadFix m => (a -> a -> a) -> (Dynamics m a -> Simulation m (Dynamics m a)) -> Dynamics m a -> Simulation m (Dynamics m a)

# Interpolation

initDynamics :: Dynamics m a -> Dynamics m a Source #

Return the initial value.

discreteDynamics :: Dynamics m a -> Dynamics m a Source #

Discretize the computation in the integration time points.

interpolateDynamics :: Dynamics m a -> Dynamics m a Source #

Interpolate the computation based on the integration time points only.
Unlike the `discreteDynamics`

function it knows about the intermediate
time points that are used in the Runge-Kutta method.

# Scans

scanDynamics :: MonadFix m => (a -> b -> a) -> a -> (Dynamics m a -> Simulation m (Dynamics m a)) -> Dynamics m b -> Simulation m (Dynamics m a) Source #

Like the standard `scanl`

function but applied to values in
the integration time points. The accumulator values are transformed
according to the third argument, which should be either function
`memo0Dynamics`

or its unboxed version.

scan1Dynamics :: MonadFix m => (a -> a -> a) -> (Dynamics m a -> Simulation m (Dynamics m a)) -> Dynamics m a -> Simulation m (Dynamics m a) Source #

Like the standard `scanl1`

function but applied to values in
the integration time points. The accumulator values are transformed
according to the second argument, which should be either function
`memo0Dynamics`

or its unboxed version.