ModelicaStandardLibrary icon indicating copy to clipboard operation
ModelicaStandardLibrary copied to clipboard

Initialization of Polyphase.Basic.{Capacitor, Inductor}

Open AHaumer opened this issue 1 year ago • 4 comments

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.

AHaumer avatar Oct 22 '24 19:10 AHaumer

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 edit i easily 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 add showStartAttribute explicitly in TwoPlug, 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.

HansOlsson avatar Oct 23 '24 07:10 HansOlsson

I agree, as we sometimes have initial currents (in coils) and voltages (in capacitors), depending on the component state variables.

christiankral avatar Oct 23 '24 10:10 christiankral

I guess another choice is to "lift" i with an alias to the Inductor model and add the showStartAttribute annotation on that alias?

maltelenz avatar Oct 23 '24 14:10 maltelenz

@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 ?).

AHaumer avatar Oct 23 '24 17:10 AHaumer

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.

casella avatar Oct 24 '24 14:10 casella