aivika-1.3: A multi-paradigm simulation library

Stabilityexperimental
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Safe HaskellSafe-Inferred

Simulation.Aivika.Dynamics

Contents

Description

Tested with: GHC 7.6.3

The module defines the Dynamics monad representing a time varying polymorphic function.

Synopsis

Dynamics Monad

data Dynamics a Source

A value in the Dynamics monad represents a polymorphic time varying function.

class DynamicsLift m whereSource

A type class to lift the Dynamics computations to other computations.

Methods

liftDynamics :: Dynamics a -> m aSource

Lift the specified Dynamics computation to another computation.

runDynamicsInStartTime :: Dynamics a -> Simulation aSource

Run the Dynamics computation in the initial time point.

runDynamicsInStopTime :: Dynamics a -> Simulation aSource

Run the Dynamics computation in the final time point.

runDynamicsInIntegTimes :: Dynamics a -> Simulation [IO a]Source

Run the Dynamics computation in all integration time points.

runDynamicsInTime :: Double -> Dynamics a -> Simulation aSource

Run the Dynamics computation in the specified time point.

runDynamicsInTimes :: [Double] -> Dynamics a -> Simulation [IO a]Source

Run the Dynamics computation in the specified time points.

Error Handling

catchDynamics :: Dynamics a -> (IOException -> Dynamics a) -> Dynamics aSource

Exception handling within Dynamics computations.

finallyDynamics :: Dynamics a -> Dynamics b -> Dynamics aSource

A computation with finalization part like the finally function.

throwDynamics :: IOException -> Dynamics aSource

Like the standard throw function.

Simulation Time

time :: Dynamics DoubleSource

Computation that returns the current simulation time.

isTimeInteg :: Dynamics BoolSource

Whether the current time is an integration time.

integIteration :: Dynamics IntSource

Return the integration iteration closest to the current simulation time.

integPhase :: Dynamics IntSource

Return the integration phase for the current simulation time. It is (-1) for non-integration time points.