Skip to content

Commit d65ace2

Browse files
committed
remove overdetermined initialization of PowerWorld example by checking for isRoot
1 parent d3d9c3b commit d65ace2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

PowerSystems/Examples/PowerWorld/package.mo

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ package PowerWorld "Demonstrate stabilization of wind power in Eurosyslib work p
2626
annotation (Placement(transformation(extent={{-36,-6},{-24,6}})));
2727
PowerSystems.Generic.VoltageConverter distribution(ratio=380/50)
2828
annotation (Placement(transformation(extent={{44,-46},{56,-34}})));
29-
PowerSystems.Generic.Inverter HVDC
29+
PowerSystems.Generic.Inverter HVDC(potentialReference=false)
3030
annotation (Placement(transformation(extent={{-16,34},{-4,46}})));
3131
Components.HydroPlant hydroPlant(primaryControlMax=200)
3232
annotation (Placement(transformation(extent={{80,20},{60,40}})));
@@ -45,7 +45,7 @@ package PowerWorld "Demonstrate stabilization of wind power in Eurosyslib work p
4545
rotation=-90,
4646
origin={40,-10})));
4747
Modelica.Blocks.Sources.RealExpression frequency(y=system.omega/2/pi)
48-
"Average frequency" annotation (Placement(
48+
"Average frequency" annotation (Placement(
4949
transformation(
5050
extent={{-10,-10},{10,10}},
5151
rotation=-90,
@@ -153,7 +153,7 @@ The following switches/features are provided:
153153

154154
model PowerPlant "Thermal Power Plant with primary and secondary control"
155155
extends PowerSystems.Generic.Ports.PartialSource(
156-
final potentialReference=true, final definiteReference=false);
156+
final potentialReference=true);
157157

158158
parameter Boolean Modakond = false "Install Modakond for condensate stop"
159159
annotation(Dialog(group="Features"));
@@ -264,7 +264,7 @@ The following switches/features are provided:
264264
Interfaces.Sender sender(w=generator.w, H=0.5*rotor.J*rotor.w^2/800e6)
265265
annotation (Placement(transformation(extent={{66,6},{74,14}})));
266266
initial equation
267-
if potentialReference then
267+
if Connections.isRoot(generator.terminal.theta) then
268268
if system.steadyIni then
269269
rotor.a = 0;
270270
else
@@ -452,7 +452,7 @@ The following switches/features are provided:
452452

453453
model HydroPlant
454454
extends PowerSystems.Generic.Ports.PartialSource(
455-
final potentialReference=true, final definiteReference=false);
455+
final potentialReference=true);
456456

457457
parameter Real primaryControlMax(unit="MW") = 200
458458
"Maximum power for primary frequency control"
@@ -520,7 +520,7 @@ The following switches/features are provided:
520520
Interfaces.Sender sender(w=generator.w, H=0.5*rotor.J*rotor.w^2/200e6)
521521
annotation (Placement(transformation(extent={{66,16},{74,24}})));
522522
initial equation
523-
if potentialReference then
523+
if Connections.isRoot(generator.terminal.theta) then
524524
if system.steadyIni then
525525
rotor.a = 0;
526526
else

0 commit comments

Comments
 (0)