Skip to content

Commit 920fcc2

Browse files
Remove early caching initialization system
1 parent 90ceeda commit 920fcc2

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,8 +1541,6 @@ function InitializationProblem{iip, specialize}(sys::AbstractODESystem,
15411541
error("A completed system is required. Call `complete` or `structural_simplify` on the system before creating an `ODEProblem`")
15421542
end
15431543

1544-
@show u0map
1545-
15461544
if isempty(u0map) && get_initializesystem(sys) !== nothing
15471545
isys = get_initializesystem(sys)
15481546
elseif isempty(u0map) && get_initializesystem(sys) === nothing

src/systems/systemstructure.jl

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -636,23 +636,5 @@ function _structural_simplify!(state::TearingState, io; simplify = false,
636636
fullunknowns = [map(eq -> eq.lhs, observed(sys)); unknowns(sys)]
637637
@set! sys.observed = ModelingToolkit.topsort_equations(observed(sys), fullunknowns)
638638

639-
ci = infer_clocks!(ClockInference(state))
640-
# TODO: make it work with clocks
641-
if sys isa ODESystem && all(isequal(Continuous()), ci.var_domain) &&
642-
(!has_io ||
643-
!all(all(x -> !(typeof(x) <: Union{Sample, Hold, ShiftIndex}), io)))
644-
isys = ModelingToolkit.generate_initializesystem(sys)
645-
!isempty(equations(isys)) &&
646-
(isys = structural_simplify(isys; fully_determined = false))
647-
@set! sys.initializesystem = isys
648-
neqs = length(equations(isys))
649-
nunknown = length(unknowns(isys))
650-
if warn_initialize_determined && neqs > nunknown
651-
@warn "Initialization system is overdetermined. $neqs equations for $nunknown unknowns. Initialization will default to using least squares if $(nunknown - neqs) defaults are not supplied at construction time."
652-
end
653-
if warn_initialize_determined && neqs < nunknown
654-
@warn "Initialization system is underdetermined. $neqs equations for $nunknown unknowns. Initialization will default to using least squares"
655-
end
656-
end
657639
ModelingToolkit.invalidate_cache!(sys), input_idxs
658640
end

0 commit comments

Comments
 (0)