-
Notifications
You must be signed in to change notification settings - Fork 31
Incorrect handling of <=
and >=
in event triggers
#2707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The current output feels incorrect, but I am not sure how to best address that. Adding some epsilon to the trigger to distinguish Defer event execution until after the output has been written? This feels wrong. |
I don't see a good way of differentiating between For outputs, one could consider using pre/post event values (depending on sign transition & trigger type) when computing outputs at timepoints that coincide with event timepoints. Sounds like what you meant by
|
Thanks. I was afraid so.
Yes, that's what I meant. That would "fix" the issue for the the example above. However, I think are other situations where this would cause problems, because events would still potentially be executed while the trigger condition is not exactly true. |
Tried that. This won't fully address the issue. When adding the smallest representable positive number to the trigger function, the event will not trigger at equality, but it won't necessarily trigger at the next representable timepoint after equality either, due to the tolerances applied in the root finding. I guess, for now, it's best to keep things the way they are and leave the choice of tolerance to the user, or better, completely avoid situations where the difference between >= and > matters in event triggers. |
Uh oh!
There was an error while loading. Please reload this page.
In event triggers,
<
and>
are incorrectly interpreted as<=
and>=
respectively.This somewhat similar to #2700, but a different issue. Ideally this could be addressed via #2684 and the fixes implemented in #2701.
Reproducer:
This is not just about numerics. The root functions generated for the two events are the same, despite the different comparison operators:
Generated here:
AMICI/python/sdist/amici/sbml_import.py
Lines 3096 to 3109 in a87058e
The text was updated successfully, but these errors were encountered: