Skip to main content
2 of 2
Improved plot to better distinguish error types
bbgodfrey
  • 62.1k
  • 18
  • 92
  • 160

bads[1/4, 1/16] generates four distinct error messages, in addition to General::stop, which limits the number of identical errors printed. They are

Do[test[1/4, 1/16, x, y], {x, 5, 40}, {y, x, 80}]; $MessageList // Union // Rest
(* {HoldForm[InterpolatingFunction::dmval], HoldForm[NDSolveValue::mxst], 
    HoldForm[NDSolveValue::nderr], HoldForm[NDSolveValue::ndtol]} *)
  • InterpolatingFunction::dmval occurs here when integration stops before reaching x = 0
  • NDSolveValue::ndtol occurs when the requested PrecisionGoal and AccuracyGoal are too large in comparison with WorkingPrecision
  • NDSolveValue::mxst occurs when the number of integration steps exceeds MaxSteps
  • NDSolveValue::nderr is an inexplicable error often associated with large WorkingPrecision

The ListPlot in the question can be modified to distinguish among these errors, for instance,

enter image description here

which is intended to indicate the primary error. Of course, multiple errors can occur from a single call to NDSolveValue, and almost any other error also causes InterpolatingFunction::dmval. As noted in my earlier comment, in those instances where it is the only error, the integration has inexplicably stopped just short of the endpoint. Adjusting the endpoint slightly seems to solve the problem here. NDSolveValue::ndtol is resolved by increasing WorkingPrecision or (here) decreasing AccuracyGoal. NDSolveValue::mxst, is eliminated simply by increasing MaxSteps. Method -> "StiffnessSwitching" sometimes eliminates NDSolveValue::nderr, and sometimes not.

bbgodfrey
  • 62.1k
  • 18
  • 92
  • 160