I am interested in dynamic systems simulation, and have some limited experience with both ODE and system dynamic tools such as Stella, Simgua, Vensim, etc. ODE integrators in general, and PyDSTool in particular, offer a good part of the functionality of those packages; one notable exception is delay functions, i.e. using the value of a variable at a previous "time" (indep. var.)
Now, is it possible to simulate this with PyDS? I expect to figure that out in time, though pointers would be appreciated.
I would mostly want to know whether it is even a good idea in terms of ODE integration techniques. Nothing I know about ODEs precludes it, but I know I do not know quite enough. I expect I would probably have to introduce dummy variables, use delayed values in the jacobian as well; am I missing something else?
The only thing you can delay at the moment are delta function impulses (see the tests/ directory where there are some filenames with "delay" in the title, showing of a somewhat complex implementation of delayed impulse that we currently have). There are DDE integrators available but no-one has finished wrapping them so that we can use them in PyDSTool. If you have some background in using SWIG and a little C we would love the help -- it would not be that hard!
Ah, thank you for the answer! As you can see, my knowledge of ODEs is somewhat basic; I was not familiar with the DDE term.
For the record, I know both C and Python well, swig less well (I prefer Cython) but I could learn.
I guess that integration of DDEs in PyDSTool would best be done at the scipy level; and there is a ticket to that effect.
They mention this existing python-dde tool, are you aware of it?
It uses ddesolve95. It should be possible to adapt this to scipy, which would be a good part of the work.
That said... I wonder why DDEs have their own solvers, are the algorithms that different than from ODEs? I was interested of using ODE fitting techniques, I think VODE allows it (still learning about all this) but using a different solver might make that goal more difficult. I will look at DDE solvers, I guess.
No promises to help yet: it is not that hard, as you said, but still a bit of an undertaking; and I have to be sure it gets me where I want. Still, a possibility. I expect I would then need a fair amount of guidance to integrate this properly in PyDSTool.
PyDDE is not fully compatible with the approach to C-based back ends that is taken in PyDSTool, although maybe the future setup installer for PyDSTool will be able to compile the C code in a platform independent way. There are DDE solvers by Hairer and Wanner which we would rather interface to, since they are related to the solvers for ODEs we already have wrapped and we could re-use a lot of code. Let me know if you want to get more involved. I don't foresee any action being taken to get a working DDE solver in scipy in the near future!