Skip to content
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

Execution of multiple event assignments from the same event #2430

Closed
dweindl opened this issue May 7, 2024 · 3 comments
Closed

Execution of multiple event assignments from the same event #2430

dweindl opened this issue May 7, 2024 · 3 comments
Labels
events related to handing discrete events SBML SBML import related

Comments

@dweindl
Copy link
Member

dweindl commented May 7, 2024

Multiple event assignments from the same event should be executed simultaneously. From the SBML L3V2 specs:

In other words, a single event cannot have multiple EventAssignment children
assigning the same variable. (All of them would be performed at the same time, when that particular
Event triggers, resulting in indeterminacy.)

However, that doesn't seem to be the case:

# else the species was affected by an event assignment,
# hence the updated value should be updated further.
else:
species_value = bolus[state_vector.index(species_sym)]

I'd say, in the else case, that assignment should be ignored.

Example: Assuming a model with a concentration-based species S in compartment C, and an event with two event assignments – EA_S assigning to S and EA_C assigning to C.
In this case, S should only change due to EA_S, but not due to the volume change caused by EA_C. Currently, first EA_S is applied, then EA_C.

Correct?

@dweindl dweindl added SBML SBML import related events related to handing discrete events labels May 7, 2024
dweindl added a commit to dweindl/AMICI that referenced this issue May 7, 2024
@FFroehlich
Copy link
Member

# else the species was affected by an event assignment,
# hence the updated value should be updated further.
else:
species_value = bolus[state_vector.index(species_sym)]

I'd say, in the else case, that assignment should be ignored.

Example: Assuming a model with a concentration-based species S in compartment C, and an event with two event assignments – EA_S assigning to S and EA_C assigning to C. In this case, S should only change due to EA_S, but not due to the volume change caused by EA_C. Currently, first EA_S is applied, then EA_C.

Correct?

Yes, sounds correct.

@dweindl
Copy link
Member Author

dweindl commented May 7, 2024

From elsewhere in the SBML spec (sec 4.6.8):

There is one exception: if
the species’ quantity is determined by an AssignmentRule, RateRule, AlgebraicRule, or an EventAssignment
and the species has the attribute value hasOnlySubstanceUnits=“false”, it means that the concentration
is assigned by the rule or event; in that case, the amount must be calculated when the compartment size
changes.

It's not exactly intuitive and quite possibly a common source of error, but the present implementation is correct.

@dweindl dweindl closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
events related to handing discrete events SBML SBML import related
Projects
None yet
Development

No branches or pull requests

2 participants