Skip to content

Commit 5fe46e6

Browse files
document the fully_determined behavior
1 parent e617703 commit 5fe46e6

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

docs/src/tutorials/initialization.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,13 @@ may not be analytically satisfiable!**. In our case here, if you sit down with a
194194
long enough you will see that `λ = 0` is required for this equation, but since we chose
195195
`λ = 1` we end up with a set of equations that are impossible to satisfy.
196196

197+
!!! note
198+
199+
If you would prefer to have an error instead of a warning in the context of non-fully
200+
determined systems, pass the keyword argument `fully_determined = true` into the
201+
problem constructor. Additionally, any warning about not being fully determined can
202+
be supressed via passing `warn_initialize_determined = false`.
203+
197204
## Diving Deeper: Constructing the Initialization System
198205

199206
To get a better sense of the initialization system and to help debug it, you can construct
@@ -271,7 +278,7 @@ sol = solve(iprob)
271278
```
272279

273280
!!! note
274-
281+
275282
For more information on solving NonlinearProblems and NonlinearLeastSquaresProblems,
276283
check out the [NonlinearSolve.jl tutorials!](https://docs.sciml.ai/NonlinearSolve/stable/tutorials/getting_started/).
277284

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,10 +1556,10 @@ function InitializationProblem{iip, specialize}(sys::AbstractODESystem,
15561556
nunknown = length(unknowns(isys))
15571557

15581558
if warn_initialize_determined && neqs > nunknown
1559-
@warn "Initialization system is overdetermined. $neqs equations for $nunknown unknowns. Initialization will default to using least squares. To suppress this warning pass warn_initialize_determined = false."
1559+
@warn "Initialization system is overdetermined. $neqs equations for $nunknown unknowns. Initialization will default to using least squares. To suppress this warning pass warn_initialize_determined = false. To make this warning into an error, pass fully_determined = true"
15601560
end
15611561
if warn_initialize_determined && neqs < nunknown
1562-
@warn "Initialization system is underdetermined. $neqs equations for $nunknown unknowns. Initialization will default to using least squares. To suppress this warning pass warn_initialize_determined = false."
1562+
@warn "Initialization system is underdetermined. $neqs equations for $nunknown unknowns. Initialization will default to using least squares. To suppress this warning pass warn_initialize_determined = false. To make this warning into an error, pass fully_determined = true"
15631563
end
15641564

15651565
parammap = parammap isa DiffEqBase.NullParameters || isempty(parammap) ?

0 commit comments

Comments
 (0)