Skip to content

Commit

Permalink
#3024 Renaming ThetaThfo with AlphaTfo
Browse files Browse the repository at this point in the history
Signed-off-by: Joy El Feghali <joy.elfeghali@rte-france.com>
  • Loading branch information
joyelfeghali committed Jun 17, 2024
1 parent 6484514 commit 741f13b
Show file tree
Hide file tree
Showing 10 changed files with 246 additions and 246 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ partial model BaseTransformer "Base model for a general two winding transformer

/* Equivalent circuit and conventions:
I1 r,theta I2
I1 r,alpha I2
U1,P1,Q1 -->---oo----R+jX-------<-- U2,P2,Q2
(terminal1) | (terminal2)
G+jB
Expand All @@ -33,11 +33,11 @@ partial model BaseTransformer "Base model for a general two winding transformer
Dynawo.Connectors.ACPower terminal2 "Connector used to connect the transformer to the grid (terminal 2)" annotation(
Placement(visible = true, transformation(origin = {100, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {100, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

Dynawo.Types.ComplexPerUnit rTfoPu(re(start = RatioTfo0Pu * Modelica.Math.cos(ThetaTfo0)), im(start = RatioTfo0Pu * Modelica.Math.sin(ThetaTfo0))) "Transformation complex ratio in complex pu";
Dynawo.Types.ComplexPerUnit rTfoPu(re(start = RatioTfo0Pu * Modelica.Math.cos(AlphaTfo0)), im(start = RatioTfo0Pu * Modelica.Math.sin(AlphaTfo0))) "Transformation complex ratio in complex pu";

// initial parameters
parameter Types.PerUnit RatioTfo0Pu "Start value of transformation ratio in pu: U2/U1 in no load conditions";
parameter Types.Angle ThetaTfo0 "Start value of transformation phase shift in rad";
parameter Types.Angle AlphaTfo0 "Start value of transformation phase shift in rad";

equation
if (running.value) then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ model TransformerFixedRatioAndPhase "Two winding transformer with fixed transfor

/* Equivalent circuit and conventions:
I1 r,theta I2
I1 r,alpha I2
U1,P1,Q1 -->---oo----R+jX-------<-- U2,P2,Q2
(terminal1) | (terminal2)
G+jB
Expand All @@ -32,19 +32,19 @@ model TransformerFixedRatioAndPhase "Two winding transformer with fixed transfor
parameter Types.PerUnit RatioTfoPu "Transformation ratio in pu: U2/U1 in no load conditions";

// transformation phase shift
parameter Types.Angle ThetaTfo "Transformation phase shift in rad";
parameter Types.Angle AlphaTfo "Transformation phase shift in rad";

// initial parameters
redeclare parameter Types.PerUnit RatioTfo0Pu = RatioTfoPu "Start value of transformation ratio in pu: U2/U1 in no load conditions";
redeclare parameter Types.Angle ThetaTfo0 = ThetaTfo "Start value of transformation phase shift in rad";
redeclare parameter Types.Angle AlphaTfo0 = AlphaTfo "Start value of transformation phase shift in rad";

equation
rTfoPu = ComplexMath.fromPolar(RatioTfoPu, ThetaTfo);
rTfoPu = ComplexMath.fromPolar(RatioTfoPu, AlphaTfo);

annotation(preferredView = "text",
Documentation(info = "<html><head></head><body>The transformer has the following equivalent circuit and conventions:<div><br></div><div>
<p style=\"margin: 0px;\"><br></p>
<pre style=\"margin-top: 0px; margin-bottom: 0px;\"><span style=\"font-family: 'Courier New'; font-size: 12pt;\"> I1 r,theta I2</span></pre>
<pre style=\"margin-top: 0px; margin-bottom: 0px;\"><span style=\"font-family: 'Courier New'; font-size: 12pt;\"> I1 r,alpha I2</span></pre>
<pre style=\"margin-top: 0px; margin-bottom: 0px;\"><span style=\"font-family: 'Courier New'; font-size: 12pt;\"> U1,P1,Q1 --&gt;---oo----R+jX-------&lt;-- U2,P2,Q2</span></pre>
<pre style=\"margin-top: 0px; margin-bottom: 0px;\"><span style=\"font-family: 'Courier New'; font-size: 12pt;\"> (terminal1) | (terminal2)</span></pre>
<pre style=\"margin-top: 0px; margin-bottom: 0px;\"><span style=\"font-family: 'Courier New'; font-size: 12pt;\"> G+jB</span></pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ model TransformerPhaseTapChanger "Two winding transformer with a fixed ratio and

/* Equivalent circuit and conventions:
I1 r,theta I2
I1 r,alpha I2
U1,P1,Q1 -->---oo----R+jX-------<-- U2,P2,Q2
(terminal1) | (terminal2)
G+jB
Expand All @@ -30,14 +30,14 @@ model TransformerPhaseTapChanger "Two winding transformer with a fixed ratio and

// phase variation discrete scale
parameter Integer NbTap "Number of taps";
parameter Types.Angle ThetaTfoMin "Minimum phase shift in rad";
parameter Types.Angle ThetaTfoMax "Maximum phase shift in rad";
parameter Types.Angle AlphaTfoMin "Minimum phase shift in rad";
parameter Types.Angle AlphaTfoMax "Maximum phase shift in rad";

// transformation ratio
parameter Types.PerUnit RatioTfoPu "Transformation ratio in pu: U2/U1 in no load conditions";

// transformation phase shift
Types.Angle thetaTfo(start = ThetaTfo0) "Transformation phase shift in rad";
Types.Angle alphaTfo(start = AlphaTfo0) "Transformation phase shift in rad";

// Input connector
Dynawo.Connectors.ZPin tap(value(start = Tap0)) "Current transformer tap (between 0 and NbTap - 1)";
Expand All @@ -51,19 +51,19 @@ model TransformerPhaseTapChanger "Two winding transformer with a fixed ratio and
// initial parameters
parameter Integer Tap0 "Start value of transformer tap";
redeclare parameter Types.PerUnit RatioTfo0Pu = RatioTfoPu "Start value of transformation ratio in pu: U2/U1 in no load conditions";
redeclare parameter Types.Angle ThetaTfo0 = ThetaTfoMin + (ThetaTfoMax - ThetaTfoMin) * (Tap0 / (NbTap - 1)) "Start value of transformation phase shift in rad";
redeclare parameter Types.Angle AlphaTfo0 = AlphaTfoMin + (AlphaTfoMax - AlphaTfoMin) * (Tap0 / (NbTap - 1)) "Start value of transformation phase shift in rad";

equation
when (tap.value <> pre(tap.value)) then
// Transformation phase shift calculation
if (NbTap == 1) then
thetaTfo = ThetaTfoMin;
alphaTfo = AlphaTfoMin;
else
thetaTfo = ThetaTfoMin + (ThetaTfoMax - ThetaTfoMin) * (tap.value / (NbTap - 1));
alphaTfo = AlphaTfoMin + (AlphaTfoMax - AlphaTfoMin) * (tap.value / (NbTap - 1));
end if;
end when;

rTfoPu = ComplexMath.fromPolar(RatioTfoPu, thetaTfo);
rTfoPu = ComplexMath.fromPolar(RatioTfoPu, alphaTfo);

// Variables for display or connection to another model (tap-changer for example)
P1Pu.value = ComplexMath.real(terminal1.V * ComplexMath.conj(terminal1.i));
Expand All @@ -74,7 +74,7 @@ equation
annotation(preferredView = "text",
Documentation(info = "<html><head></head><body>The transformer has the following equivalent circuit and conventions:<div><br></div><div>
<p style=\"margin: 0px;\"><br></p>
<pre style=\"margin-top: 0px; margin-bottom: 0px;\"><span style=\"font-family: 'Courier New'; font-size: 12pt;\"> I1 r,theta I2</span></pre>
<pre style=\"margin-top: 0px; margin-bottom: 0px;\"><span style=\"font-family: 'Courier New'; font-size: 12pt;\"> I1 r,alpha I2</span></pre>
<pre style=\"margin-top: 0px; margin-bottom: 0px;\"><span style=\"font-family: 'Courier New'; font-size: 12pt;\"> U1,P1,Q1 --&gt;---oo----R+jX-------&lt;-- U2,P2,Q2</span></pre>
<pre style=\"margin-top: 0px; margin-bottom: 0px;\"><span style=\"font-family: 'Courier New'; font-size: 12pt;\"> (terminal1) | (terminal2)</span></pre>
<pre style=\"margin-top: 0px; margin-bottom: 0px;\"><span style=\"font-family: 'Courier New'; font-size: 12pt;\"> G+jB</span></pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ model TransformerRatioTapChanger "Two winding transformer with a fixed phase and

/* Equivalent circuit and conventions:
I1 r,theta I2
I1 r,alpha I2
U1,P1,Q1 -->---oo----R+jX-------<-- U2,P2,Q2
(terminal1) | (terminal2)
G+jB
Expand All @@ -34,7 +34,7 @@ model TransformerRatioTapChanger "Two winding transformer with a fixed phase and
parameter Types.PerUnit RatioTfoMaxPu "Maximum transformation ratio in pu: U2/U1 in no load conditions";

// transformation phase shift
parameter Types.Angle ThetaTfo "Transformation phase shift in rad";
parameter Types.Angle AlphaTfo "Transformation phase shift in rad";

// transformation ratio
Types.PerUnit ratioTfoPu(start = RatioTfo0Pu) "Transformation ratio in pu: U2/U1 in no load conditions";
Expand All @@ -51,7 +51,7 @@ model TransformerRatioTapChanger "Two winding transformer with a fixed phase and
// Initial parameters
parameter Integer Tap0 "Start value of transformer tap";
redeclare parameter Types.PerUnit RatioTfo0Pu = RatioTfoMinPu + (RatioTfoMaxPu - RatioTfoMinPu) * (Tap0 / (NbTap - 1)) "Start value of transformation ratio in pu: U2/U1 in no load conditions";
redeclare parameter Types.Angle ThetaTfo0 = ThetaTfo "Start value of transformation phase shift in rad";
redeclare parameter Types.Angle AlphaTfo0 = AlphaTfo "Start value of transformation phase shift in rad";

equation
when (tap.value <> pre(tap.value)) then
Expand All @@ -63,7 +63,7 @@ equation
end if;
end when;

rTfoPu = ComplexMath.fromPolar(ratioTfoPu, ThetaTfo);
rTfoPu = ComplexMath.fromPolar(ratioTfoPu, AlphaTfo);

// Variables for display or connection to another model (tap-changer for example)
P1Pu.value = ComplexMath.real(terminal1.V * ComplexMath.conj(terminal1.i));
Expand All @@ -74,7 +74,7 @@ equation
annotation(preferredView = "text",
Documentation(info = "<html><head></head><body>The transformer has the following equivalent circuit and conventions:<div><br></div><div>
<p style=\"margin: 0px;\"><br></p>
<pre style=\"margin-top: 0px; margin-bottom: 0px;\"><span style=\"font-family: 'Courier New'; font-size: 12pt;\"> I1 r,theta I2</span></pre>
<pre style=\"margin-top: 0px; margin-bottom: 0px;\"><span style=\"font-family: 'Courier New'; font-size: 12pt;\"> I1 r,alpha I2</span></pre>
<pre style=\"margin-top: 0px; margin-bottom: 0px;\"><span style=\"font-family: 'Courier New'; font-size: 12pt;\"> U1,P1,Q1 --&gt;---oo----R+jX-------&lt;-- U2,P2,Q2</span></pre>
<pre style=\"margin-top: 0px; margin-bottom: 0px;\"><span style=\"font-family: 'Courier New'; font-size: 12pt;\"> (terminal1) | (terminal2)</span></pre>
<pre style=\"margin-top: 0px; margin-bottom: 0px;\"><span style=\"font-family: 'Courier New'; font-size: 12pt;\"> G+jB</span></pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ model PhaseShifterTransformer "Elementary system with one infinite bus, one load
Placement(transformation(origin = {20, 0}, extent = {{-12, -12}, {12, 12}})));

// Phase Tap Changer Transformer
Dynawo.Electrical.Transformers.TransformerPhaseTapChanger tfo01(BPu = 0.0*ZBASE69_0, GPu = 0.0*ZBASE69_0, RPu = 0.0/ZBASE69_0, XPu = 0./ZBASE69_0, RatioTfoPu = 1.0, NbTap = 19, Tap0 = 9, ThetaTfoMin = -0.19634954084936207, ThetaTfoMax = 0.19634954084936207) annotation(
Dynawo.Electrical.Transformers.TransformerPhaseTapChanger tfo01(BPu = 0.0*ZBASE69_0, GPu = 0.0*ZBASE69_0, RPu = 0.0/ZBASE69_0, XPu = 0./ZBASE69_0, RatioTfoPu = 1.0, NbTap = 19, Tap0 = 9, AlphaTfoMin = -0.19634954084936207, AlphaTfoMax = 0.19634954084936207) annotation(
Placement(transformation(origin = {20, 20}, extent = {{-12, -12}, {12, 12}}, rotation = -90)));

// Lines
Expand Down
Loading

0 comments on commit 741f13b

Please sign in to comment.