Skip to content

Commit 2a79775

Browse files
committed
update
1 parent 50dad5d commit 2a79775

4 files changed

Lines changed: 1554 additions & 23 deletions

File tree

OpenIPSL/Electrical/Machines/ControlsMotors.mo

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,11 @@ package ControlsMotors "Control models"
252252
Modelica.Blocks.Sources.BooleanExpression open_circuit_condition(y=if
253253
Resistor.i <= 0 then true else false)
254254
annotation (Placement(transformation(extent={{52,6},{32,26}})));
255-
Modelica.Blocks.Sources.RealExpression Pmotor(y=-(n.vr*n.ir + n.vi*n.ii))
255+
Modelica.Blocks.Sources.RealExpression Pmotor(y=-(n.vr*n.ir + n.vi*n.ii)
256+
*SPEED_INPUT/wb)
256257
annotation (Placement(transformation(extent={{24,70},{44,90}})));
257-
Modelica.Blocks.Sources.RealExpression Qmotor(y=(n.vr*n.ii - n.vi*n.ir))
258+
Modelica.Blocks.Sources.RealExpression Qmotor(y=(n.vr*n.ii - n.vi*n.ir)
259+
*SPEED_INPUT/wb)
258260
annotation (Placement(transformation(extent={{24,54},{44,74}})));
259261
OpenIPSL.Types.PerUnit P;
260262
Modelica.Units.SI.ActivePower Pdc;
@@ -297,6 +299,7 @@ package ControlsMotors "Control models"
297299
annotation (Dialog(group="DC Link Parameters"));
298300
parameter Real m0= 0.1 "Initial PWM Modulation Value" annotation (Dialog(group="DC Link Parameters"));
299301
parameter Real N=1;
302+
Real SPEED_INPUT;
300303

301304
parameter Modelica.Units.SI.AngularVelocity wb = 2*pi*fn/N;
302305
Modelica.Blocks.Sources.RealExpression Smotor(y=sqrt(Pmotor.y^2 + Qmotor.y^2))
@@ -306,6 +309,14 @@ package ControlsMotors "Control models"
306309
extent={{-10,10},{10,-10}},
307310
rotation=270,
308311
origin={-46,-14})));
312+
Modelica.Blocks.Interfaces.RealInput speed_input annotation (Placement(
313+
transformation(
314+
extent={{-20,-20},{20,20}},
315+
rotation=180,
316+
origin={120,-60}), iconTransformation(
317+
extent={{-20,-20},{20,20}},
318+
rotation=180,
319+
origin={140,-60})));
309320
protected
310321
parameter OpenIPSL.Types.Voltage Vd00 = 3*sqrt(6)*v_0*V_b/Modelica.Constants.pi;
311322
parameter OpenIPSL.Types.Voltage Vc0 = 2*sqrt(2)*Vmotor0*V_b/m0;
@@ -332,6 +343,8 @@ package ControlsMotors "Control models"
332343
connect(signalCurrent.i, Ii.y) annotation (Line(points={{62,-14},{67,-14}}, color={0,0,127}));
333344
connect(open_circuit_condition.y, switch.control)
334345
annotation (Line(points={{31,16},{20,16},{20,12}}, color={255,0,255}));
346+
SPEED_INPUT = speed_input;
347+
335348
P = (p.vr*p.ir + p.vi*p.ii);
336349
Q = ((-p.vr*p.ii) + p.vi*p.ir);
337350
Q = 0;

OpenIPSL/Electrical/Renewables/PSSE/AddOnBlocks.mo

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,21 @@ package AddOnBlocks
1515

1616
Modelica.Blocks.Interfaces.RealOutput Ppv
1717
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
18-
Modelica.Blocks.Sources.CombiTimeTable SolarRadiation(table=[0.0,666.6667;
19-
10,666.6667; 10.1,666.6667; 20,666.6667; 20.01,333.334; 30,333.334;
20-
30.1,333.334; 40,333.334; 40.1,0; 50,0; 50.1,0; 60,0])
18+
Modelica.Blocks.Sources.CombiTimeTable SolarRadiation(table=IrradianceTable)
2119
annotation (Placement(transformation(extent={{-80,40},{-60,60}})));
22-
Modelica.Blocks.Sources.CombiTimeTable SolarArrayTemperature(table=[0.0,
23-
298.15; 60,298.15])
20+
Modelica.Blocks.Sources.CombiTimeTable SolarArrayTemperature(table=
21+
TemperatureTable)
2422
annotation (Placement(transformation(extent={{-80,-60},{-60,-40}})));
2523

2624

2725

2826

27+
parameter Real IrradianceTable[:,:]=[0.0,666.6667; 10,666.6667; 10.1,
28+
666.6667; 20,666.6667; 20.01,333.334; 30,333.334; 30.1,333.334; 40,
29+
333.334; 40.1,0; 50,0; 50.1,0; 60,0]
30+
"Table matrix (time = first column; e.g., table=[0, 0; 1, 1; 2, 4])";
31+
parameter Real TemperatureTable[:,:]=[0.0,298.15; 60,298.15]
32+
"Table matrix (time = first column; e.g., table=[0, 0; 1, 1; 2, 4])";
2933
equation
3034

3135
Ppv = (Ypv/Sb)*fpv*(SolarRadiation.y[1]/Gtstc)*(1 + ap*(SolarArrayTemperature.y[1] - Tcstc));

0 commit comments

Comments
 (0)