Hello. I am just about to start building a somewhat complex dynamic model that will incorporate a large number (~50-100) of differential equations and parameters to be estimated. This is my first project of this type, so I am on a steep learning curve. I could build it using Matlab's Simulink, but I would rather build it in Python. I have looked for good graphical interfaces to ODE solvers in Python but have not found any that seem suitable. I would not mind using the Scipy ODE solvers, but I have a couple of quick, simple questions before I invest a lot of time in that direction. Any thoughts would be appreciated. -- The (few) examples I have seen in using Scipy's ODE functions are only small, simple ones. Is there anything to prevent use of the solvers for larger, more complex systems of ODEs? -- Has anyone seen a good tutorial on use of Scipy's ODE solver for larger (or at least not tiny) problems? -- Are there other Open Source packages out there that might offer more options than Scipy's ODE solver? I dont want to make this job any harder than I need to. Ive looked but didnt see any. -- Simulink offers use of various model blocks to simplify model building. I can write my own, but is there any public code already available along these lines for use with Scipy's ODE solver? Please pardon the simplicity of my questions and thanks for your help. Would anyone be willing to allow me to write privately if I have a few troubles along the way? John __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Hi John, Here is a page that might be of interest (other ODE solver integrated via f2py, maybe a little outdated): http://moncs.cs.mcgill.ca/people/slacoste/research/report/SummerReport.html IIRC, another system for solving ODEs was developed at the same place. David ---- JJ wrote:
Hello. I am just about to start building a somewhat complex dynamic model that will incorporate a large number (~50-100) of differential equations and parameters to be estimated. This is my first project of this type, so I am on a steep learning curve. I could build it using Matlab's Simulink, but I would rather build it in Python. I have looked for good graphical interfaces to ODE solvers in Python but have not found any that seem suitable. I would not mind using the Scipy ODE solvers, but I have a couple of quick, simple questions before I invest a lot of time in that direction. Any thoughts would be appreciated.
-- The (few) examples I have seen in using Scipy's ODE functions are only small, simple ones. Is there anything to prevent use of the solvers for larger, more complex systems of ODEs?
-- Has anyone seen a good tutorial on use of Scipy's ODE solver for larger (or at least not tiny) problems?
-- Are there other Open Source packages out there that might offer more options than Scipy's ODE solver? I dont want to make this job any harder than I need to. Ive looked but didnt see any.
-- Simulink offers use of various model blocks to simplify model building. I can write my own, but is there any public code already available along these lines for use with Scipy's ODE solver?
Please pardon the simplicity of my questions and thanks for your help. Would anyone be willing to allow me to write privately if I have a few troubles along the way?
John
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
Although it's not open source, Scilab is a free program with capabilities similar to those of Matlab, including a block diagram modeling language. It isn't as polished as Matlab, but it allows (IMHO) better program structure. http://www.scilab.org/ You might also be interested in: http://comptlsci.anu.edu.au/tutorials.html for examples in both Scilab and Python. That said, I'd still prefer to work in Python, even without a block diagram language. john JJ wrote:
Hello. I am just about to start building a somewhat complex dynamic model that will incorporate a large number (~50-100) of differential equations and parameters to be estimated. This is my first project of this type, so I am on a steep learning curve. I could build it using Matlab's Simulink, but I would rather build it in Python. I have looked for good graphical interfaces to ODE solvers in Python but have not found any that seem suitable. I would not mind using the Scipy ODE solvers, but I have a couple of quick, simple questions before I invest a lot of time in that direction. Any thoughts would be appreciated.
-- The (few) examples I have seen in using Scipy's ODE functions are only small, simple ones. Is there anything to prevent use of the solvers for larger, more complex systems of ODEs?
-- Has anyone seen a good tutorial on use of Scipy's ODE solver for larger (or at least not tiny) problems?
-- Are there other Open Source packages out there that might offer more options than Scipy's ODE solver? I dont want to make this job any harder than I need to. Ive looked but didnt see any.
-- Simulink offers use of various model blocks to simplify model building. I can write my own, but is there any public code already available along these lines for use with Scipy's ODE solver?
Please pardon the simplicity of my questions and thanks for your help. Would anyone be willing to allow me to write privately if I have a few troubles along the way?
John
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
On 12/08/06, JJ <josh8912@yahoo.com> wrote:
I am just about to start building a somewhat complex dynamic model that will incorporate a large number (~50-100) of differential equations and parameters to be estimated. This is my first project of this type, so I am on a steep learning curve. I could build it using Matlab's Simulink, but I would rather build it in Python. I have looked for good graphical interfaces to ODE solvers in Python but have not found any that seem suitable. I would not mind using the Scipy ODE solvers, but I have a couple of quick, simple questions before I invest a lot of time in that direction. Any thoughts would be appreciated.
-- The (few) examples I have seen in using Scipy's ODE functions are only small, simple ones. Is there anything to prevent use of the solvers for larger, more complex systems of ODEs?
Scipy's ODE solver is based on ODEPACK's lsoda.f, which is robust, well-tested, and well-documented (see, for example, http://www.netlib.org/alliant/ode/prog/lsoda.f ). All it does is integrate a system of first-order ODEs over a user-specified range; if problems occur it carries the integration as far as it can and then stops. The Python wrapper, however, has a few serious flaws. In an attempt to provide Numeric-style calling, the ability to stop partway through an interval appears to have been lost, and any error or exception (including KeyboardInterrupt) is trapped and an error is printed to the standard output, rendering debugging extremely cumbersome. More seriously, if there are parts of the solution space that cause problems (the solution approaches a singularity, or the edge of a coordinate patch), there is no really effective way to bring the solution up to the edge and then stop. This is because lsoda doesn't do that - that feature is in lsodar.f ( http://www.netlib.org/alliant/ode/prog/lsodar.f ), which has not (yet?) been wrapped in python. I'm actually hoping to get a wrapper for lsodar written, but as I've no experience with FORTRAN, we'll see. A. M. Archibald
On Sat, 12 Aug 2006, A. M. Archibald wrote:
More seriously, if there are parts of the solution space that cause problems (the solution approaches a singularity, or the edge of a coordinate patch), there is no really effective way to bring the solution up to the edge and then stop. This is because lsoda doesn't do that - that feature is in lsodar.f ( http://www.netlib.org/alliant/ode/prog/lsodar.f ), which has not (yet?) been wrapped in python.
I believe that lsodar *has* been wrapped as part of the sourceforge "SloppyCell" project for systems biology modelling. That package provides event detection for stopping integration under circumstances such as you mention, as does PyDSTool. Rob
On Sat, 12 Aug 2006, JJ wrote:
Hello. I am just about to start building a somewhat complex dynamic model that will incorporate a large number (~50-100) of differential equations and parameters to be estimated. This is my first project of this type, so I am on a steep learning curve. I could build it using Matlab's Simulink, but I would rather build it in Python. I have looked for good graphical interfaces to ODE solvers in Python but have not found any that seem suitable.
Have you even found any at all? I am not aware of any graphical interfaces to ODE solvers in Python. I think Simulink is great for learning with and can be quite easy to start out with, but it's horribly inefficient for serious projects like parameter estimation with 100 ODEs. And if you want to make broad systematic changes to your model (like changing many related parameters at once) you'd better learn how to edit the simulink script file directly! 50 DEs is already past my limit of what I'd consider dealing with graphically.
-- The (few) examples I have seen in using Scipy's ODE functions are only small, simple ones. Is there anything to prevent use of the solvers for larger, more complex systems of ODEs?
No, I don't think so. I use SciPy's VODE for large systems sometimes and it's OK. The main problem is the inefficiency of the integrators needing to call back to your python function that defines the right hand sides of your ODEs.
-- Has anyone seen a good tutorial on use of Scipy's ODE solver for larger (or at least not tiny) problems?
Other than sparseness I don't know what kind of issues arise with larger system size that would need a specific tutorial.
-- Are there other Open Source packages out there that might offer more options than Scipy's ODE solver? I dont want to make this job any harder than I need to. Ive looked but didnt see any.
My group provides the distinctly non-graphically interfaced PyDSTool OSS package built over old numarray/scipy array classes, and where we've wrapped faster and well-established C-based ODE stiff and non-stiff integrators (avoiding the slow python callback problem). There is somewhat improved error-handling and support for stopping at events compared to the wrapping of the Scipy integrators. Parameter estimation and handling the book-keeping of a large system is somewhat easier with our Python classes too, I would say. We also support DAEs (a feature you might be looking for in Sundials), hybrid systems and maps.
-- Simulink offers use of various model blocks to simplify model building. I can write my own, but is there any public code already available along these lines for use with Scipy's ODE solver?
PyDSTool provides a model building system (basically template classes for coupling simulink-link "blocks") which has not been filled out with examples such as those in Simulink. You build the models in scripts as you would in matlb. But it's easy to make your own "blocks" with these classes and there are some examples provided for other types of problem. HTH Rob
participants (5)
-
A. M. Archibald -
David Linke -
JJ -
John Hassler -
Robert Clewley