Skip to content

Commit e0bdf29

Browse files
authored
Merge pull request #1559 from SciML/myb/error_check
Make sure that potential state variables are not eliminated by alias_elimination
2 parents da64552 + c2dc287 commit e0bdf29

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/systems/alias_elimination.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ function alias_eliminate_graph!(graph, var_to_diff, mm_orig::SparseMatrixCLIL)
287287
diff_to_var = invview(var_to_diff)
288288
function lss!(ei::Integer)
289289
vi = pivots[ei]
290-
# the lowest differentiated variable can be eliminated
291-
islowest = isnothing(diff_to_var[vi])
290+
# the differentiated variable cannot be eliminated
291+
islowest = isnothing(diff_to_var[vi]) && isnothing(var_to_diff[vi])
292292
locally_structure_simplify!((@view mm[ei, :]), vi, ag, islowest)
293293
end
294294

0 commit comments

Comments
 (0)