0
$\begingroup$

I have a model given by a system of differential equations

$$ \frac{dy}{dt}=f(y)$$

with $y=(y_1,y_2,y_3)$ and $f:\mathbb{R}^3 \to \mathbb{R}^3$. The system works as follows : integrate the ode's with initial values $(y_1^0,y_2^0,y_3^0)$ until $y_1$ reaches a certain value (say $y_1=0$), get the time $t_f$ when this happens and start again with the initial values $(y_1^0 ,y_2^0, y_3(t_f))$. All this until some stopping condition is encountered.

My question is : what software can be used to simulate such a system? It would be preferable to be open source, but any suggestion is welcomed.

$\endgroup$
  • 2
    $\begingroup$ I'd implement this in MATLAB using the ODE events framework. Have a look at odeset and event locations. If you do not have MATLAB installed, try the open-source octave and its odepkg package. More info here. $\endgroup$ – GoHokies Apr 22 '16 at 9:09
2
$\begingroup$

MATLAB's ODE solvers can use what are known as Event functions to achieve this. I also link someone who posted a good quick example to show how to use it that is close to your use-case.

$\endgroup$
0
$\begingroup$

You can also try SUNDIAL suite from LLNL. See https://computation.llnl.gov/casc/sundials/main.html.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.