In Matlab I know how to solve an ODE until an even occurs (for example, solve the ODE until the y-coordinate is zero):
http://www.mathworks.com/help/techdoc/ref/odeset.html#f92-1017470
Is there an analogy in Octave?
Here is the relevant code:
lsode_options('Events', @events);
t0 = linspace (0, 20, 1000);
[t,x,te,ye,ie] = lsode(@HH, ynot, t0);
Install the package
odepkgfrom Octave-Force. You may well already have this installed. You then use the ode solver functions from this package, which have identical syntax to the Matlab ode solvers, such asode45. Note that the names of the solvers may not be identical, and you will need to find the appropriate one for your problem.ode45does appear to have an implementation in the latest version though.