-
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
Enhance frictional models based on ExternalCombiTable1D #3662
Conversation
May I suggest a name change? Calling things |
It is an slightly improved implementation. I only did so for the sake of consistency since we already have ElastoBacklash and ElastoBacklash2 in Rotational.Components (and even other component models like Diode and Diode2). |
Actually, this reimplementation shall have the same functionality as the original clutch model. So why is it necessary to double it? |
We shall also reimplement |
ab487c2
to
0fca0a7
Compare
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.
Very good proposal (the "current" friction elements had been implemented at a time, where no table interpolation was available and therefore a quick implementation with a Modelica function was made;).
However, it would be good to use the new friction elements at least in one example (maybe I missed this).
I already updated Modelica.Mechanics.Rotational.Examples.CoupledClutches to utilize Clutch2.
@MartinOtter Do you agree to also add the interpolation smoothness as new parameter? In that case we no longer should use Modelica.Math.Vectors.interpolate to determine mu0. |
O.k.
Yes, smoothness makes sense and mu0 should no longer be used with Vectors.interpolate. |
Done for Clutch2 for first review. @tobolar If you agree we should migrate Brake2 and OneWayClutch2 from block CombiTable1D to external object ExternalCombiTable1D, too. |
I agree that the revised models Clutch2/Brake2/OneWayClutch2 fall back to the same functionality as the legacy models Clutch/Brake/OneWayClutch. There is no particular reason (except that protected mu0 changed variability from variable to parameter) to not simply update the original models. @MartinOtter needs to decide here. If he agrees we can avoid the duplication of the models. |
5b53ad4
to
d9003f3
Compare
That is good (= more intuitive).
I agree with @otronarp. We should avoid doubling and names like Is there any rationale or argument why we need two clutch implementations; why we have to keep the old as well? Does the redesign have any drawbacks (functional or non-functional like useabelility or performance)? This is particularly important because
which would result in a plethora of Do we also double the test models/examples utilizing the redesign? Or would we just not use one of the two implementations? Thus, I like to push on:
@MartinOtter what is your opinion? |
@tobolar: The
i.e., always linear segments as smoothness; likewise the I propose to handle it like @beutlich improved for |
Above two things, (1) can we avoid doubling of clutch, brake etc models and (2) consistent support for full table smoothness, have to be addressed from my point of view before a positive review. |
Note, that I added Clutch2 and updated it with full table smoothnes just as an offer to discuss with the library officers to get their opinion which way to head. Once this is clarified we can modify/add Brake and OneWayClutch accordingly. |
Since the piece of code
will be used also in other elements (and they are not only Rotational, see #3664), we shall extract it into a separate function. What could be the best location for such a function? |
I also thought about this. My proposal is to introduce inline function Modelica.Blocks.Tables.getTable1DValue (or Modelica.Blocks.Tables.Functions.getTable1DValue) (taking the smoothness as argument) and calling the functions from Internal. @tobolar Can you do it? |
I will prepare a suggestion. |
Co-authored-by: Thomas Beutlich <[email protected]>
@HansOlsson @christoff-buerger Can you please confirm that the Evaluate annotation for mu0 should be removed again. Thanks. |
8a2bb0a
to
b5f5d92
Compare
To me "Evaluate=true" should be removed as mu0 should not be evaluated during translation, since it depends on the external table (and evaluating that during translation requires quite specific solution and doesn't really help). |
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.
As indicated remove the Evaluate=true for mu0.
b5f5d92
to
8e2d078
Compare
Done. Please update your review. Thank you again! |
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 now.
OK, waiting for @christoff-buerger's final approval then. |
As long as the changes are backwards compatible (e.g. only new parameters added, but not old parameters removed or changed), it is of course better to have only one model and not two different models. |
The "Evaluate=true" stems from the original redesign where mu0 was still defined by means of Since we decided since than that full table interpolation modes should be supported (not just linear), we also have to define mu0 via a combi-table now (because we need to support spline interpolation & co). From a design point, mu0 is a constant. It is pity that we cannot use "Evaluate=true" with it because combi-tables as external objects are challenging for Modelica tools. To that end, I see your concern as a tool shortcoming/challenge. It is an important point however -- that tables are not suited for "Evaluate=true" -- such that this annotation should be dropped. |
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. We have all relevant classes redesigned to use tables instead of Modelica.Math.Vectors.interpolate
and support all kind of table smoothness/interpolation modes.
There are no class / functionality duplications like Clutch2
etc.
We also have no Evaluate=true
on constants derived via table interpolation, since such is troublesome for external table objects (a common tooling shortcoming).
It can be merged from my perspective. |
@christoff-buerger This adds your proposal as PR. Note that I swapped the components of table_signs to match the columns of mu_pos.
Since CombiTable1Ds supports more interpolation smoothness kinds we also could get rid of
ModelicaStandardLibrary/Modelica/Mechanics/Rotational/Components/Clutch.mo
Lines 102 to 103 in 81dd1b6
, but might lose mu0 being a parameter again.
Closes #3661