Skip to content

Commit 647c0cf

Browse files
committed
Fix #963
1 parent 69b6f09 commit 647c0cf

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

src/systems/alias_elimination.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,8 @@ using SymbolicUtils: Rewriters
33
const KEEP = typemin(Int)
44

55
function alias_elimination(sys)
6-
# FIXME: update `structure` too
7-
#sys = flatten(sys)
8-
#s = get_structure(sys)
9-
#if !(s isa SystemStructure)
106
sys = initialize_system_structure(sys)
117
s = structure(sys)
12-
#end
138
is_linear_equations, eadj, cadj = find_linear_equations(sys)
149

1510
v_eliminated, v_types, n_null_vars, degenerate_equations, linear_equations = alias_eliminate_graph(

src/systems/systemstructure.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ function find_linear_equations(sys)
227227
c = expand_derivatives(Differential(var)(term), false)
228228
# test if `var` is linear in `eq`.
229229
if !(c isa Symbolic) && c isa Number
230-
if isinteger(c) && !iszero(c)
230+
if (c == 1 || c == -1) && !iszero(c)
231231
c = convert(Integer, c)
232232
linear_term += c * var
233233
push!(coeffs, c)

0 commit comments

Comments
 (0)