# Question:How does odeplot sample the solution of an ODE ?

## Question:How does odeplot sample the solution of an ODE ?

Maple

Hi everybody,

I solve an ODE system numerically with the command

Tend := ….. :
sol := dsolve(MySys, numeric, method=rosenbrock, range=0..Tend):    # or rkf45

One of my colleagues wants the solution in array form for using it in a spreadsheet (namely Excel).
Here is an example of what I do :

data := plottools:-getdata( plots:-odeplot(sol, […..], 0..Tend, refine = Q) )
:  # Q rational
result := data[3]:
ExcelTools:-Export (result, …)

To understand the following, you need to know that
the time step varies by several decades (at least 3 or 4). and that  numfun
is typically in the order of 10^5

When I ask Maple to construct  data , Maple seems to sample the solution
sol
according to the local time step dsolve has selected (and probably some other parameters ?)
Because this time step varies in very large proportions, the result is sometimes a concentration of points in regions where the solution is rapidly changing (which is desirable) … with some lacunarity in slow varying regions.

To obviate this, sometimes  poor appearance, I used to force Maple to compute the solution by regularly sampling the range
]0, Tend[  and combining this array with the original one (result
).
But this not satisfactory for I do not avoid lacunarity region (unless I proceed in some ad hoc way)

Here is my question :
Could you give me some elements about  the way odeplot adapts its sampling strategy according to the local time step, the budget N (the Q value I guess) and maybe numfun
?