Skip to content

Commit 722b29f

Browse files
committed
More robust index reduction
1 parent f184bfd commit 722b29f

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/structural_transformation/pantelides.jl

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,11 @@ function pantelides_reassemble(sys, eqassoc, assign)
6363
lhsarg1 = arguments(eq.lhs)[1]
6464
@assert !(lhsarg1 isa Differential) "The equation $eq is not first order"
6565
i = get(d_dict, lhsarg1, nothing)
66-
if i !== nothing
67-
lhs = D(out_vars[varassoc[i]])
68-
if lhs in lhss
69-
# check only trivial equations are removed
70-
@assert isequal(diff2term(D(eq.rhs)), diff2term(lhs)) "The duplicate equation is not trivial: $eq"
71-
lhs = Num(nothing)
72-
end
73-
lhs
74-
else
66+
if i === nothing
7567
D(eq.lhs)
68+
else
69+
# remove clashing equations
70+
lhs = Num(nothing)
7671
end
7772
else
7873
D(eq.lhs)

0 commit comments

Comments
 (0)