-
Notifications
You must be signed in to change notification settings - Fork 41
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
Clarification regarding elsewhen #3216
Comments
HansOlsson
added a commit
to HansOlsson/ModelicaSpecification
that referenced
this issue
Jul 8, 2022
Closes modelica#3216
Merged
In fact, I now realize that the algorithm section with elsewhen and with when won't be exactly the same. Assuming both events are triggered simultaneously, the former only executes the first branch, while the latter executes both in sequence. |
HansOlsson
added a commit
that referenced
this issue
Jul 12, 2022
* Clarify elsewhen Closes #3216 * Update chapters/equations.tex
The merged PR had a typo. Reopening instead of creating a separate issue. |
Merged
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The explanation of elsewhen in Section 8.3.5 is a bit confusing to me towards the end. The model DoubleWhenConflict is indeed erroneous, because it has an equation section, and the single assignment rule holds. However, the following WhenPriority model uses an algorithm section instead, which IMO is a bit confusing.
I understand the idea is that if you have an equation section, then you really need to use elsewhen, to establish a priority. So, I would put an equation section in model WhenPriority, not an algorithm section.
On the other hand, I understand that if you actually use an algorithm section, the algorithm is executed in the specified order, so there is no need to use elsewhen, because the priority is naturally enforced by the order of execution of the algorithm itself. Hence, I would add one more example showing this case, i.e. like DoubleWhenConflict but with an algorithm section instead.
Do I miss something?
The text was updated successfully, but these errors were encountered: