1 | package Test2
|
---|
2 | model PowerFlow "Power flow for the basic grid used in the tutorial"
|
---|
3 | extends Modelica.Icons.Example;
|
---|
4 | PowerGrids.Electrical.PowerFlow.PVBus GEN(P(displayUnit = "W") = 0, PStart(displayUnit = "W") = 0, SNom(displayUnit = "V.A") = 5e+8, U(displayUnit = "V") = 21000, UNom(displayUnit = "V") = 21000, generatorConvention = false, portVariablesPhases = true, portVariablesPu = true) annotation(
|
---|
5 | Placement(visible = true, transformation(origin = {-50, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 90)));
|
---|
6 | PowerGrids.Electrical.Buses.Bus NTLV(SNom = 5e+8, UNom = 21000, portVariablesPhases = true, portVariablesPu = true) annotation(
|
---|
7 | Placement(visible = true, transformation(origin = {-30, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 90)));
|
---|
8 | PowerGrids.Electrical.Branches.TransformerFixedRatio TGEN(R = 0.12e-2 * 380 ^ 2 / 500, SNom(displayUnit = "W") = 5e+8, UNomA(displayUnit = "V") = 21000, UNomB(displayUnit = "V") = 380000, X = 12e-2 * 380 ^ 2 / 500, portVariablesPhases = true, portVariablesPu = true, rFixed = 380 / 21) annotation(
|
---|
9 | Placement(visible = true, transformation(origin = {0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
|
---|
10 | PowerGrids.Electrical.Buses.Bus NTHV(SNom = 5e+8, UNom = 380000, portVariablesPhases = true, portVariablesPu = true) annotation(
|
---|
11 | Placement(visible = true, transformation(origin = {30, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 90)));
|
---|
12 | inner PowerGrids.Electrical.System systemPowerGrids annotation(
|
---|
13 | Placement(visible = true, transformation(origin = {-30, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
|
---|
14 | PowerGrids.Electrical.PowerFlow.PQBus GRIDL(P(displayUnit = "W") = 0, Q = 0, SNom(displayUnit = "V.A") = 5e+8, UNom(displayUnit = "V") = 380000, portVariablesPhases = true, portVariablesPu = true) annotation(
|
---|
15 | Placement(visible = true, transformation(origin = {60, -20}, extent = {{-10, -10}, {10, 10}}, rotation = 90)));
|
---|
16 | PowerGrids.Electrical.PowerFlow.SlackBus GRID(SNom(displayUnit = "V.A") = 5e+8, U(displayUnit = "V") = 380000, UNom(displayUnit = "V") = 380000, portVariablesPhases = true, portVariablesPu = true) annotation(
|
---|
17 | Placement(visible = true, transformation(origin = {60, 20}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
|
---|
18 | equation
|
---|
19 | connect(GEN.terminal, NTLV.terminal) annotation(
|
---|
20 | Line(points = {{-50, 0}, {-30, 0}, {-30, 0}, {-30, 0}}));
|
---|
21 | connect(NTLV.terminal, TGEN.terminalA) annotation(
|
---|
22 | Line(points = {{-30, 0}, {-10, 0}, {-10, 0}, {-10, 0}}));
|
---|
23 | connect(TGEN.terminalB, NTHV.terminal) annotation(
|
---|
24 | Line(points = {{10, 0}, {30, 0}, {30, 0}, {30, 0}}));
|
---|
25 | connect(NTHV.terminal, GRID.terminal) annotation(
|
---|
26 | Line(points = {{30, 0}, {32, 0}, {32, 20}, {60, 20}, {60, 20}}));
|
---|
27 | connect(GRIDL.terminal, NTHV.terminal) annotation(
|
---|
28 | Line(points = {{60, -20}, {32, -20}, {32, 0}, {30, 0}}));
|
---|
29 | annotation(
|
---|
30 | Icon(coordinateSystem(grid = {2, 2}, extent = {{-100, -100}, {100, 100}})),
|
---|
31 | Diagram(coordinateSystem(extent = {{-60, -40}, {80, 40}}, grid = {2, 2})),
|
---|
32 | experiment(StartTime = 0, StopTime = 1, Tolerance = 1e-6, Interval = 0.002),
|
---|
33 | __OpenModelica_commandLineOptions = "--daeMode --tearingMethod=minimalTearing",
|
---|
34 | __OpenModelica_simulationFlags(nls = "kinsol", lv = "LOG_INIT_HOMOTOPY", homotopyOnFirstTry = "()"));
|
---|
35 | end PowerFlow;
|
---|
36 |
|
---|
37 | model ScTT
|
---|
38 | extends Modelica.Icons.Example;
|
---|
39 | import PI = Modelica.Constants.pi;
|
---|
40 | inner PowerGrids.Electrical.System systemPowerGrids(fNom = 50) annotation(
|
---|
41 | Placement(visible = true, transformation(origin = {70, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
|
---|
42 | PowerGrids.Electrical.Buses.BusFault bus(R = 0.05, SNom(displayUnit = "V.A") = 500000000, UNom(displayUnit = "V") = 21000, UStart = 1.050 * 380e3, X = 0, portVariablesPhases = true, portVariablesPu = true, startTime = 0.1, stopTime = 990.2) annotation(
|
---|
43 | Placement(visible = true, transformation(origin = {14, -24}, extent = {{-10, -10}, {10, 10}}, rotation = 90)));
|
---|
44 | Modelica.Blocks.Sources.RealExpression ufPu(y = 1) annotation(
|
---|
45 | Placement(visible = true, transformation(extent = {{-52, 16}, {-32, 36}}, rotation = 0)));
|
---|
46 | Modelica.Blocks.Sources.RealExpression pmPu annotation(
|
---|
47 | Placement(visible = true, transformation(extent = {{-52, 36}, {-32, 56}}, rotation = 0)));
|
---|
48 | PowerGrids.Electrical.Machines.SynchronousMachine4Windings GEN(H = 1000, PStart(displayUnit = "W") = 0, QStart = 0, SNom(displayUnit = "V.A") = 5e+08, Tpd0 = 5.143, Tppd0 = 0.042, Tppq0 = 0.083, Tpq0 = 2.16, UNom(displayUnit = "V") = 21000, UPhaseStart = 0, UStart(displayUnit = "V") = 21e3, neglectTransformerTerms = false, portVariablesPhases = true, raPu = 0, xdPu = 2, xlPu = 0.15, xpdPu = 0.35, xppdPu = 0.25, xppqPu = 0.3, xpqPu = 0.5, xqPu = 1.8) annotation(
|
---|
49 | Placement(visible = true, transformation(origin = {2, 38}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
|
---|
50 | PowerGrids.Electrical.Buses.EquivalentGrid GRID(UPhaseStart = 0, PStart = 0, QStart = 0, R_X = 1 / 10, SNom(displayUnit = "V.A") = 500000000, SSC(displayUnit = "V.A") = 2500000000, UNom(displayUnit = "V") = 380e3, URef(displayUnit = "V") = 380e3, c = 1.1, portVariablesPhases = true, portVariablesPu = true) annotation(
|
---|
51 | Placement(visible = true, transformation(origin = {86, -24}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
|
---|
52 | PowerGrids.Electrical.Loads.LoadImpedancePQ GRIDL(PRef = 4.75e+08, QRef = 7.6e+07, SNom = 5e+08, UNom = 380000, URef = 1.05 * 380e3, portVariablesPhases = true, portVariablesPu = true) annotation(
|
---|
53 | Placement(visible = true, transformation(origin = {64, -38}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
|
---|
54 | PowerGrids.Electrical.Buses.Bus bus1(SNom(displayUnit = "V.A") = 500000000, UNom(displayUnit = "V") = 380000, portVariablesPhases = true, portVariablesPu = true) annotation(
|
---|
55 | Placement(visible = true, transformation(origin = {58, -24}, extent = {{-10, -10}, {10, 10}}, rotation = 90)));
|
---|
56 | PowerGrids.Electrical.Branches.TransformerFixedRatio TGEN(R = 0.12e-2 * 380 ^ 2 / 500, SNom(displayUnit = "W") = 5e+8, UNomA(displayUnit = "V") = 21000, UNomB(displayUnit = "V") = 380000, X = 12e-2 * 380 ^ 2 / 500, portVariablesPhases = true, portVariablesPu = true, rFixed = 380 / 21) annotation(
|
---|
57 | Placement(visible = true, transformation(origin = {36, -24}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
|
---|
58 | equation
|
---|
59 | connect(pmPu.y, GEN.PmPu) annotation(
|
---|
60 | Line(points = {{-31, 46}, {-22, 46}, {-22, 42}, {-8, 42}}, color = {0, 0, 127}));
|
---|
61 | connect(GEN.ufPuIn, ufPu.y) annotation(
|
---|
62 | Line(points = {{-8.2, 34}, {-22.2, 34}, {-22.2, 26}, {-31, 26}}, color = {0, 0, 127}));
|
---|
63 | connect(bus1.terminal, GRID.terminal) annotation(
|
---|
64 | Line(points = {{58, -24}, {86, -24}}));
|
---|
65 | connect(GRIDL.terminal, GRID.terminal) annotation(
|
---|
66 | Line(points = {{64, -38}, {64, -24}, {86, -24}}));
|
---|
67 | connect(GEN.terminal, bus.terminal) annotation(
|
---|
68 | Line(points = {{2, 38}, {2, -24}, {14, -24}}));
|
---|
69 | connect(TGEN.terminalA, bus.terminal) annotation(
|
---|
70 | Line(points = {{26, -24}, {14, -24}}));
|
---|
71 | connect(TGEN.terminalB, bus1.terminal) annotation(
|
---|
72 | Line(points = {{46, -24}, {58, -24}}));
|
---|
73 | annotation(
|
---|
74 | experiment(StopTime = 0.1, Interval = 0.0005, Tolerance = 1e-06, StartTime = 0),
|
---|
75 | Documentation(info = "<html><head></head><body><p style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px;\">Modello derivato da PowerGrids.Electrical.Machines.Test.SynchronousMachine4WindingsNoLoad per valutare l'andamento nel tempo di correnti di corto circuito trifase franco a partire da macchina a vuoto.</p><p style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px;\">Questo modello non converge se si sceglie di inserire anche i TransformerTerms nel modello della macchina.</p><p style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px;\">Per valutare il comportamento della macchina con i TransformerTerms si può usare il modello contenente \"TT\" nel nome del mesedesimo package do qiesto modello.</p><p style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px;\">Per ottenere una velocità socostante qui si è scelta una enorme costante d'inerzia H=1000s.</p><p style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px;\"><br></p>
|
---|
76 | </body></html>"),
|
---|
77 | Diagram(coordinateSystem(extent = {{-100, -60}, {100, 60}})));
|
---|
78 | end ScTT;
|
---|
79 |
|
---|
80 | model ScTT1
|
---|
81 | extends Modelica.Icons.Example;
|
---|
82 | import PI = Modelica.Constants.pi;
|
---|
83 | inner PowerGrids.Electrical.System systemPowerGrids(fNom = 50) annotation(
|
---|
84 | Placement(visible = true, transformation(origin = {70, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
|
---|
85 | PowerGrids.Electrical.Buses.BusFault bus(R = 0.05, SNom(displayUnit = "V.A") = 500000000, UNom(displayUnit = "V") = 21000, UStart = 1.050 * 380e3, X = 0, portVariablesPhases = true, portVariablesPu = true, startTime = 0.1, stopTime = 990.2) annotation(
|
---|
86 | Placement(visible = true, transformation(origin = {14, -24}, extent = {{-10, -10}, {10, 10}}, rotation = 90)));
|
---|
87 | Modelica.Blocks.Sources.RealExpression ufPu(y = 1) annotation(
|
---|
88 | Placement(visible = true, transformation(extent = {{-54, 16}, {-34, 36}}, rotation = 0)));
|
---|
89 | Modelica.Blocks.Sources.RealExpression pmPu annotation(
|
---|
90 | Placement(visible = true, transformation(extent = {{-54, 36}, {-34, 56}}, rotation = 0)));
|
---|
91 | PowerGrids.Electrical.Machines.SynchronousMachine4Windings GEN(H = 1000, PStart(displayUnit = "W") = 0, QStart = 0, SNom(displayUnit = "V.A") = 5e+08, Tpd0 = 5.143, Tppd0 = 0.042, Tppq0 = 0.083, Tpq0 = 2.16, UNom(displayUnit = "V") = 21000, UPhaseStart = 0, UStart(displayUnit = "V") = 21e3, neglectTransformerTerms = false, portVariablesPhases = true, raPu = 0, xdPu = 2, xlPu = 0.15, xpdPu = 0.35, xppdPu = 0.25, xppqPu = 0.3, xpqPu = 0.5, xqPu = 1.8) annotation(
|
---|
92 | Placement(visible = true, transformation(origin = {0, 38}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
|
---|
93 | PowerGrids.Electrical.Buses.EquivalentGrid GRID(UPhaseStart = 0, PStart = 0, QStart = 0, R_X = 1 / 10, SNom(displayUnit = "MVA") = 500000000, SSC(displayUnit = "MVA") = 2500000000, UNom(displayUnit = "V") = 380e3, URef(displayUnit = "V") = 380e3, c = 1.1, portVariablesPhases = true, portVariablesPu = true) annotation(
|
---|
94 | Placement(visible = true, transformation(origin = {86, -24}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
|
---|
95 | PowerGrids.Electrical.Loads.LoadImpedancePQ GRIDL(PRef = 0, QRef = 0, SNom = 500000000, UNom = 380000, URef = 380000000, portVariablesPhases = true, portVariablesPu = true) annotation(
|
---|
96 | Placement(visible = true, transformation(origin = {66, -40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
|
---|
97 | PowerGrids.Electrical.Buses.Bus bus1(SNom(displayUnit = "V.A") = 500000000, UNom(displayUnit = "V") = 380000, portVariablesPhases = true, portVariablesPu = true) annotation(
|
---|
98 | Placement(visible = true, transformation(origin = {58, -24}, extent = {{-10, -10}, {10, 10}}, rotation = 90)));
|
---|
99 | Support.GetCurrent iMach annotation(
|
---|
100 | Placement(visible = true, transformation(origin = {0, -2}, extent = {{-10, 10}, {10, -10}}, rotation = -90)));
|
---|
101 | Support.FromPark fromPark(p = 1) annotation(
|
---|
102 | Placement(visible = true, transformation(extent = {{-30, -14}, {-50, 6}}, rotation = 0)));
|
---|
103 | Modelica.Blocks.Sources.RealExpression theta(y = 2 * PI * 50 * time) annotation(
|
---|
104 | Placement(visible = true, transformation(origin = {-72, -28}, extent = {{-16, -10}, {16, 10}}, rotation = 0)));
|
---|
105 | PowerGrids.Electrical.Branches.TransformerFixedRatio TGEN(R = 0.12e-2 * 380 ^ 2 / 500, SNom(displayUnit = "W") = 5e+8, UNomA(displayUnit = "V") = 21000, UNomB(displayUnit = "V") = 380000, X = 12e-2 * 380 ^ 2 / 500, portVariablesPhases = true, portVariablesPu = true, rFixed = 380 / 21) annotation(
|
---|
106 | Placement(visible = true, transformation(origin = {36, -24}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
|
---|
107 | equation
|
---|
108 | connect(pmPu.y, GEN.PmPu) annotation(
|
---|
109 | Line(points = {{-33, 46}, {-24, 46}, {-24, 42}, {-10, 42}}, color = {0, 0, 127}));
|
---|
110 | connect(GEN.ufPuIn, ufPu.y) annotation(
|
---|
111 | Line(points = {{-10.2, 34}, {-24.2, 34}, {-24.2, 26}, {-33, 26}}, color = {0, 0, 127}));
|
---|
112 | connect(bus1.terminal, GRID.terminal) annotation(
|
---|
113 | Line(points = {{58, -24}, {86, -24}}));
|
---|
114 | connect(GRIDL.terminal, GRID.terminal) annotation(
|
---|
115 | Line(points = {{66, -40}, {66, -24}, {86, -24}}));
|
---|
116 | connect(GEN.terminal, iMach.term_p) annotation(
|
---|
117 | Line(points = {{-1.33227e-15, 38}, {-1.33227e-15, 24}, {-1.33227e-15, 8.1}, {-0.1, 8.1}}));
|
---|
118 | connect(iMach.term_n, bus.terminal) annotation(
|
---|
119 | Line(points = {{-0.1, -11.9}, {-0.1, -24}, {14, -24}}));
|
---|
120 | connect(fromPark.Xd, iMach.i_d) annotation(
|
---|
121 | Line(points = {{-28, 2}, {-11, 2}}, color = {0, 0, 127}));
|
---|
122 | connect(iMach.i_q, fromPark.Xq) annotation(
|
---|
123 | Line(points = {{-11, -6}, {-18, -6}, {-18, -10}, {-28, -10}}, color = {0, 0, 127}));
|
---|
124 | connect(fromPark.phi, theta.y) annotation(
|
---|
125 | Line(points = {{-40, -16}, {-40, -28}, {-54.4, -28}}, color = {0, 0, 127}));
|
---|
126 | connect(TGEN.terminalA, bus.terminal) annotation(
|
---|
127 | Line(points = {{26, -24}, {14, -24}}));
|
---|
128 | connect(TGEN.terminalB, bus1.terminal) annotation(
|
---|
129 | Line(points = {{46, -24}, {58, -24}}));
|
---|
130 | annotation(
|
---|
131 | experiment(StopTime = 4, Interval = 0.0005, Tolerance = 1e-06, StartTime = 0),
|
---|
132 | Documentation(info = "<html><head></head><body><p style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px;\">Modello derivato da PowerGrids.Electrical.Machines.Test.SynchronousMachine4WindingsNoLoad per valutare l'andamento nel tempo di correnti di corto circuito trifase franco a partire da macchina a vuoto.</p><p style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px;\">Questo modello non converge se si sceglie di inserire anche i TransformerTerms nel modello della macchina.</p><p style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px;\">Per valutare il comportamento della macchina con i TransformerTerms si può usare il modello contenente \"TT\" nel nome del mesedesimo package do qiesto modello.</p><p style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px;\">Per ottenere una velocità socostante qui si è scelta una enorme costante d'inerzia H=1000s.</p><p style=\"font-family: 'MS Shell Dlg 2'; font-size: 12px;\"><br></p>
|
---|
133 | </body></html>"),
|
---|
134 | Diagram(coordinateSystem(extent = {{-100, -60}, {100, 60}})));
|
---|
135 | end ScTT1;
|
---|
136 |
|
---|
137 | package Support
|
---|
138 | extends Modelica.Icons.Package;
|
---|
139 |
|
---|
140 | model FromPark "Semplice PMM con modello funzionale inverter"
|
---|
141 | parameter Integer p "Number or pole pairs";
|
---|
142 | Modelica.Electrical.Machines.SpacePhasors.Blocks.FromSpacePhasor fromSpacePhasor annotation(
|
---|
143 | Placement(transformation(extent = {{60, 0}, {80, 20}})));
|
---|
144 | Modelica.Electrical.Machines.SpacePhasors.Blocks.Rotator rotator annotation(
|
---|
145 | Placement(transformation(extent = {{0, 6}, {20, 26}})));
|
---|
146 | Modelica.Blocks.Routing.Multiplex2 multiplex2_1 annotation(
|
---|
147 | Placement(transformation(extent = {{-40, 0}, {-20, 20}})));
|
---|
148 | Modelica.Blocks.Interfaces.RealOutput y[3] annotation(
|
---|
149 | Placement(transformation(extent = {{100, -10}, {120, 10}}), iconTransformation(extent = {{100, -10}, {120, 10}})));
|
---|
150 | Modelica.Blocks.Interfaces.RealInput Xd annotation(
|
---|
151 | Placement(transformation(extent = {{-140, 40}, {-100, 80}}), iconTransformation(extent = {{-140, 40}, {-100, 80}})));
|
---|
152 | Modelica.Blocks.Interfaces.RealInput Xq annotation(
|
---|
153 | Placement(transformation(extent = {{-140, -80}, {-100, -40}}), iconTransformation(extent = {{-140, -80}, {-100, -40}})));
|
---|
154 | Modelica.Blocks.Interfaces.RealInput phi annotation(
|
---|
155 | Placement(transformation(extent = {{-20, -20}, {20, 20}}, rotation = 90, origin = {0, -120}), iconTransformation(extent = {{-20, -20}, {20, 20}}, rotation = 90, origin = {0, -120})));
|
---|
156 | Modelica.Blocks.Math.Gain gain(k = -p) annotation(
|
---|
157 | Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 90, origin = {10, -50})));
|
---|
158 | Modelica.Blocks.Sources.Constant const(k = 0) annotation(
|
---|
159 | Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 90, origin = {50, -30})));
|
---|
160 | equation
|
---|
161 | connect(multiplex2_1.y, rotator.u) annotation(
|
---|
162 | Line(points = {{-19, 10}, {-10, 10}, {-10, 16}, {-2, 16}}, color = {0, 0, 127}, smooth = Smooth.None));
|
---|
163 | connect(fromSpacePhasor.u, rotator.y) annotation(
|
---|
164 | Line(points = {{58, 10}, {40, 10}, {40, 16}, {21, 16}}, color = {0, 0, 127}, smooth = Smooth.None));
|
---|
165 | connect(fromSpacePhasor.y, y) annotation(
|
---|
166 | Line(points = {{81, 10}, {94, 10}, {94, 0}, {110, 0}}, color = {0, 0, 127}, smooth = Smooth.None));
|
---|
167 | connect(multiplex2_1.u1[1], Xd) annotation(
|
---|
168 | Line(points = {{-42, 16}, {-60, 16}, {-60, 60}, {-120, 60}}, color = {0, 0, 127}, smooth = Smooth.None));
|
---|
169 | connect(multiplex2_1.u2[1], Xq) annotation(
|
---|
170 | Line(points = {{-42, 4}, {-60, 4}, {-60, -60}, {-120, -60}}, color = {0, 0, 127}, smooth = Smooth.None));
|
---|
171 | connect(rotator.angle, gain.y) annotation(
|
---|
172 | Line(points = {{10, 4}, {10, -39}}, color = {0, 0, 127}, smooth = Smooth.None));
|
---|
173 | connect(gain.u, phi) annotation(
|
---|
174 | Line(points = {{10, -62}, {10, -120}, {0, -120}}, color = {0, 0, 127}, smooth = Smooth.None));
|
---|
175 | connect(fromSpacePhasor.zero, const.y) annotation(
|
---|
176 | Line(points = {{58, 2}, {50, 2}, {50, -19}}, color = {0, 0, 127}, smooth = Smooth.None));
|
---|
177 | annotation(
|
---|
178 | Diagram(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}})),
|
---|
179 | experiment(StopTime = 5, Interval = 0.001),
|
---|
180 | Documentation(info = "<html>
|
---|
181 | <p>Converts variables form Park into phase quantities</p>
|
---|
182 | </html>"),
|
---|
183 | __Dymola_experimentSetupOutput,
|
---|
184 | Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {2, 2}), graphics = {Rectangle(lineColor = {0, 0, 127}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}}), Text(lineColor = {0, 0, 127}, extent = {{-96, 28}, {96, -26}}, textString = "P=>"), Text(lineColor = {0, 0, 255}, extent = {{-108, 150}, {102, 110}}, textString = "%name")}));
|
---|
185 | end FromPark;
|
---|
186 |
|
---|
187 | model GetCurrent
|
---|
188 | Modelica.Blocks.Interfaces.RealOutput i_d annotation(
|
---|
189 | Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 90, origin = {-40, 110}), iconTransformation(extent = {{-10, -10}, {10, 10}}, rotation = 90, origin = {-40, 110})));
|
---|
190 | Modelica.Blocks.Interfaces.RealOutput i_q annotation(
|
---|
191 | Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 90, origin = {40, 110}), iconTransformation(extent = {{-10, -10}, {10, 10}}, rotation = 90, origin = {40, 110})));
|
---|
192 | PowerGrids.Interfaces.TerminalAC term_n annotation(
|
---|
193 | Placement(transformation(extent = {{90, -8}, {108, 10}}), iconTransformation(extent = {{90, -8}, {108, 10}})));
|
---|
194 | PowerGrids.Interfaces.TerminalAC term_p annotation(
|
---|
195 | Placement(transformation(extent = {{-110, -8}, {-92, 10}}), iconTransformation(extent = {{-110, -8}, {-92, 10}})));
|
---|
196 | equation
|
---|
197 | i_d = -term_p.i.im * sqrt(2);
|
---|
198 | i_q = term_p.i.re * sqrt(2);
|
---|
199 | connect(term_p, term_n) annotation(
|
---|
200 | Line(points = {{-101, 1}, {99, 1}}, color = {0, 0, 0}));
|
---|
201 | annotation(
|
---|
202 | Icon(coordinateSystem(preserveAspectRatio = false), graphics = {Ellipse(extent = {{-60, 16}, {60, -16}}, lineColor = {28, 108, 200}), Line(points = {{-40, 100}, {-20, 14}}, color = {28, 108, 200}), Line(points = {{42, 100}, {20, 16}}, color = {28, 108, 200}), Line(points = {{-100, 0}, {92, 0}}, color = {28, 108, 200}), Text(extent = {{-98, -36}, {100, -54}}, lineColor = {0, 0, 255}, textString = "%name")}),
|
---|
203 | Diagram(coordinateSystem(preserveAspectRatio = false)),
|
---|
204 | Icon(coordinateSystem(preserveAspectRatio = false), graphics = {Ellipse(lineColor = {28, 108, 200}, extent = {{-60, 16}, {60, -16}}, endAngle = 360), Line(points = {{-40, 100}, {-20, 14}}, color = {28, 108, 200}), Line(points = {{42, 100}, {20, 16}}, color = {28, 108, 200}), Line(points = {{-100, 0}, {92, 0}}), Text(lineColor = {0, 0, 255}, extent = {{-98, -36}, {100, -54}}, textString = "%name")}),
|
---|
205 | Diagram(coordinateSystem(preserveAspectRatio = false)),
|
---|
206 | Documentation(info = "<html>
|
---|
207 | <p>Preleva la corrente complessa da Power Grids e ne prende le componenti di Park. Per questo fa la separazione in parti reali e immaginarie e poi moltiplica per sqrt(2): infatti le correnti in transito in PowerGrids sono fasori di ampiezza pari al valore efficace.</p>
|
---|
208 | </html>"));
|
---|
209 | end GetCurrent;
|
---|
210 | annotation(
|
---|
211 | Icon(graphics = {Ellipse(extent = {{-38, 40}, {38, -36}}, lineColor = {0, 0, 0}), Line(points = {{2, 82}, {-8, 82}, {-12, 72}, {-26, 68}, {-36, 78}, {-48, 70}, {-44, 58}, {-56, 46}, {-68, 50}, {-76, 36}, {-68, 30}, {-70, 16}, {-80, 12}, {-80, 2}}, color = {0, 0, 0}, smooth = Smooth.None), Line(points = {{2, -78}, {-8, -78}, {-12, -68}, {-26, -64}, {-36, -74}, {-48, -66}, {-44, -54}, {-56, -42}, {-68, -46}, {-76, -32}, {-68, -26}, {-70, -12}, {-80, -8}, {-80, 2}}, color = {0, 0, 0}, smooth = Smooth.None), Line(points = {{0, -78}, {10, -78}, {14, -68}, {28, -64}, {38, -74}, {50, -66}, {46, -54}, {58, -42}, {70, -46}, {78, -32}, {70, -26}, {72, -12}, {82, -8}, {82, 2}}, color = {0, 0, 0}, smooth = Smooth.None), Line(points = {{0, 82}, {10, 82}, {14, 72}, {28, 68}, {38, 78}, {50, 70}, {46, 58}, {58, 46}, {70, 50}, {78, 36}, {70, 30}, {72, 16}, {82, 12}, {82, 2}}, color = {0, 0, 0}, smooth = Smooth.None)}));
|
---|
212 | end Support;
|
---|
213 | equation
|
---|
214 |
|
---|
215 | annotation(
|
---|
216 | Diagram(coordinateSystem(extent = {{-100, -80}, {100, 80}})),
|
---|
217 | uses(PowerGrids(version = "1.0.0"), Modelica(version = "3.2.3")));
|
---|
218 | end Test2;
|
---|