[SciPy-User] Possible to integrate an ODE just until the solution reaches a certain value?

Warren Weckesser warren.weckesser@enthought....
Wed Mar 9 16:28:14 CST 2011


On Wed, Mar 9, 2011 at 4:20 PM, Randy Williams <skapunxter@yahoo.com> wrote:

> Greetings,
>
>
> 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.
>
>

Randy,

None of the ODE solvers in SciPy have event detection (but it is an
oft-requested and sorely missed feature).  Recently a couple projects were
announced that provide python wrappers for the Sundials suite, one of which
is python-sundials:
    http://code.google.com/p/python-sundials/
The very first example that you see on their web page includes event
finding.

Warren




> Thanks,
> Randy
>
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20110309/776a948e/attachment-0001.html 


More information about the SciPy-User mailing list