# NDSolve: methods and step size choosing

I am looking into the documentation of NDSolve[]; more precisely how this function chooses the StepSize and how it chooses which method to use.

# Regarding StepSize control, it reads

NDSolve adapts its step size so that the estimated error in the solution is just within the tolerances specified by PrecisionGoal and AccuracyGoal.

Question: How? Does it use an adaptive step size similar to this one for instance?

# Regarding method choice, it reads

NDSolve typically solves differential equations by going through several different stages depending on the type of equations. With Method->{s1->m1, s2->m2, ...} stage is handled by method . The actual stages used and their order are determined by NDSolve, based on the problem to solve.

and also

Possible explicit time integration settings for the Method option include: [Adams, BDF, etc]

with various submethods and options. A good tutorial about method choice and stiffness detection is found here.

Questions:

1. What is the default method choice in NDSolve? (I am guessing it will start by ExplicitRungeKutta, seeing as it is the most robust from what I've been reading, but then which?)
2. Regarding stiffness detection and method choice upon stiffness finding, I found this page that refers "Explicit modified midpoint, double-harmonic sequence, linearly implicit Euler, and sub-harmonic sequence" as possible methods. In that same page, I found how those methods seem to compute stability of the model, and use it to determine whether it should use a stiff/non-stiff method. Yet, what is again the default order of choice for those methods?

• As noted here, NDSolve[] uses a multistep method by default (LSODA) for ODEs; it uses Adams methods for nonstiff equations, and Gear methods for stiff equations. Of course, all the methods have different procedures for choosing stepsize; you might want to look at the books of Hairer/Nørsett/Wanner for more details on the methods implemented in Mathematica. Commented May 29, 2013 at 10:49
• @gwr: really? I thought it was a necessary requirement to know these by heart before you even dare to type NDSolve.... Commented May 29, 2013 at 17:02
• @gwr, for what it's worth, I've been reading Hairer et al.'s books way before NDSolve[] was completely revamped in version 5... *whistles* Commented May 29, 2013 at 18:58