[Haskell-cafe] representing differencial equations in haskell

2007-09-25 Thread Thomas Girod
Hi there. Let's say I have mathematical model composed of several differential equations, such as : di/dt = cos(i) dc/dt = alpha * (i(t) - c(t)) (sorry my maths are really bad, but I hope you get the point) I would like to approximate the evolution of such a system iteratively. How would you

Re: [Haskell-cafe] representing differencial equations in haskell

2007-09-25 Thread Antoine Latter
I don't see anything in hackage off the top of my head. If it's a set of DEs like that, Runge-Kutta is a good place to start if you want to code your own integrator: http://en.wikipedia.org/wiki/Runge-Kutta#The_classical_fourth-order_Runge.E2.80.93Kutta_method But if it were me I would just use

Re: [Haskell-cafe] representing differencial equations in haskell

2007-09-25 Thread Henning Thielemann
On Tue, 25 Sep 2007, Thomas Girod wrote: Let's say I have mathematical model composed of several differential equations, such as : di/dt = cos(i) dc/dt = alpha * (i(t) - c(t)) (sorry my maths are really bad, but I hope you get the point) I would like to approximate the evolution of such a

Re: [Haskell-cafe] representing differencial equations in haskell

2007-09-25 Thread Paul L
Here is a minimal answer using Yampa-like Signal Function and Arrow notation. You have to load this using ghci -farrows. import Control.Arrow The differential equation you gave are indeed: i = integral (cos i) + i0 c = integral (alpha * (i - c)) + c0 where i0 and c0 are the initial