Using a Single Event Function to Account for Multiple Events
Hi All,
I have been using event functions in my simulation and they are great. Just ran into a case where I would like to stop the numerical integration after two of my event functions trigger… Can I cherry pick event functions and make a single event function to take care of all?
I am assuming that the event value starts positive and crosses zero at some point. Then, I could probably call another event function inside my current event function, correct? And then, may be I can use max function to choose the largest event value to make sure that all the events are triggered? Will this method work? If so, could this method suffer computationally?
The problem here is that, for the case having multiple events, I do not necessarily know in advance which event would occur first!
Many thanks in advance! 🙂
Sincerely,
Taehun KimHi All,
I have been using event functions in my simulation and they are great. Just ran into a case where I would like to stop the numerical integration after two of my event functions trigger… Can I cherry pick event functions and make a single event function to take care of all?
I am assuming that the event value starts positive and crosses zero at some point. Then, I could probably call another event function inside my current event function, correct? And then, may be I can use max function to choose the largest event value to make sure that all the events are triggered? Will this method work? If so, could this method suffer computationally?
The problem here is that, for the case having multiple events, I do not necessarily know in advance which event would occur first!
Many thanks in advance! 🙂
Sincerely,
Taehun Kim Hi All,
I have been using event functions in my simulation and they are great. Just ran into a case where I would like to stop the numerical integration after two of my event functions trigger… Can I cherry pick event functions and make a single event function to take care of all?
I am assuming that the event value starts positive and crosses zero at some point. Then, I could probably call another event function inside my current event function, correct? And then, may be I can use max function to choose the largest event value to make sure that all the events are triggered? Will this method work? If so, could this method suffer computationally?
The problem here is that, for the case having multiple events, I do not necessarily know in advance which event would occur first!
Many thanks in advance! 🙂
Sincerely,
Taehun Kim ode, event function MATLAB Answers — New Questions
​