ModelicaStandardLibrary icon indicating copy to clipboard operation
ModelicaStandardLibrary copied to clipboard

Set Evaluate = true for IdealTransformer.considerMagnetization

Open henrikt-ma opened this issue 2 years ago • 1 comments

Leaving this parameter unevaluated seems like making things overly complicated, and as far as I can see there is nothing that clearly requires the parameter to be treated structurally. Hence, adding an explicit annotation will increase chances of models being treated equally efficiently across tools.

Of course, I would have preferred to declare considerMagnetization a constant with Dialog annotation instead, but I'm afraid the general preference is to use a parameter with Evaluate = true instead.

henrikt-ma avatar May 23 '22 11:05 henrikt-ma

There's a similar situation in Modelica.Thermal.FluidHeatFlow.BaseClasses.TwoPort that would be interesting to discuss at the same time, namely the parameter m present in this if-equation condition:

  if m>Modelica.Constants.small then
    flowPort_a.H_flow + flowPort_b.H_flow + Q_flow = m*medium.cv*der(T);
  else
    flowPort_a.H_flow + flowPort_b.H_flow + Q_flow = 0;
  end if;

Would you say it's a Modelica tool "frontend" problem to realize that the condition of this tricky equation should be evaluated, or would you expect that index reduction is the stage when one should determine which parametric if-equation conditions to evaluate?

henrikt-ma avatar May 24 '22 08:05 henrikt-ma

Nobody has any thoughts regarding the question about Modelica.Thermal.FluidHeatFlow.BaseClasses.TwoPort above?

henrikt-ma avatar May 02 '23 13:05 henrikt-ma