aivika-0.5: A multi-paradigm simulation library

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

Simulation.Aivika.Dynamics.SystemDynamics

Contents

Description

Tested with: GHC 7.0.3

This module defines integrals and other functions of System Dynamics.

Synopsis

Maximum and Minimum

maxDynamics :: Ord a => Dynamics a -> Dynamics a -> Dynamics aSource

Return the maximum.

minDynamics :: Ord a => Dynamics a -> Dynamics a -> Dynamics aSource

Return the minimum.

Integrals

data Integ Source

The Integ type represents an integral.

newInteg :: Dynamics Double -> Simulation IntegSource

Create a new integral with the specified initial value.

integInit :: Integ -> Dynamics DoubleSource

The initial value.

integValue :: Integ -> Dynamics DoubleSource

Return the integral's value.

integDiff :: Integ -> Dynamics Double -> Simulation ()Source

Set the derivative for the integral.

Integral Functions

integ :: Dynamics Double -> Dynamics Double -> Simulation (Dynamics Double)Source

Return an integral with the specified derivative and initial value. If you want to create a loopback then you should use the Integ type directly. The integ function is just a wrapper that uses this type.

Difference Equations

data Sum a Source

The Sum type represents a sum defined by some difference equation.

newSum :: (MArray IOUArray a IO, Num a) => Dynamics a -> Simulation (Sum a)Source

Create a new sum with the specified initial value.

sumInit :: Sum a -> Dynamics aSource

The initial value.

sumValue :: Sum a -> Dynamics aSource

Return the total sum defined by the difference equation.

sumDiff :: (MArray IOUArray a IO, Num a) => Sum a -> Dynamics a -> Simulation ()Source

Set the difference equation for the sum.

Table Functions

lookupD :: Dynamics Double -> Array Int (Double, Double) -> Dynamics DoubleSource

Lookup x in a table of pairs (x, y) using linear interpolation.

lookupStepwiseD :: Dynamics Double -> Array Int (Double, Double) -> Dynamics DoubleSource

Lookup x in a table of pairs (x, y) using stepwise function.