Skip to content

Commit

Permalink
Fix compilation error for models with events and xdot=0 (#2111)
Browse files Browse the repository at this point in the history
Fixes #2110
  • Loading branch information
dweindl authored May 25, 2023
1 parent 3b4e12d commit fd1e22e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/sdist/amici/de_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -1999,9 +1999,10 @@ def _compute_equation(self, name: str) -> None:

# need to check if equations are zero since we are using
# symbols
if not smart_is_zero_matrix(self.eq("stau")[ie]):
if not smart_is_zero_matrix(self.eq("stau")[ie]) \
and not smart_is_zero_matrix(self.eq("xdot")):
tmp_eq += smart_multiply(
(self.sym("xdot_old") - self.sym("xdot")),
self.sym("xdot_old") - self.sym("xdot"),
self.sym("stau").T,
)

Expand Down

0 comments on commit fd1e22e

Please sign in to comment.