If using a variable time step solver such as ODE45 in matlab - I would define a time span for the outputs, i.e. times = [0 50]
, and matlab would return results at various time steps between 0 and 50.
However in R it appears I have to define the time points at which I want the ODE to return the results, i.e if I gave times = 0:50
, it would return 51 results at 0,1,2, ... 50
. Other wise I have to supply a sequence such as , times = seq(0,50,0.1)
.
I have a function which changes rapidly at the beginning and then much more gradually. In MATLAB the output results reflects this with 82 time steps returned in the results, of which 49 are between the time step 0 and 1.
I want to know if there is a way to get R to return the results in the same manner as MATLAB, so without me having the pre-specify the time points I wish the results returned at.