Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Change to NoInit in ClockedWithDiscretizedContinuousController #4465
Change to NoInit in ClockedWithDiscretizedContinuousController #4465
Changes from all commits
3675c4d
db47055
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't
x(fixed = true)
a violation of this rule from https://specification.modelica.org/master/synchronous-language-elements.html#initialization-of-clocked-partitions?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouch. So, how are initial conditions specified for such clocked partitions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a valid question, but more work on the specification side is needed to answer it. Until then, I would just find it best to avoid breaking one of the few simple rules we have.
By the way, System Modeler also warns about underdetermined initialization where
PI.x
was automatically selected to be initialized fromstart
, so it is not only in Dymola that this example will not run as cleanly as we'd ideally want it to.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should also mention that System Modeler is lacking a check for
so I can't tell how close the rest of the MSL is to complying with the rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some more thinking I think the specification got a bit messed up when trying to clarify.
Basically I don't see how we can get this to work as desired for MSL with the current specification:
However, going back to 3.5 the rule for initial equations and fixed only applied to "clocked discrete-time partitions", which are now called "discrete-time sub-partitions". That should be restored, and we can see that example in https://specification.modelica.org/master/synchronous-language-elements.html#solver-methods has fixed=true.
Obviously we will later clarify initialization for "discrete-time sub-partitions".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "having fully defined initial conditions" is a strong requirement for tool-independent behaviour. If this is not possible with the current specification, I agree at relaxing/changing it. @HansOlsson would the proposed changes to the code OK with your proposed change to the MLS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the proposed change to the specification there is no need to update this model at all, as the restrictions apply equally to initial equations and fixed=true.