-
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
Improve table design of Modelica.Mechanics.Rotational.Components.Clutch to use static tables instead of dynamic #3661
Labels
enhancement
New feature or enhancement
L: Mechanics.Rotational
Issue addresses Modelica.Mechanics.Rotational
Milestone
Comments
christoff-buerger
added
enhancement
New feature or enhancement
L: Mechanics.Rotational
Issue addresses Modelica.Mechanics.Rotational
labels
Nov 11, 2020
beutlich
added a commit
to beutlich/ModelicaStandardLibrary
that referenced
this issue
Nov 11, 2020
beutlich
added a commit
to beutlich/ModelicaStandardLibrary
that referenced
this issue
Nov 16, 2020
beutlich
added a commit
to beutlich/ModelicaStandardLibrary
that referenced
this issue
Nov 16, 2020
beutlich
added a commit
to beutlich/ModelicaStandardLibrary
that referenced
this issue
Nov 19, 2020
beutlich
added a commit
to beutlich/ModelicaStandardLibrary
that referenced
this issue
Nov 19, 2020
beutlich
added a commit
to beutlich/ModelicaStandardLibrary
that referenced
this issue
Nov 19, 2020
beutlich
added a commit
to beutlich/ModelicaStandardLibrary
that referenced
this issue
Dec 13, 2020
beutlich
added a commit
to beutlich/ModelicaStandardLibrary
that referenced
this issue
Dec 13, 2020
beutlich
added a commit
to beutlich/ModelicaStandardLibrary
that referenced
this issue
Dec 13, 2020
beutlich
added a commit
to beutlich/ModelicaStandardLibrary
that referenced
this issue
Dec 13, 2020
beutlich
added a commit
to beutlich/ModelicaStandardLibrary
that referenced
this issue
Dec 14, 2020
beutlich
added a commit
to beutlich/ModelicaStandardLibrary
that referenced
this issue
Dec 14, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or enhancement
L: Mechanics.Rotational
Issue addresses Modelica.Mechanics.Rotational
Modelica.Mechanics.Rotational.Components.Clutch
usesModelica.Math.Vectors.interpolate()
for table interpolation. The used tables are static, i.e., never changed throughout simulation time. But vector-interpolation is meant for dynamic tables – i.e., tables whose content is constructed out of simulated runtime values. I consider this a design bug.Even more, the parameter
mu0
is modeled as a variable. Its equation isThus, the equation itself comments that it is not a real equation, but a constant. It will never change at runtime. It is a static interpolation using a static table.
The logic for deciding the clutch mode is now mingled with table interpolation to define the friction torque
tau
. The rationale for this design seems to be that the desired abscissa value for the interpolation (the sign forw_rel
) depends on the clutch mode; and likewise the ordinate value interpolation result (the sign oftau
) depends on the clutch mode:I propose to change this design to ordinary
Modelica.Tables.Interpolation1Ds
combi-tables, leveraging on the fact that the used interpolation table is static. Doing so will help to generate faster simulation code and clarify the design, making it explicit that static table interpolation is used and due to that only certain values can change.The following is an alternative design based on combi-tables:
This design uses
annotation(Evaluate = true)
to statically evaluatemue0
. It also separates the interpolation sign decisions based on the clutch mode (dynamic) from the interpolation in the static table itself:The
table_signs
vector encodes the different modes of harmonizing the interpolation point (w_rel
) and interpolation result (tau
) with the clutch mode.I tested this redesign and it is functional equivalent, but non-functional more efficient (at least in Dymola). Considering that
Modelica.Math.Vectors.interpolate
is an in Modelica implemented function -- and not C code -- this should be not surprising. Note, that the clutch does not leverage on the last index used for interpolation (iLast
) to gain any faster lookup (regardless if such would help at all in the first place considering combi-tables are using an efficient binary search to speed-up lookup).The text was updated successfully, but these errors were encountered: