Skip to content

Commit 8636420

Browse files
committed
Make CheckInit more informative
1 parent 86aa145 commit 8636420

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/SciMLBase.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,8 @@ export ODEFunction, DiscreteFunction, ImplicitDiscreteFunction, SplitFunction, D
835835

836836
export OptimizationFunction, MultiObjectiveOptimizationFunction
837837

838+
export CheckInit
839+
838840
export EnsembleThreads, EnsembleDistributed, EnsembleSplitThreads, EnsembleSerial
839841

840842
export EnsembleAnalysis, EnsembleSummary

src/initialization.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,17 @@ end
5959

6060
function Base.showerror(io::IO, e::CheckInitFailureError)
6161
print(io,
62-
"CheckInit specified but initialization not satisfied. normresid = $(e.normresid) > abstol = $(e.abstol)")
62+
"DAE initialization failed: your u0 did not satisfy the initialization requirements,
63+
normresid = $(e.normresid) > abstol = $(e.abstol). If you wish for the system to
64+
automatically change the algebraic variables to satisfy the algebraic constraints,
65+
please pass `initializealg = BrownBasicInit()` to solve (this option will require
66+
`using OrdinaryDiffEqNonlinearSolve`). If you wish to perform an initialization on the
67+
complete u0, please pass initializealg = ShampineCollocationInit() to solve. Note that
68+
initialization can be a very difficult process for DAEs and in many cases can be
69+
numerically intractable without symbolic manipulation of the system. For an automated
70+
system that will generate numerically stable initializations, see ModelingToolkit.jl
71+
structural simplification for more details."
72+
)
6373
end
6474

6575
struct OverrideInitMissingAlgorithm <: Exception end

0 commit comments

Comments
 (0)