db1234
db1234

Reputation: 807

Solve ODE's until an event occurs in Octave

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);

Upvotes: 2

Views: 1846

Answers (1)

crobar
crobar

Reputation: 2929

Install the package odepkg from 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 as ode45. Note that the names of the solvers may not be identical, and you will need to find the appropriate one for your problem. ode45 does appear to have an implementation in the latest version though.

Upvotes: 2

Related Questions