Skip to content

Commit d584eab

Browse files
fix: check and update is_discrete flag in simplification
1 parent 60439b1 commit d584eab

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/systems/systemstructure.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,8 +720,13 @@ function mtkcompile!(state::TearingState; simplify = false,
720720
"""))
721721
end
722722
end
723-
if continuous_id == 1 && any(Base.Fix2(isoperator, Shift), state.fullvars)
723+
if get_is_discrete(state.sys) ||
724+
continuous_id == 1 && any(Base.Fix2(isoperator, Shift), state.fullvars)
724725
state.structure.only_discrete = true
726+
state = shift_discrete_system(state)
727+
sys = state.sys
728+
@set! sys.is_discrete = true
729+
state.sys = sys
725730
end
726731

727732
sys = _mtkcompile!(state; simplify, check_consistency,

0 commit comments

Comments
 (0)