Delay differential equations in Haskell
Download ddeint.hs
and a haskell compiler (in ubuntu: sudo apt install ghc
)
In ddeint.hs
, replace the following functions:
- dydt : a function that takes an array of the previous computed values and t, and returns the derivative of your function.
For instance, if
dy/dt = f(y(t-m))
, writedydt y t = f(y(t-m))
- initialY : an list of historic values for y. For instance,
initialY = [0,1,2]
corresponds to- y(t0) = 0
- y(t0-dt) = 1
- y(t0 - 2dt) = 2
ghc -O2 ddeint.hs
./ddeint