In the Matlab ODE Solver has a way to terminate integration when an event triggers. It has a function called "Ode45" to solve differential equation using Runge-Kutta method and call an event to terminate the function as follows:
%Evaluate system of differential equations.
tspan=[0 t_max]; %Time...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.