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
Should clock partitions with consistent rational clocks be merged? #3265
Comments
Adding @AnHeuermann, @kabdelhak, and @phannebohm in the loop. |
BTW: Following the specification it should be
No, and conceptually they aren't even allowed to be in the same clock partition in that model. The goal is instead to consider the following models:
Here SameClock1 and SameClock3 are legal, but SameClock2 is not legal (it would be straightforward to allow SameClock2 but as soon as there are subSample etc it would be a mess). Without the
Clocks can be synchronized (in the sense of ticking at the same time) without being part of the same clock partition. (But if they are in the same clock partition they must be synchronized.) |
Sorry, I mixed up several versions of the MWE and eventually copied the wrong one. Corrected. |
OK. So
In particular, if I added Real e = x1 - x2; to the Also, if the synchronous Modelica code was used to generate real-time code, it is a quality of implementation issue that the variables in different (but synchronized) partitions are put in tasks that are actually executed at the same time, or possibly even merged in the same task, eventually. @HansOlsson do I get everything right? |
I think so, yes. |
Will see if can be clarified. |
The non-normative addition helps clarifying the issue. I wonder if we could add to 0bbfdf something like "It is a quality of implementation that such partitioned are executed synchronously, e.g. by putting them in the same task in a real-time simulation context.". Or is it too much? |
Added (after slight changes). |
Good! Where do I see that? |
LGTM. Thanks! |
* Clarify that clock is only determined from equations. Closes #3265 Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
Consider the following MWE:
According to Section 16.3, which states
the variables
x1
andx2
may belong to the same base clock partition (in fact to the same clock partition in this case, since the two clocks are identical).The question is: are they required to be in the same clock partition?
The documentation of Modelica.Clocked.ClockSignals.Clocks.PeriodicExactClock states:
This seems to me to imply that
x1
andx2
should belong to the same clock partition, i.e., that merging the base clock partitions that are consistent with each other is mandatory. However, I could not find any statement in the specification backing this requirement. BTW, the current OMC implementation doesn't do that.Is that a quality of implementation issue? I don't think it should. I would find it a bit weird that end users employ PeriodicExactClock components in their models assuming that consistent clocks will be synchronized (because they read the block documentation, not the MLS), to later find out to their dismay they aren't.
The text was updated successfully, but these errors were encountered: