diff --git a/python/sdist/amici/de_export.py b/python/sdist/amici/de_export.py index a4328a610e..f9d553f06c 100644 --- a/python/sdist/amici/de_export.py +++ b/python/sdist/amici/de_export.py @@ -2757,11 +2757,12 @@ def _process_heavisides( for tmp_old in set(tmp_roots_old): # we want unique identifiers for the roots tmp_new = self._get_unique_root(tmp_old, roots) - heavisides.append((sp.Heaviside(tmp_old), tmp_new)) - # `tmp_new` is None if the root is not time-dependent. if tmp_new is None: continue + + heavisides.append((sp.Heaviside(tmp_old), tmp_new)) + # For Heavisides, we need to add the negative function as well self._get_unique_root(sp.sympify(-tmp_old), roots)