diff --git a/Modelica/Electrical/Polyphase/Basic/Capacitor.mo b/Modelica/Electrical/Polyphase/Basic/Capacitor.mo index 994251685d..65d6b2e689 100644 --- a/Modelica/Electrical/Polyphase/Basic/Capacitor.mo +++ b/Modelica/Electrical/Polyphase/Basic/Capacitor.mo @@ -3,6 +3,8 @@ model Capacitor "Ideal linear electrical capacitors" extends Interfaces.TwoPlug; parameter SI.Capacitance C[m](start=fill(1, m)) "Capacitance"; + SI.Voltage vC[m](start=zeros(m), fixed=fill(false,m))=v "Capacitor voltages" + annotation(Dialog(showStartAttribute=true)); Modelica.Electrical.Analog.Basic.Capacitor capacitor[m](final C=C) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); equation diff --git a/Modelica/Electrical/Polyphase/Basic/Inductor.mo b/Modelica/Electrical/Polyphase/Basic/Inductor.mo index 0a0f11447b..278055ff9d 100644 --- a/Modelica/Electrical/Polyphase/Basic/Inductor.mo +++ b/Modelica/Electrical/Polyphase/Basic/Inductor.mo @@ -2,6 +2,8 @@ within Modelica.Electrical.Polyphase.Basic; model Inductor "Ideal linear electrical inductors" extends Interfaces.TwoPlug; parameter SI.Inductance L[m](start=fill(1, m)) "Inductance"; + SI.Current iL[m](start=zeros(m), fixed=fill(false,m))=i "Inductor currents" + annotation(Dialog(showStartAttribute=true)); Modelica.Electrical.Analog.Basic.Inductor inductor[m](final L=L) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); equation diff --git a/Modelica/Electrical/Polyphase/Examples/TransformerYY.mo b/Modelica/Electrical/Polyphase/Examples/TransformerYY.mo index 62c549bb72..9e3649db86 100644 --- a/Modelica/Electrical/Polyphase/Examples/TransformerYY.mo +++ b/Modelica/Electrical/Polyphase/Examples/TransformerYY.mo @@ -40,7 +40,8 @@ model TransformerYY "Test example with polyphase components" transformation(extent={{-30,-100},{-10,-80}}))); Basic.Resistor transformerR(m=m, R=fill(RT, m)) annotation (Placement( transformation(extent={{0,10},{20,30}}))); - Basic.Inductor transformerL(m=m, L=fill(LT, m)) annotation (Placement( + Basic.Inductor transformerL(m=m, L=fill(LT, m), + iL(start=zeros(m), fixed=cat(1,fill(true,m-1),{false}))) annotation (Placement( transformation(extent={{30,10},{50,30}}))); Basic.Resistor loadR(m=m, R=fill(RL, m)) annotation (Placement( transformation(extent={{70,10},{90,30}}))); @@ -50,9 +51,6 @@ model TransformerYY "Test example with polyphase components" rotation=270))); Modelica.Electrical.Analog.Basic.Ground groundT1 annotation (Placement( transformation(extent={{-50,-100},{-30,-80}}))); -initial equation - transformerL.i[1:m - 1] = zeros(m - 1) "Y-connection"; - equation connect(starS.pin_n, groundS.p) annotation (Line(points={{-90,-72},{-90,-80}}, color={0,0,255})); @@ -77,12 +75,32 @@ equation connect(loadR.plug_n, starL.plug_p) annotation (Line(points={{90,20},{90,-52}}, color={0,0,255})); annotation (Documentation(info=" +
Test example with polyphase components:
+Star-connected voltage source feeds via a Y-Y-transformer with internal impedance (RT, LT) a load resistor RT.
+Using f=5 Hz LT=3mH defines nominal voltage drop of approximately 10 %.
+Simulate for 1 second (2 periods) and compare voltages and currents of source, transformer and load.
+
-Test example with polyphase components:
-Star-connected voltage source feeds via a Y-Y-transformer with internal impedance (RT, LT) a load resistor RT.
-Using f=5 Hz LT=3mH defines nominal voltage drop of approximately 10 %.
-Simulate for 1 second (2 periods) and compare voltages and currents of source, transformer and load.
+From the m
currents m-1
have to be initialized with fixed = true, one of the m
currents with fixed = false,
+due to the fact that the star connection enforces sum of the currents = 0.
+
+Tools are expected to present a proper initialization section of the menu of transformerL
which allows
+to set the start values of the m
currents and the fixed attributes individually, i.e. as an array.
+Especially, a checkbox for the fixed attributes should be avoided.
+
+If this is not the case, you have to write the code manually: +
+
+ Modelica.Electrical.PolyPhase.Basic.Inductor transformerL(m=m, L=fill(LT, m),
+ iL(start=zeros(m), fixed=cat(1,fill(true,m-1),{false})));