ModelicaStandardLibrary
ModelicaStandardLibrary copied to clipboard
Multiplicative parameters
Parameters with a multiplicative role should have the annotation absolutevalue = false
. Initiating this PR with application to Modelica.Blocks.Math.Gain
just to show the idea.
With the annotation present on the parameter in the block, it gets easy to define a block that multiplies by a temperature difference of 10°C:
model New
Gain gain(k(unit = "degC") = 10); // New Gain block with absoluteValue = false for 'k'.
end New;
Without this annotation inside the Gain
block, New
has a unit error in its multiplication, and it becomes cumbersome at best to work around the problem (I'm afraid that the level of tool support may vary):
model Old
parameter Real gain_k(unit = "degC") = 10 annotation(absoluteValue = false);
Gain gain(k = gain_k); // Old Gain block without absoluteValue = false for 'k'.
end Old;
Initiating PR in draft state to indicate that I don't think this should be done only for Gain
, although hoping that we'd fix all occurrences with this PR would likely be too optimistic.