diff --git a/src/systems/diffeqs/abstractodesystem.jl b/src/systems/diffeqs/abstractodesystem.jl index 3f71479fb0..277eec5c83 100644 --- a/src/systems/diffeqs/abstractodesystem.jl +++ b/src/systems/diffeqs/abstractodesystem.jl @@ -1439,11 +1439,17 @@ function InitializationProblem{iip, specialize}(sys::AbstractODESystem, if isempty(u0map) && get_initializesystem(sys) !== nothing isys = get_initializesystem(sys; initialization_eqs, check_units) elseif isempty(u0map) && get_initializesystem(sys) === nothing - isys = structural_simplify( - generate_initializesystem(sys; initialization_eqs, check_units); fully_determined) + isys = generate_initializesystem(sys; initialization_eqs, check_units) + _fully_determined = fully_determined === nothing ? + length(equations(isys)) == length(unknowns(isys)) : + fully_determined + isys = structural_simplify(isys; _fully_determined) else - isys = structural_simplify( - generate_initializesystem(sys; u0map, initialization_eqs, check_units); fully_determined) + isys = generate_initializesystem(sys; u0map, initialization_eqs, check_units) + _fully_determined = fully_determined === nothing ? + length(equations(isys)) == length(unknowns(isys)) : + fully_determined + isys = structural_simplify(isys; _fully_determined) end uninit = setdiff(unknowns(sys), [unknowns(isys); getfield.(observed(isys), :lhs)])