I'm trying to solve a differential equations system with ode45 solver. But sometimes integration takes too much time because one of three values in the system becomes too small. As I understood I should use an event in ode function.
function [value,isterminal,direction] = events(t,y) value = y(1) - 0.0000001; isterminal = 1; direction = 0;
How to write the event not just only for one y value, but for all three of them?
Best Answer