# “ParametricSensitivity” in ParametricNDSolve

"ParametricSensitivity" is listed as a Method in the documentation for ParametricNDSolve, and the documentation goes on discuss Method -> {"ParametricSensitivity" -> None}. Also, question 30054 mentions a few other options for this method but without discussing them. Where can I obtain additional information on "ParametricSensitivity"? I have found none from searching this site or Google. Thanks.

The choices allowed for "ParametricSensitivity" can be seen from the following error message

ParametricNDSolveValue[{y'[t] == 1, y[0] == a}, y[1], {t, 1}, a,
Method -> {"ParametricSensitivity" -> "?"}];

(* ParametricNDSolveValue::bdsmtd: Method ? for solution stage ParametricSensitivity
is not one of {Automatic, None, ForwardSensitivity, AdjointSensitivity}. >> *)


None means no sensitivities will be computed. The default method setting is Automatic, which will typically compute forward sensitivities, although "AdjointSensitivity" may be used in some cases, e.g. if the solution is only requested at a particular time.

In the important default case when WorkingPrecision is machine precision and no time integration method has been specified, Mathematica will use the built-in sensitivity solvers from the SUNDIALS suite, in particular the CVODES or IDAS libraries for initial value ODE problems or DAE systems respectively. For some mathematical background on the methods used, I would recommend the following paper and the references therein. Quoting from the introduction,

The forward sensitivity module in CVODES implements the simultaneous corrector method, as well as two flavors of staggered corrector methods. Its adjoint sensitivity module provides a combination of checkpointing and cubic Hermite interpolation for the efficient generation of the forward solution during the adjoint system integration.

In cases when CVODES or IDAS cannot be used (e.g. explicit method specified or not a machine precision problem), sensitivities are computed by solving an augmented system that includes the sensitivity equations.

The "ParametricSensitivity" results are accessible to the user by asking for derivatives with respect to the parameters. Other numerical solvers in Mathematica (e.g. FindRoot or FindMinimum) will make automatic use of sensitivities, if available, in the same way: by requesting derivatives whenever needed by the underlying algorithm.

For additional examples, I would also mention the following presentation from the 2012 Wolfram Technology Conference.

• This answer provides very useful background information. Thanks. It also would be useful to know which is the default option (the documentation suggests that it is not None), how the "ParametricSensitivity" results are accessible to the user, and which other Mathematica functions utilize the results. For instance, do FindRoot, NMinimize, etc. utilize the results when doing computations that involve varying parameters, as in 88061 – bbgodfrey Aug 25 '15 at 11:53
• @bbgodfrey Thank you for the accept; I've now tracked down a few more details and slightly expanded the answer. – ilian Aug 31 '15 at 15:55
• What a great trick for obtaining the list of Method options. Many thanks for the thorough answer. – bbgodfrey Aug 31 '15 at 17:19