# How can I get the time steps chosen by NDSolve when the Method -> “ExplicitRungeKutta” option is given?

I am trying to solve an ODE with NDSolve using the "ExplicitRungeKutta" method. I need to know exactly which time steps NDSolve chooses, i.e., which points in the interval $[tmin, tmax]$ it chooses when it implements the Runge-Kutta method before the interpolation is made). What should I do?

## 1 Answer

To take this off the unanswered list:

The steps are the abscissae stored in the interpolating function returned by NDSolve:

ysol = First@
NDSolve[{y'[x] == y[x] Cos[x + y[x]], y[0] == 1}, y, {x, 0, 10},
Method -> "ExplicitRungeKutta"];

steps = y["Coordinates"] /. ysol // First
(*
{0., 0.120351, 0.527517, 0.921285, 1.33461, 1.85473, 2.27071,
2.75617, 3.20612, 3.69883, 4.24451, 4.86677, 5.51721, 6.0665,
6.59295, 7.1106, 7.57393, 8.07059, 8.6011, 9.25316, 9.62658, 10.}
*)