aivika-2.1: A multi-paradigm simulation library

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

Simulation.Aivika.Dynamics

Contents

Description

Tested with: GHC 7.8.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.

Instances

Monad Dynamics 
Functor Dynamics 
MonadFix Dynamics 
Applicative Dynamics 
MonadIO Dynamics 
ParameterLift Dynamics 
SimulationLift Dynamics 
DynamicsLift Dynamics 
ResultComputing Dynamics 
Eq (Dynamics a) 
Floating a => Floating (Dynamics a) 
Fractional a => Fractional (Dynamics a) 
Num a => Num (Dynamics a) 
Show (Dynamics a) 

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 :: Exception e => Dynamics a -> (e -> 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 :: Exception e => e -> 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.