Hi All,
I am curious what happens with the first solution point when we run ode45 to integrate a right hand side function. The first state solution that is returned, is it the same as the initial condition? I would assume so because the associated time point for the first solution always seems to be a zero.
Next, suppose I am to run ode45 back-to-back because a physical phenomena abruptly changes. e.g. closing a valve in gas filled tank. In this case, a final solution for the previous ode integration becomes the initial condition for the next ode integration, i.e. successive iteration. Now, for the sake of continuity in time, I want to combine the solutions from two different ode integrations. What is the best way to do this? Should we remove the initial solution from the second integration and combine with the first solution? Also, for the corresponding time, should we consider the first solution time point of the second iteration to be exactly the same as the ending time point of the first integration?
Thank you so much!
-Taehun
Best Answer