Skip to content

Commit 3484693

Browse files
authored
Merge pull request OpenIPSL#324 from ALSETLab/tutorial
Add advanced Example 4 (which uses GridCal) to tutorials
2 parents cced86b + a558a3f commit 3484693

106 files changed

Lines changed: 2184 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
within OpenIPSL.Examples.Tutorial.Example_4.BaseModels.BaseNetwork;
2+
model SMIBPartial "Partial SMIB Model with PF Record and Load"
3+
OpenIPSL.Electrical.Buses.Bus B01(
4+
v_0=pf.powerflow.bus.v1,
5+
angle_0=pf.powerflow.bus.A1, displayPF=true)
6+
annotation (Placement(transformation(extent={{-70,-10},{-50,10}})));
7+
OpenIPSL.Electrical.Buses.Bus B03(
8+
v_0=pf.powerflow.bus.v3,
9+
angle_0=pf.powerflow.bus.A3, displayPF=true)
10+
annotation (Placement(transformation(extent={{-40,-10},{-20,10}})));
11+
OpenIPSL.Electrical.Buses.Bus B04(
12+
v_0=pf.powerflow.bus.v4,
13+
angle_0=pf.powerflow.bus.A4, displayPF=true)
14+
annotation (Placement(transformation(extent={{10,-30},{30,-10}})));
15+
OpenIPSL.Electrical.Buses.Bus B02(
16+
v_0=pf.powerflow.bus.v2,
17+
angle_0=pf.powerflow.bus.A2, displayPF=true)
18+
annotation (Placement(transformation(extent={{50,-10},{70,10}})));
19+
OpenIPSL.Electrical.Branches.PwLine line_01(
20+
R=0.0010,
21+
X=0.2000,
22+
G=0.0000,
23+
B=0.0000)
24+
annotation (Placement(transformation(extent={{-54,-10},{-34,10}})));
25+
OpenIPSL.Electrical.Branches.PwLine line_02(
26+
R=0.0100,
27+
X=0.2000,
28+
G=0.0000,
29+
B=0.0000) annotation (Placement(transformation(extent={{10,10},{30,30}})));
30+
OpenIPSL.Electrical.Branches.PwLine line_03(
31+
R=0.0005,
32+
X=0.1000,
33+
G=0.0000,
34+
B=0.0000) annotation (Placement(transformation(extent={{-8,-30},{12,-10}})));
35+
OpenIPSL.Electrical.Branches.PwLine line_04(
36+
R=0.0005,
37+
X=0.1000,
38+
G=0.0000,
39+
B=0.0000) annotation (Placement(transformation(extent={{28,-30},{48,-10}})));
40+
inner OpenIPSL.Electrical.SystemBase SysData
41+
annotation (Placement(transformation(extent={{-100,80},{-60,100}})));
42+
GeneratingUnits.InfiniteBus infiniteBus(
43+
P_0=pf.powerflow.machine.PG2,
44+
Q_0=pf.powerflow.machine.QG2,
45+
v_0=pf.powerflow.bus.v2,
46+
angle_0=pf.powerflow.bus.A2, displayPF=true)
47+
annotation (Placement(transformation(extent={{94,-10},{74,10}})));
48+
replaceable
49+
OpenIPSL.Electrical.Loads.PSSE.Load load(
50+
P_0=pf.powerflow.load.PL1,
51+
Q_0=pf.powerflow.load.QL1,
52+
v_0=pf.powerflow.bus.v3,
53+
angle_0=pf.powerflow.bus.A3) constrainedby OpenIPSL.Electrical.Loads.PSSE.BaseClasses.baseLoad
54+
annotation (Placement(transformation(extent={{-34,-56},{-14,-36}})));
55+
OpenIPSL.Electrical.Events.PwFault pwFault(
56+
R=0.01,
57+
X=0.1,
58+
t1=1,
59+
t2=1.1) annotation (Placement(transformation(
60+
extent={{-6,-6},{6,6}},
61+
rotation=270,
62+
origin={36,-46})));
63+
PFData.PowerFlow pf(redeclare record PowerFlow =
64+
OpenIPSL.Examples.Tutorial.Example_4.PFData.PF00000)
65+
annotation (Placement(transformation(extent={{-80,26},{-60,46}})));
66+
equation
67+
connect(line_01.p, B01.p)
68+
annotation (Line(points={{-53,0},{-60,0}}, color={0,0,255}));
69+
connect(line_01.n, B03.p)
70+
annotation (Line(points={{-35,0},{-30,0}}, color={0,0,255}));
71+
connect(line_02.p, B03.p) annotation (Line(points={{11,20},{-16,20},{-16,0},{
72+
-30,0}}, color={0,0,255}));
73+
connect(line_02.n, B02.p)
74+
annotation (Line(points={{29,20},{48,20},{48,0},{60,0}}, color={0,0,255}));
75+
connect(line_03.p, B03.p) annotation (Line(points={{-7,-20},{-16,-20},{-16,0},
76+
{-30,0}}, color={0,0,255}));
77+
connect(line_03.n, B04.p)
78+
annotation (Line(points={{11,-20},{20,-20}},color={0,0,255}));
79+
connect(line_04.p, B04.p)
80+
annotation (Line(points={{29,-20},{20,-20}}, color={0,0,255}));
81+
connect(line_04.n, B02.p) annotation (Line(points={{47,-20},{48,-20},{48,0},{
82+
60,0}}, color={0,0,255}));
83+
connect(infiniteBus.pwPin, B02.p)
84+
annotation (Line(points={{73,0},{60,0}}, color={0,0,255}));
85+
connect(load.p, B03.p)
86+
annotation (Line(points={{-24,-36},{-24,0},{-30,0}}, color={0,0,255}));
87+
connect(pwFault.p, B04.p) annotation (Line(points={{36,-39},{36,-28},{24,
88+
-28},{24,-20},{20,-20}}, color={0,0,255}));
89+
annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
90+
Rectangle(extent={{-100,100},{100,-100}}, lineColor={135,135,135})}),
91+
Diagram(
92+
coordinateSystem(preserveAspectRatio=false), graphics={
93+
Text(
94+
extent={{-92,68},{94,48}},
95+
lineColor={0,0,0},
96+
lineThickness=1,
97+
fontSize=15,
98+
textStyle={TextStyle.Bold},
99+
textString="Single-machine infinite bus model")}));
100+
end SMIBPartial;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
within OpenIPSL.Examples.Tutorial.Example_4.BaseModels;
2+
package BaseNetwork "Base network"
3+
extends Modelica.Icons.Package;
4+
end BaseNetwork;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SMIBPartial
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
within OpenIPSL.Examples.Tutorial.Example_4.BaseModels.GeneratingUnits;
2+
model GeneratorOnly "Machine-only Generator Unit"
3+
extends OpenIPSL.Interfaces.Generator;
4+
OpenIPSL.Electrical.Machines.PSSE.GENROE gENROE(
5+
P_0=P_0,
6+
Q_0=Q_0,
7+
v_0=v_0,
8+
angle_0=angle_0,
9+
M_b=100000000,
10+
Tpd0=5,
11+
Tppd0=0.07,
12+
Tppq0=0.09,
13+
H=4.28,
14+
D=0,
15+
Xd=1.84,
16+
Xq=1.75,
17+
Xpd=0.41,
18+
Xppd=0.2,
19+
Xppq=0.2,
20+
Xl=0.12,
21+
S10=0.11,
22+
S12=0.39,
23+
R_a=0,
24+
Xpq=0.6,
25+
Tpq0=0.9) annotation (Placement(transformation(extent={{-40,-40},{40,40}})));
26+
equation
27+
connect(gENROE.PMECH0, gENROE.PMECH) annotation (Line(points={{44,20},{80,20},{80,70},{-80,70},{-80,24},{-48,24}},
28+
color={0,0,127}));
29+
connect(gENROE.EFD0, gENROE.EFD) annotation (Line(points={{44,-20},{80,-20},{80,-70},{-80,-70},{-80,-24},{-48,-24}},
30+
color={0,0,127}));
31+
connect(gENROE.p, pwPin)
32+
annotation (Line(points={{40,0},{110,0}}, color={0,0,255}));
33+
end GeneratorOnly;
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
within OpenIPSL.Examples.Tutorial.Example_4.BaseModels.GeneratingUnits;
2+
model GeneratorTurbGov "Machine with Turbine and Governor"
3+
extends OpenIPSL.Interfaces.Generator;
4+
OpenIPSL.Electrical.Machines.PSSE.GENROE gENROE(
5+
v_0=v_0,
6+
Tpd0=5,
7+
Tppd0=0.07,
8+
Tppq0=0.09,
9+
H=4.28,
10+
D=0 "Speed Damping",
11+
Xd=1.84,
12+
Xq=1.75,
13+
Xpd=0.41,
14+
Xppd=0.2,
15+
Xppq=0.2,
16+
Xl=0.12,
17+
V_b=100000,
18+
M_b=100000000,
19+
S10=0.11,
20+
S12=0.39,
21+
R_a=0,
22+
angle_0=angle_0,
23+
P_0(displayUnit="MW") = P_0,
24+
Q_0=Q_0,
25+
Xpq=0.6,
26+
Tpq0=0.9) annotation (Placement(transformation(extent={{10,-30},{70,30}})));
27+
OpenIPSL.Electrical.Controls.PSSE.TG.IEEEG1 iEEEG1_1(
28+
P0=0.4,
29+
K=20,
30+
T_1=0.15,
31+
T_2=0,
32+
T_3=0.2,
33+
U_o=0.1,
34+
U_c=-0.1,
35+
P_MAX=0.903,
36+
P_MIN=0,
37+
T_4=0.25,
38+
K_1=0.25,
39+
K_2=0,
40+
T_5=7.5,
41+
K_3=0.25,
42+
K_4=0,
43+
T_6=0.4,
44+
K_5=0.5)
45+
annotation (Placement(transformation(extent={{-72,-10},{-32,30}})));
46+
equation
47+
connect(iEEEG1_1.PMECH_HP, gENROE.PMECH) annotation (Line(points={{-30,18},{4,18}},
48+
color={0,140,72}));
49+
connect(gENROE.p, pwPin) annotation (Line(points={{70,0},{110,0}},
50+
color={0,0,255}));
51+
connect(iEEEG1_1.SPEED_HP, gENROE.SPEED) annotation (Line(points={{-68,10},{-90,10},{-90,50},{88,50},{88,21},{73,21}},
52+
color={0,0,127}));
53+
connect(gENROE.EFD0, gENROE.EFD) annotation (Line(points={{73,-15},{92,-15},{92,-40},{-20,-40},{-20,-18},{4,-18}},
54+
color={0,0,127}));
55+
end GeneratorTurbGov;
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
within OpenIPSL.Examples.Tutorial.Example_4.BaseModels.GeneratingUnits;
2+
model GeneratorTurbGovAVR
3+
"Machine with Turbine, Governor and Excitation System"
4+
extends OpenIPSL.Interfaces.Generator;
5+
OpenIPSL.Electrical.Machines.PSSE.GENROE gENROE(
6+
v_0=v_0,
7+
Tpd0=5,
8+
Tppd0=0.07,
9+
Tppq0=0.09,
10+
H=4.28,
11+
D=0 "Speed Damping",
12+
Xd=1.84,
13+
Xq=1.75,
14+
Xpd=0.41,
15+
Xppd=0.2,
16+
Xppq=0.2,
17+
Xl=0.12,
18+
V_b=100000,
19+
M_b=100000000,
20+
S10=0.11,
21+
S12=0.39,
22+
R_a=0,
23+
angle_0=angle_0,
24+
P_0(displayUnit="MW") = P_0,
25+
Q_0=Q_0,
26+
Xpq=0.6,
27+
Tpq0=0.9) annotation (Placement(transformation(extent={{10,-30},{70,30}})));
28+
OpenIPSL.Electrical.Controls.PSSE.TG.IEEEG1 iEEEG1_1(
29+
P0=0.4,
30+
K=20,
31+
T_1=0.15,
32+
T_2=0,
33+
T_3=0.2,
34+
U_o=0.1,
35+
U_c=-0.1,
36+
P_MAX=0.903,
37+
P_MIN=0,
38+
T_4=0.25,
39+
K_1=0.25,
40+
K_2=0,
41+
T_5=7.5,
42+
K_3=0.25,
43+
K_4=0,
44+
T_6=0.4,
45+
K_5=0.5)
46+
annotation (Placement(transformation(extent={{-80,80},{-40,40}})));
47+
OpenIPSL.Electrical.Controls.PSSE.ES.ESST1A eSST1A1(
48+
V_IMAX=0.3,
49+
V_IMIN=-0.3,
50+
T_C=2,
51+
T_B=10,
52+
T_C1=0.08,
53+
T_B1=0.083,
54+
K_A=300,
55+
V_AMAX=7,
56+
V_AMIN=-7,
57+
V_RMAX=5.2,
58+
V_RMIN=-5.2,
59+
K_C=0.38,
60+
K_F=1,
61+
T_F=1,
62+
K_LR=1,
63+
I_LR=0,
64+
T_A=0.1,
65+
T_R=0.1)
66+
annotation (Placement(transformation(extent={{-26,-70},{-86,-10}})));
67+
Modelica.Blocks.Sources.Constant zero(k=0) annotation (Placement(transformation(extent={{12,-86},{0,-74}})));
68+
Modelica.Blocks.Sources.Constant negInf(k=-Modelica.Constants.inf)
69+
annotation (Placement(transformation(extent={{-96,-96},{-84,-84}})));
70+
Modelica.Blocks.Sources.Constant posInf(k=Modelica.Constants.inf)
71+
annotation (Placement(transformation(extent={{-32,-96},{-44,-84}})));
72+
equation
73+
connect(eSST1A1.EFD, gENROE.EFD) annotation (Line(points={{-89,-40},{-96,-40},{-96,8},{-10,8},{-10,-18},{4,-18}},
74+
color={102,44,145}));
75+
connect(gENROE.SPEED, iEEEG1_1.SPEED_HP) annotation (Line(points={{73,21},{90,21},{90,92},{-92,92},{-92,60},{-76,60}},
76+
color={0,140,72}));
77+
connect(gENROE.EFD0, eSST1A1.EFD0) annotation (Line(points={{73,-15},{86,-15},{86,-52},{-23,-52}},
78+
color={102,44,145}));
79+
connect(zero.y, eSST1A1.VUEL) annotation (Line(points={{-0.6,-80},{-44,-80},{-44,-73}}, color={0,0,0}));
80+
connect(gENROE.XADIFD, eSST1A1.XADIFD) annotation (Line(points={{73,-27},{80,-27},{80,-100},{-80,-100},{-80,-73}},
81+
color={0,0,127}));
82+
connect(negInf.y, eSST1A1.VUEL2) annotation (Line(points={{-83.4,-90},{-65.03,-90},{-65.03,-72.97}},
83+
color={0,0,0}));
84+
connect(posInf.y, eSST1A1.VOEL) annotation (Line(points={{-44.6,-90},{-56,-90},{-56,-73}},
85+
color={0,0,0}));
86+
connect(iEEEG1_1.PMECH_HP, gENROE.PMECH) annotation (Line(points={{-38,52},{-20,52},{-20,18},{4,18}},
87+
color={0,140,72}));
88+
connect(gENROE.p, pwPin) annotation (Line(points={{70,0},{110,0}},
89+
color={0,0,255}));
90+
connect(eSST1A1.VOTHSG, zero.y) annotation (Line(points={{-23,-28},{-14,-28},{-14,-80},{-0.6,-80}}, color={0,0,127}));
91+
connect(eSST1A1.ECOMP, gENROE.ETERM) annotation (Line(points={{-23,-40},{-8,-40},{-8,-64},{90,-64},{90,-9},{73,-9}}, color={0,0,127}));
92+
connect(eSST1A1.VOTHSG2, zero.y) annotation (Line(points={{-23,-16},{-14,-16},{-14,-80},{-0.6,-80}}, color={0,0,127}));
93+
connect(eSST1A1.VUEL3, negInf.y) annotation (Line(points={{-71.555,-72.985},{-71.555,-90},{-83.4,-90}}, color={0,0,127}));
94+
connect(eSST1A1.VT, gENROE.ETERM) annotation (Line(points={{-23.075,-63.475},{-8,-64},{90,-64},{90,-9},{73,-9}}, color={0,0,127}));
95+
end GeneratorTurbGovAVR;

0 commit comments

Comments
 (0)