I am using ParametricNDSolve as part of the calculation of an objective function for an optimization, so I am trying to strike a balance between memory usage and speed. The documentation notes that the settings for "Method", "ParametricCaching" and "ParametricSensitivity" can affect these things. But the only options mentioned there are Automatic and None. Are there any others? In particular, the documentation states that

The default is to cache the most recently computed solution.

Presumably this is the behavior under Automatic. Is there a way to cache more than just the most recently computed solution?

This previous question discusses the options for ParametricSensitivity, but trying the same trick there returns an unexpected response:

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

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

I'm not sure why this trick would return options for ParametricSensitivity, unless this is a bug in the error-handling code and these are actually the available options for ParametricCaching.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.