Hello everybody, I'm using the MATLAB ode solver ode45 to numerically solve some easy differential equations.
I got how to use this tool, but there are some situations that left me a bit puzzled.
Say, I have the differential equation:
and I want to solve it in a range (a,b) using the initial condition
with k,c being constants and
How can I say to the solver that my initial condition is not in the point a, but in the point c (according to the help, once one provides the time span in ode45, the initial condition is automatically assigned to the initial point of it)?
I solved the problem splitting the interval in 2 parts
and calling the solver twice (apparently ode45 works backward just as fine as it works forward :D). The solution is correct in this way but i find the method a bit lumbering (let's say I'd have expected MATLAB doing that for me automatically ;)
Any suggestion on a more elegant use of ode45?
Thank you in advance!