Skip to content

Commit ed53cb3

Browse files
authored
Merge pull request #1500 from SciML/myb/tearingfix
Add allow_parameter option and make find_eq_solvables less aggressive
2 parents 8e95263 + f73a2ab commit ed53cb3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/structural_transformation/utils.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ end
158158
### Structural and symbolic utilities
159159
###
160160

161-
function find_eq_solvables!(state::TearingState, ieq; may_be_zero=false, allow_symbolic=true)
161+
function find_eq_solvables!(state::TearingState, ieq; may_be_zero=false, allow_symbolic=false, allow_parameter=true)
162162
fullvars = state.fullvars
163163
@unpack graph, solvable_graph = state.structure
164164
eq = equations(state)[ieq]
@@ -171,7 +171,13 @@ function find_eq_solvables!(state::TearingState, ieq; may_be_zero=false, allow_s
171171
a = unwrap(a)
172172
islinear || continue
173173
if a isa Symbolic
174-
allow_symbolic || continue
174+
if !allow_symbolic
175+
if allow_parameter
176+
ModelingToolkit.isparameter(a) || continue
177+
else
178+
continue
179+
end
180+
end
175181
add_edge!(solvable_graph, ieq, j)
176182
continue
177183
end
@@ -191,7 +197,7 @@ function find_eq_solvables!(state::TearingState, ieq; may_be_zero=false, allow_s
191197
end
192198
end
193199

194-
function find_solvables!(state::TearingState; allow_symbolic=true)
200+
function find_solvables!(state::TearingState; allow_symbolic=false)
195201
@assert state.structure.solvable_graph === nothing
196202
eqs = equations(state)
197203
graph = state.structure.graph

0 commit comments

Comments
 (0)