Skip to content

Commit 4ea6733

Browse files
committed
update
1 parent a3c9b83 commit 4ea6733

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/reactionsystem.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,7 +1609,7 @@ function Base.convert(::Type{<:NonlinearSystem}, rs::ReactionSystem; name = name
16091609

16101610
# Throws a warning if there are differential equations in non-standard format.
16111611
# Next, sets all differential terms to `0`.
1612-
nonlinear_convert_differentials_check(eqs, nonspecies(rs), get_iv(rs))
1612+
nonlinear_convert_differentials_check(rs)
16131613
eqs = [remove_diffs(eq.lhs) ~ remove_diffs(eq.rhs) for eq in eqs]
16141614

16151615

@@ -1635,8 +1635,8 @@ diff_2_zero(expr) = (Symbolics.is_derivative(expr) ? 0.0 : expr)
16351635
# on the form D(X) ~ ..., where lhs is the time derivative w.r.t. a single variable, and the rhs
16361636
# does not contain any differentials. If this is not teh case, we throw a warning to let the user
16371637
# know that they should be careful.
1638-
function nonlinear_convert_differentials_check(eqs, vars, iv)
1639-
for eq in eqs
1638+
function nonlinear_convert_differentials_check(rs::ReactionSystem)
1639+
for eq in equations(rs)
16401640
# For each equation (that is not a reaction), checks in order:
16411641
# If there is a differential on the right hand side.
16421642
# If the lhs is not on the form D(...).
@@ -1646,9 +1646,9 @@ function nonlinear_convert_differentials_check(eqs, vars, iv)
16461646
(eq isa Reaction) && continue
16471647
if Symbolics._occursin(Symbolics.is_derivative, eq.rhs) ||
16481648
!Symbolics.istree(eq.lhs) ||
1649-
!isequal(Symbolics.operation(eq.lhs), Differential(iv)) ||
1649+
!isequal(Symbolics.operation(eq.lhs), Differential(get_iv(rs))) ||
16501650
(length(arguments(eq.lhs)) != 1) ||
1651-
!any(isequal(arguments(eq.lhs)[1]), vars)
1651+
!any(isequal(arguments(eq.lhs)[1]), nonspecies(rs))
16521652
@warn "You are attempting to convert a `ReactionSystem` coupled with differential equations. However, some of these differentials are not of the form `D(x) ~ ...` where:
16531653
(1) The left-hand side is a differential of a single variable with respect to the time independent variable, and
16541654
(2) The right-hand side does not contain any differentials.

0 commit comments

Comments
 (0)