@@ -80,21 +80,26 @@ function SciMLBase.SCCNonlinearProblem{iip}(sys::System, op; eval_expression = f
80
80
end
81
81
82
82
ts = get_tearing_state (sys)
83
- var_eq_matching, var_sccs = StructuralTransformations. algebraic_variables_scc (ts)
83
+ sched = get_schedule (sys)
84
+ if sched === nothing
85
+ @warn " System is simplified but does not have a schedule. This should not happen."
86
+ var_eq_matching, var_sccs = StructuralTransformations. algebraic_variables_scc (ts)
87
+ condensed_graph = MatchedCondensationGraph (
88
+ DiCMOBiGraph {true} (complete (ts. structure. graph),
89
+ complete (var_eq_matching)),
90
+ var_sccs)
91
+ toporder = topological_sort_by_dfs (condensed_graph)
92
+ var_sccs = var_sccs[toporder]
93
+ eq_sccs = map (Base. Fix1 (getindex, var_eq_matching), var_sccs)
94
+ else
95
+ var_sccs = eq_sccs = sched. var_sccs
96
+ end
84
97
85
98
if length (var_sccs) == 1
86
99
return NonlinearProblem {iip} (
87
100
sys, op; eval_expression, eval_module, kwargs... )
88
101
end
89
102
90
- condensed_graph = MatchedCondensationGraph (
91
- DiCMOBiGraph {true} (complete (ts. structure. graph),
92
- complete (var_eq_matching)),
93
- var_sccs)
94
- toporder = topological_sort_by_dfs (condensed_graph)
95
- var_sccs = var_sccs[toporder]
96
- eq_sccs = map (Base. Fix1 (getindex, var_eq_matching), var_sccs)
97
-
98
103
dvs = unknowns (sys)
99
104
ps = parameters (sys)
100
105
eqs = equations (sys)
0 commit comments