Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
See NDSolveStateData, in particular the section NDSolveStateData Properties; also see [NDSolveExplicitRungeKutta](http://reference.wolfram.com/mathematica/tutorial/‌​NDSolveExplicitRungeKutta.html); other methods can be found in [NDSolveOverview`](reference.wolfram.com/mathematica/tutorial/NDSolveOverview.html). –  Michael E2 May 29 '14 at 12:12
NDSolveUtilities can be used for analyzing the solution after the solution has been constructed. –  Michael E2 May 29 '14 at 13:13
quick and dirty way: ClearAll[g]; g[x_?NumericQ] := (Sow[x]; Cos[x]); ListPlot@Last@ Last@Reap[NDSolve[{y'[x] == y[x] g[x], y[0] == 1}, y, {x, 0, 30}, Method -> "ExplicitRungeKutta"]] –  acl May 29 '14 at 23:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.