[SciPy-User] Possible to integrate an ODE just until the solution reaches a certain value?
Wed Mar 9 16:20:12 CST 2011
I'm trying to model the dynamics of a catapult-like mechanism used to launch a
projectile, and have a system of ODEs which I need to numerically integrate over
time. I am trying to solve for the position of the projectile as well as the
other components in my mechanism. At some point in time, the projectile
separates from the mechanism, and becomes airborne. The equations governing the
system change at that point in time, but because it's a function of position
(which i'm solving for), I don't know up front what timespan to integrate over.
I would like the ODE solver to stop integrating once the the solution reaches
this certain value, and I will use the states at that point to compute the
initial conditions to another ODE describing the motion from that time onward.
Is there an ODE solver in Python/SciPy which will integrate from the initial t
until the solution reaches a certain value, or until a specific condition is
met? The ODE solvers in Matlab have "events" which will do this, but I'm trying
my best to stick with Python.
More information about the SciPy-User