MATLAB: The last entry in tspan must be different from the first entry. ODE45

ode 45

Hello,
I am using ODE45 to solve a ODE, where the time steps are very small. while sloving it shows error the last entry in tspan must be different from the first entry. I went back a chek, but my intial and final times are not same. Can someone provide me an alternative way ?
tInitial =0.48965737046814611799910865741481
tFinal =0.48965737046814611799928732454269
tspan = [tInitial tFinal]
[t,N] = ode45(@(t,N) thisObj.diffusionalGrowth(), tspan, oldDia);

Best Answer

tInitial and tFinal differ in the ~22nd decimal. That is not much for a double-precision representation. Why not run the simulation from 0 to 1.78e-22? And are that the entire time-scale you want to integrate the DE? If that time is in units of seconds it is a very short time, if it is in hours it is still a very short time, even if it is in units of years it is still about a 5 femtoseconds...
HTH
Related Question