Hello All,
Warm regards for all and hope you all have a great 2021!
So, in my research project, I am using MATLAB ode45 to integrate some ODEs. I am also using event function to terminate the integration.
The problem that I am having is that I want to have a consistent number of time points and corresponding state soluitions regardless of the time span I provide to ode45.
In general, to be safe, i.e. to make sure that an event happens, I am using a very conservative time span as an input. However, while the event happens, I am getting a very few number of solutions out.
I heard that there are some interpolation functions that allows one to obtain solutions from ode45 at a specified time points but I am not sure how to pass the information from the ode solver to the interpolating function other than a few number of ode solutions. There may be just one single point in certain case…
So basically, are there ways to ensure that (1) the event will happen within a given time span other than being conservative with time span, and (2) can I obtain many time points and corresponding solutions even if the returen ode solutions only contains a few points that are in the range that I want the solution for (i.e. from initial time to an event time)?
Thank you so much for your help!
Best Answer