You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/integrator_interface.jl
+44-10Lines changed: 44 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -612,14 +612,23 @@ function check_error(integrator::DEIntegrator)
612
612
verbose = opts.verbose
613
613
# This implementation is intended to be used for ODEIntegrator and
614
614
# SDEIntegrator.
615
+
615
616
ifisnan(integrator.dt)
616
-
@SciMLMessage("NaN dt detected. Likely a NaN value in the state, parameters, or derivative value caused this outcome.", verbose, :dt_NaN)
617
+
if verbose isa Bool
618
+
@warn"NaN dt detected. Likely a NaN value in the state, parameters, or derivative value caused this outcome."
619
+
else
620
+
@SciMLMessage("NaN dt detected. Likely a NaN value in the state, parameters, or derivative value caused this outcome.", verbose, :dt_NaN)
621
+
end
617
622
return ReturnCode.DtNaN
618
623
end
619
624
if integrator.iter > opts.maxiters
620
-
@SciMLMessage("Interrupted. Larger maxiters is needed. If you are using an integrator for non-stiff ODEs or an automatic switching algorithm (the default), you may want to consider using a method for stiff equations. See the solver pages for more details (e.g. https://docs.sciml.ai/DiffEqDocs/stable/solvers/ode_solve/#Stiff-Problems).",
625
+
if verbose isa Bool
626
+
@warn"Interrupted. Larger maxiters is needed. If you are using an integrator for non-stiff ODEs or an automatic switching algorithm (the default), you may want to consider using a method for stiff equations. See the solver pages for more details (e.g. https://docs.sciml.ai/DiffEqDocs/stable/solvers/ode_solve/#Stiff-Problems)."
627
+
else
628
+
@SciMLMessage("Interrupted. Larger maxiters is needed. If you are using an integrator for non-stiff ODEs or an automatic switching algorithm (the default), you may want to consider using a method for stiff equations. See the solver pages for more details (e.g. https://docs.sciml.ai/DiffEqDocs/stable/solvers/ode_solve/#Stiff-Problems).",
621
629
verbose,
622
630
:max_iters)
631
+
end
623
632
return ReturnCode.MaxIters
624
633
end
625
634
@@ -635,36 +644,61 @@ function check_error(integrator::DEIntegrator)
EEst =", and step error estimate = $(integrator.EEst)"
641
650
else
642
651
EEst =""
643
652
end
644
-
"dt($(integrator.dt)) <= dtmin($(opts.dtmin)) at t=$(integrator.t)$EEst. Aborting. There is either an error in your model specification or the true solution is unstable."
645
-
end
653
+
@warn"dt($(integrator.dt)) <= dtmin($(opts.dtmin)) at t=$(integrator.t)$EEst. Aborting. There is either an error in your model specification or the true solution is unstable."
654
+
else
655
+
@SciMLMessage(verbose, :dt_min_unstable) do
656
+
ifisdefined(integrator, :EEst)
657
+
EEst =", and step error estimate = $(integrator.EEst)"
658
+
else
659
+
EEst =""
660
+
end
661
+
"dt($(integrator.dt)) <= dtmin($(opts.dtmin)) at t=$(integrator.t)$EEst. Aborting. There is either an error in your model specification or the true solution is unstable."
662
+
end
663
+
end
646
664
return ReturnCode.DtLessThanMin
647
665
elseif!step_accepted && integrator.t isa AbstractFloat &&
648
666
abs(integrator.dt) <=abs(eps(integrator.t))
649
-
650
-
@SciMLMessage(verbose, :dt_epsilon) do
667
+
if verbose isa Bool
651
668
ifisdefined(integrator, :EEst)
652
669
EEst =", and step error estimate = $(integrator.EEst)"
653
670
else
654
671
EEst =""
655
672
end
656
-
"At t=$(integrator.t), dt was forced below floating point epsilon $(integrator.dt)$EEst. Aborting. There is either an error in your model specification or the true solution is unstable (or the true solution can not be represented in the precision of $(eltype(integrator.u)))."
673
+
@warn"At t=$(integrator.t), dt was forced below floating point epsilon $(integrator.dt)$EEst. Aborting. There is either an error in your model specification or the true solution is unstable (or the true solution can not be represented in the precision of $(eltype(integrator.u)))."
674
+
else
675
+
@SciMLMessage(verbose, :dt_epsilon) do
676
+
ifisdefined(integrator, :EEst)
677
+
EEst =", and step error estimate = $(integrator.EEst)"
678
+
else
679
+
EEst =""
680
+
end
681
+
"At t=$(integrator.t), dt was forced below floating point epsilon $(integrator.dt)$EEst. Aborting. There is either an error in your model specification or the true solution is unstable (or the true solution can not be represented in the precision of $(eltype(integrator.u)))."
0 commit comments