From 1a070a9e55c0a2935c809c8b039060d631a67a3f Mon Sep 17 00:00:00 2001 From: Isaac Wheeler Date: Wed, 13 Nov 2024 15:20:47 +0100 Subject: [PATCH] Add CheckInit error message --- lib/OrdinaryDiffEqCore/src/initialize_dae.jl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqCore/src/initialize_dae.jl b/lib/OrdinaryDiffEqCore/src/initialize_dae.jl index 46dfa94729..9c905923b4 100644 --- a/lib/OrdinaryDiffEqCore/src/initialize_dae.jl +++ b/lib/OrdinaryDiffEqCore/src/initialize_dae.jl @@ -203,7 +203,17 @@ end function Base.showerror(io::IO, e::CheckInitFailureError) print(io, - "CheckInit specified but initialization not satisifed. normresid = $(e.normresid) > abstol = $(e.abstol)") + "DAE initialization failed: your u0 did not satisfy the initialization requirements, + normresid = $(e.normresid) > abstol = $(e.abstol). If you wish for the system to + automatically change the algebraic variables to satisfy the algebraic constraints, + please pass `initializealg = BrownBasicInit()` to solve (this option will require + `using OrdinaryDiffEqNonlinearSolve`). If you wish to perform an initialization on the + complete u0, please pass initializealg = ShampineCollocationInit() to solve. Note that + initialization can be a very difficult process for DAEs and in many cases can be + numerically intractable without symbolic manipulation of the system. For an automated + system that will generate numerically stable initializations, see ModelingToolkit.jl + structural simplification for more details." + ) end function _initialize_dae!(integrator, prob::ODEProblem, alg::CheckInit,