@@ -33,7 +33,7 @@ function var_derivative!(ts::TearingState{ODESystem}, v::Int)
33
33
sys = ts. sys
34
34
s = ts. structure
35
35
D = Differential (get_iv (sys))
36
- add_vertex! (s. solvable_graph, DST)
36
+ s . solvable_graph === nothing || add_vertex! (s. solvable_graph, DST)
37
37
push! (ts. fullvars, D (ts. fullvars[v]))
38
38
end
39
39
@@ -43,7 +43,7 @@ function eq_derivative!(ts::TearingState{ODESystem}, ieq::Int)
43
43
D = Differential (get_iv (sys))
44
44
eq = equations (ts)[ieq]
45
45
eq = ModelingToolkit. expand_derivatives (0 ~ D (eq. rhs - eq. lhs))
46
- add_vertex! (s. solvable_graph, SRC)
46
+ s . solvable_graph === nothing || add_vertex! (s. solvable_graph, SRC)
47
47
push! (equations (ts), eq)
48
48
# Analyze the new equation and update the graph/solvable_graph
49
49
# First, copy the previous incidence and add the derivative terms.
@@ -54,7 +54,7 @@ function eq_derivative!(ts::TearingState{ODESystem}, ieq::Int)
54
54
add_edge! (s. graph, eq_diff, var)
55
55
add_edge! (s. graph, eq_diff, s. var_to_diff[var])
56
56
end
57
- find_eq_solvables! (ts, eq_diff; may_be_zero= true , allow_symbolic= true )
57
+ s . solvable_graph === nothing || find_eq_solvables! (ts, eq_diff; may_be_zero= true , allow_symbolic= true )
58
58
end
59
59
60
60
function tearing_sub (expr, dict, s)
0 commit comments