[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## [Help-gsl] ODE event functions

**From**: |
Luke |

**Subject**: |
[Help-gsl] ODE event functions |

**Date**: |
Mon, 14 Jun 2010 16:16:41 -0700 |

Hello,
I was wondering if anybody had written any code to incorporate state
event handling into the ODE integration routines, similar to Matlab's
ODE events functionality. What I am looking to do is to precisely
find the zero crossings of various functions of the state, during
numerical integration:
given ti, tf, x(ti), f(t,x) and g(t,x) such that:
dx/dt = f(t, x)
find t_e and x_e such that
t_e \in [ti, tf]
g(t_e, x_e) = 0
In Matlab, you can specify whether this what types of zero-crossings
are detected (positive to negative, negative to positive, or both),
and whether it should be a terminal event which would stop the
numerical integration.
While many things in Matlab are viewable and editable, this particular
aspect of their numerical integration code is not viewable, so I can't
see what sort of algorithm they implemented.
My naive approach would be halving the interval of t and doing a sort
of binary search to find the t at which the crossing occurs. I'm
pretty sure this would work for many well behaved systems, but more
sophisticated approaches would probably be necessary for more
complicated systems, especially if there are discontinuities in the
ode function. I could see this approach breaking down for long
running non-autonomous systems (ODE's explicitly depend on time). For
autonomous systems (ODE's not explicitly dependent on time) though, I
could see this approach working quite well.
Thoughts?
Thanks,
~Luke

[Prev in Thread] |
**Current Thread** |
[Next in Thread] |

**[Help-gsl] ODE event functions**,
*Luke* **<=**