Skip to content

Commit

Permalink
Check that all unknowns have a guess
Browse files Browse the repository at this point in the history
  • Loading branch information
hersle committed Jul 18, 2024
1 parent d8dec36 commit 53e2aad
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/systems/diffeqs/abstractodesystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1565,6 +1565,12 @@ function InitializationProblem{iip, specialize}(sys::AbstractODESystem,
u0map = isempty(u0map) ? Dict() : todict(u0map)
guesses = isempty(guesses) ? Dict() : todict(guesses)

# Check that all unknowns have guesses
# TODO: which, if any, unknowns should be excluded from this guess?
for x in unknowns(isys)
x in keys(guesses) || throw(ArgumentError("Missing guess for $x."))
end

u0map = merge(guesses, u0map)
if neqs == nunknown
NonlinearProblem(isys, u0map, parammap; kwargs...)
Expand Down

0 comments on commit 53e2aad

Please sign in to comment.