-
Notifications
You must be signed in to change notification settings - Fork 164
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
Remove legacy initialization of Modelica.Blocks.Continuous.{PID, LimPID} #2898
Conversation
@HansOlsson Friendly reminder. |
I haven't forgotten it. But I think it will take some time to look at and I haven't had that time. |
The problem with the above is that it uses the non-existent enumeration element. IF the value is literal I assume it would be possible to find some solution, but if initType is non-literal (e.g. a propagated parameter) I don't see how it could be done in one go with current conversions. I see the following possibility Just convert the enumeration element - not the modifier! I tried the following alternatives:
And even if the second may seem more correct (even if neither is really good), the first worked better in Dymola; and I can understand that it is similar for other tools. I didn't fully understand if that handled the conversion completely or not. If it doesn't something more advanced is needed. |
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.
Added comments in conversation. The completed part seems good.
This PR is now ready for review.
It required all three commands
to successfully run the conversion of ModelicaTestConversion4.Blocks.Issue2892 in Dymola 2020. |
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.
Looks good.
Convert enumeration type InitPID to Init
In 49460b0 for modelica#2898 the default initType of PID was converted from InitPID.DoNotUse_InitialIntegratorState to Init.InitialState. For LimPID it was different, that is from InitPID.DoNotUse_InitialIntegratorState to Init.NoInit. The conversion rule was added to convert from InitPID.DoNotUse_InitialIntegratorState to Init.NoInit, matching the LimPID manual conversion. It was reported that the conversion to Init.NoInit breaks the initialization and model structure of user models. Despite Init.NoInit being the default initType for PI, the default initialization for PID and LimPID should better be converted to Init.InitialState. No matter if Init.NoInit or Init.InitialState, the initialization of the converted PID or LimPID component behaves differently since there is no compatibility preserving conversion possible.
@HansOlsson This is what I tried to remove the now invalid modifier
Init.DoNotUse_InitialIntegratorState
. But no matter what I did, it did not work out, since enumeration simplification did not run when convertingModelicaTestConversion4.Blocks.Issue2892
.Do you have any hint how to do it?
Closes #2892.