forsyde-atom-0.3.0.0: Shallow-embedded DSL for modeling cyber-physical systems
Copyright(c) George Ungureanu KTH/ICT/ESY 2017
LicenseBSD-style (see the file LICENSE)
Maintainerugeorge@kth.se
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

ForSyDe.Atom.MoC.Time

Description

Collection of utility functions for working with Time. While the CT MoC describes time as being a non-disjoint continuum (represented in ForSyDe-Atom with Rational numbers), most of the functions here are non-ideal approximations or conversions from floating point equivalents. The trigonometric functions are imported from the numbers package, with a fixed eps parameter.

These utilities are meant to get started with using the CT MoC, and should be used with caution if result fidelity is a requirement. In this case the user should find a native Rational implementation for a particular function.

Synopsis

Documentation

type Time = Rational Source #

Type alias for the type to represent metric (continuous) time. Underneath we use Rational that is able to represent any \(t\) between \(t_1 < t_2 \in T\).

time :: TimeStamp -> Time Source #

Converts TimeStamp into Time representation.

const :: a -> Time -> a Source #

Returns a constant function.

e :: Time Source #

Euler's number in Time format. Converted from the Prelude equivalent, which is Floating.

(*^*) :: Time -> Time -> Time Source #

"Power of" function taking Times as arguments. Converts back and forth to Floating, as it uses the ** operator, so it is prone to conversion errors.

pi :: Time Source #

Time representation of the number π. Rational representation with a precision of 0.000001.

sin :: Time -> Time Source #

Sine of Time. Rational representation with a precision of 0.000001.

cos :: Time -> Time Source #

Cosine of Time. Rational representation with a precision of 0.000001.

tan :: Time -> Time Source #

Tangent of Time. Rational representation with a precision of 0.000001.

atan :: Time -> Time Source #

Arctangent of Time. Rational representation with a precision of 0.000001.

asin :: Time -> Time Source #

Arcsine of Time. Rational representation with a precision of 0.000001.

acos :: Time -> Time Source #

Arccosine of Time. Rational representation with a precision of 0.000001.

sqrt :: Time -> Time Source #

Square root of Time. Rational representation with a precision of 0.000001.

exp :: Time -> Time Source #

Exponent of Time. Rational representation with a precision of 0.000001.

cosh :: Time -> Time Source #

Hyperbolic cosine of Time. Rational representation with a precision of 0.000001.

sinh :: Time -> Time Source #

Hyperbolic sine of Time. Rational representation with a precision of 0.000001.

tanh :: Time -> Time Source #

Hyperbolic tangent of Time. Rational representation with a precision of 0.000001.

atanh :: Time -> Time Source #

Hyperbolic arctangent of Time. Rational representation with a precision of 0.000001.

asinh :: Time -> Time Source #

Hyperbolic arcsine of Time. Rational representation with a precision of 0.000001.

acosh :: Time -> Time Source #

Hyperbolic arccosine of Time. Rational representation with a precision of 0.000001.

log :: Time -> Time Source #

Natural logarithm of Time. Rational representation with a precision of 0.000001.