ModelicaStandardLibrary
ModelicaStandardLibrary copied to clipboard
Initialization of Polyphase.Basic.{Capacitor, Inductor}
This is to test the support of tools for proper initialization menu of arrays, as discussed in #4457 .
See Modelica.Electrical.PolyPhase.Examples.TransformerYY
If this works well, the same style of initialization will be implemented for other polyphase models and machines.
In the example, it looks fine in System Modeler, same as screenshots in #4457 (comment)
However, if I drag out a new
Inductor, I don't get to editieasily in System Modeler. I guess the heuristics of when to show variable start attributes when there are no annotations can be discussed, but should we addshowStartAttributeexplicitly inTwoPlug, to make the intention very clear from the library?SI.Current i[m] "Currents flowing into positive polyphase plugs" annotation(Dialog(showStartAttribute=true));
Good idea in some form, but I don't think that should be in the base-class TwoPlug.
I agree, as we sometimes have initial currents (in coils) and voltages (in capacitors), depending on the component state variables.
I guess another choice is to "lift" i with an alias to the Inductor model and add the showStartAttribute annotation on that alias?
@maltelenz that's what we wanted to avoid: an additional alias variable. But ok I'll change the PR (it seems to make it easier for tools) and let's see whether we get an agreement on that (@christiankral ?).
I would prefer the each, but either works.
As I wrote in the comment, writing each seems to somewhat imply that normally those attributes are the same for all the elements of the array. This is really not the case.