Skip to content

Commit 3854947

Browse files
committed
Sort states before tearing
1 parent 7897880 commit 3854947

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/systems/abstractsystem.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -525,12 +525,9 @@ function structural_simplify(sys::AbstractSystem)
525525
sys = initialize_system_structure(alias_elimination(sys))
526526
check_consistency(structure(sys))
527527
if sys isa ODESystem
528-
sys = dae_index_lowering(sys)
528+
sys = sort_states(dae_index_lowering(sys))
529529
end
530530
sys = tearing(sys)
531-
if sys isa ODESystem
532-
sys = sort_states(sys)
533-
end
534531
fullstates = [map(eq->eq.lhs, observed(sys)); states(sys)]
535532
@set! sys.observed = topsort_equations(observed(sys), fullstates)
536533
return sys

0 commit comments

Comments
 (0)