Skip to content

Commit

Permalink
usage of annotation(Dialog(showStartAttribute=true))
Browse files Browse the repository at this point in the history
  • Loading branch information
AHaumer committed Oct 23, 2024
1 parent 37c1a8e commit d684e1c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Modelica/Electrical/Polyphase/Basic/Capacitor.mo
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
within Modelica.Electrical.Polyphase.Basic;
model Capacitor "Ideal linear electrical capacitors"
extends Interfaces.TwoPlug(v(start=zeros(m), fixed=fill(false,m)));
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
Expand Down
4 changes: 3 additions & 1 deletion Modelica/Electrical/Polyphase/Basic/Inductor.mo
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
within Modelica.Electrical.Polyphase.Basic;
model Inductor "Ideal linear electrical inductors"
extends Interfaces.TwoPlug(i(start=zeros(m), fixed=fill(false,m)));
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
Expand Down
4 changes: 2 additions & 2 deletions Modelica/Electrical/Polyphase/Examples/TransformerYY.mo
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ model TransformerYY "Test example with polyphase components"
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),
i(start=zeros(m), fixed=cat(1,fill(true,m-1),{false}))) annotation (Placement(
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}})));
Expand Down Expand Up @@ -94,7 +94,7 @@ If this is not the case, you have to write the code manually:
</p>
<p><code>
Modelica.Electrical.PolyPhase.Basic.Inductor transformerL(m=m, L=fill(LT, m),
<strong>i(start=zeros(m), fixed=cat(1,fill(true,m-1),{false}))</strong>);</code>
<strong>iL(start=zeros(m), fixed=cat(1,fill(true,m-1),{false}))</strong>);</code>
</p>
</html>"),
experiment(StopTime=1.0, Interval=0.001),
Expand Down

0 comments on commit d684e1c

Please sign in to comment.