-
Notifications
You must be signed in to change notification settings - Fork 168
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
base: master
Are you sure you want to change the base?
Change to NoInit in ClockedWithDiscretizedContinuousController #4465
Conversation
Modelica/Clocked/Examples/SimpleControlledDrive/ClockedWithDiscretizedContinuousController.mo
Show resolved
Hide resolved
Co-authored-by: Hans Olsson <[email protected]>
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 @HansOlsson's suggestion this looks good to me, also for MSL 4.1.0
@Esther-Devakirubai, please back-port this to maint/4.1.x as soon as it is merged in. Thanks! |
initType=Modelica.Blocks.Types.Init.InitialOutput, | ||
y_start=0, | ||
initType=Modelica.Blocks.Types.Init.NoInit, | ||
x(fixed=true), |
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?
Attribute
fixed
cannot be applied to variables in clocked partitions. The attributefixed
is true for variables to whichprevious
is applied, otherwise false.
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 from start
, 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
Attribute
fixed
cannot be applied to variables in clocked partitions.
so I can't tell how close the rest of the MSL is to complying with the rule.
Fixes #4458.
As discussed in today's MAP-Lib monthly meeting.
There appears to be no need to update the reference result.