Skip to content

Commit beb16ec

Browse files
feat: simplify initialization system with fully_determined=nothing by default
1 parent d4e0d0f commit beb16ec

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,7 @@ function InitializationProblem{iip, specialize}(sys::AbstractODESystem,
12951295
check_length = true,
12961296
warn_initialize_determined = true,
12971297
initialization_eqs = [],
1298-
fully_determined = false,
1298+
fully_determined = nothing,
12991299
check_units = true,
13001300
kwargs...) where {iip, specialize}
13011301
if !iscomplete(sys)
@@ -1313,6 +1313,10 @@ function InitializationProblem{iip, specialize}(sys::AbstractODESystem,
13131313
sys; u0map, initialization_eqs, check_units, pmap = parammap); fully_determined)
13141314
end
13151315

1316+
if !isempty(StructuralTransformations.singular_check(get_tearing_state(isys)))
1317+
@warn "Since the initialization system is singular, the guess values may significantly affect the initial values of the ODE"
1318+
end
1319+
13161320
uninit = setdiff(unknowns(sys), [unknowns(isys); getfield.(observed(isys), :lhs)])
13171321

13181322
# TODO: throw on uninitialized arrays

src/systems/problem_utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ function process_SciMLProblem(
498498
constructor, sys::AbstractSystem, u0map, pmap; build_initializeprob = true,
499499
implicit_dae = false, t = nothing, guesses = AnyDict(),
500500
warn_initialize_determined = true, initialization_eqs = [],
501-
eval_expression = false, eval_module = @__MODULE__, fully_determined = false,
501+
eval_expression = false, eval_module = @__MODULE__, fully_determined = nothing,
502502
check_initialization_units = false, tofloat = true, use_union = false,
503503
u0_constructor = identity, du0map = nothing, check_length = true,
504504
symbolic_u0 = false, warn_cyclic_dependency = false,

0 commit comments

Comments
 (0)