aivika-0.4.2: A multi-paradigm simulation library

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

Simulation.Aivika.Dynamics.Simulation

Description

Tested with: GHC 7.0.3

The module defines the Simulation monad representing a simulation run.

Synopsis

Documentation

data Simulation a Source

A value in the Simulation monad represents a simulation run.

class Monad m => SimulationLift m whereSource

A type class to lift the simulation computations in other monads.

Methods

liftSimulation :: Simulation a -> m aSource

Lift the specified Simulation computation in another monad.

data Specs Source

It defines the simulation specs.

Constructors

Specs 

Fields

spcStartTime :: Double

the start time

spcStopTime :: Double

the stop time

spcDT :: Double

the integration time step

spcMethod :: Method

the integration method

Instances

data Method Source

It defines the integration method.

Constructors

Euler

Euler's method

RungeKutta2

the 2nd order Runge-Kutta method

RungeKutta4

the 4th order Runge-Kutta method

Instances

runSimulation :: Simulation a -> Specs -> IO aSource

Run the simulation using the specified specs.

runSimulations :: Simulation a -> Specs -> Int -> [IO a]Source

Run the given number of simulations using the specified specs, where each simulation is distinguished by its index simulationIndex.

simulationIndex :: Simulation IntSource

Return the run index for the current simulation.

simulationCount :: Simulation IntSource

Return the number of simulations currently run.

simulationSpecs :: Simulation SpecsSource

Return the simulation specs