Skip to content

Commit c540835

Browse files
committed
Fix consistency check
1 parent 460252a commit c540835

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/structural_transformation/utils.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ function check_consistency(state::TearingState, ag = nothing)
7676

7777
unassigned_var = []
7878
for (vj, eq) in enumerate(extended_var_eq_matching)
79-
if eq === unassigned && (ag === nothing || !haskey(ag, vj))
79+
if eq === unassigned && (ag === nothing || !haskey(ag, vj)) &&
80+
!isempty(𝑑neighbors(graph, vj))
8081
push!(unassigned_var, fullvars[vj])
8182
end
8283
end

test/clock.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ eqs = [yd ~ Sample(t, dt)(y)
114114
@named sys = ODESystem(eqs)
115115
ci, varmap = infer_clocks(sys)
116116
tss, inputs = ModelingToolkit.split_system(deepcopy(ci))
117-
sss, = ModelingToolkit.structural_simplify!(deepcopy(tss[2]), (inputs[2], ()),
118-
check_consistency = false)
117+
sss, = ModelingToolkit.structural_simplify!(deepcopy(tss[2]), (inputs[2], ()))
119118
@test length(states(sss)) == 2
120119
z, z_t = states(sss)
121120
S = Shift(t, 1)

0 commit comments

Comments
 (0)