Skip to content

Commit

Permalink
Make CheckInit more informative
Browse files Browse the repository at this point in the history
  • Loading branch information
Ickaser committed Dec 3, 2024
1 parent 86aa145 commit 8636420
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/SciMLBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,8 @@ export ODEFunction, DiscreteFunction, ImplicitDiscreteFunction, SplitFunction, D

export OptimizationFunction, MultiObjectiveOptimizationFunction

export CheckInit

export EnsembleThreads, EnsembleDistributed, EnsembleSplitThreads, EnsembleSerial

export EnsembleAnalysis, EnsembleSummary
Expand Down
12 changes: 11 additions & 1 deletion src/initialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,17 @@ end

function Base.showerror(io::IO, e::CheckInitFailureError)
print(io,
"CheckInit specified but initialization not satisfied. 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

struct OverrideInitMissingAlgorithm <: Exception end
Expand Down

0 comments on commit 8636420

Please sign in to comment.