Ticket #5452: TestIndexReduction.mo

File TestIndexReduction.mo, 5.2 KB (added by Francesco Casella, 5 years ago)
Line 
1within ;
2model TestIndexReduction
3 extends Modelica.Icons.Example;
4 import Modelica.Constants.pi;
5 import Modelica.Electrical.MultiPhase.Functions.factorY2DC;
6 constant Integer m=3 "Number of phases";
7 parameter Modelica.SIunits.Voltage VNominal=400
8 "Nominal RMS voltage per phase";
9 parameter Modelica.SIunits.Frequency fNominal=50 "Nominal frequency";
10 parameter Modelica.SIunits.Resistance RGrid=10e-3 "Grid choke resistance";
11 parameter Modelica.SIunits.Inductance LGrid=500e-6 "Grid choke inductance";
12 parameter Modelica.SIunits.Voltage VDC=factorY2DC(m)*VNominal/sqrt(3) "Theoretical DC voltage";
13 parameter Modelica.SIunits.Capacitance CDC=5e-3 "DC capacitor";
14 parameter Modelica.SIunits.Torque TLoad=161.4 "Nominal load torque";
15 parameter Modelica.SIunits.AngularVelocity wLoad=1440.45*2*pi/60 "Nominal load speed";
16 parameter Modelica.SIunits.Inertia JLoad=0.29 "Load's moment of inertia";
17 Modelica.Electrical.MultiPhase.Sources.SineVoltage sineVoltage(
18 final m=m,
19 final phase=-Modelica.Electrical.MultiPhase.Functions.symmetricOrientation(
20 m),
21 final freqHz=fill(fNominal, m),
22 final offset=zeros(m),
23 final startTime=zeros(m),
24 final V=fill(VNominal*sqrt(2/3), m)) annotation (Placement(transformation(
25 extent={{-10,-10},{10,10}},
26 rotation=270,
27 origin={-80,-30})));
28 Modelica.Electrical.MultiPhase.Basic.Star star(m=m) annotation (Placement(
29 transformation(
30 extent={{-10,-10},{10,10}},
31 rotation=270,
32 origin={-80,-60})));
33 Modelica.Electrical.Analog.Basic.Ground ground annotation (Placement(
34 transformation(origin={-80,-90}, extent={{-10,-10},{10,10}})));
35 Modelica.Electrical.Machines.Sensors.CurrentQuasiRMSSensor gridCurrent
36 annotation (Placement(transformation(
37 extent={{-10,10},{10,-10}},
38 rotation=270,
39 origin={-80,0})));
40 Modelica.Electrical.MultiPhase.Basic.Resistor resistor(
41 final m=m,
42 final R=fill(RGrid, m),
43 final T_ref=fill(20, m),
44 final alpha=zeros(m),
45 final T=fill(20, m)) annotation (Placement(transformation(
46 extent={{-10,-10},{10,10}},
47 rotation=90,
48 origin={-80,30})));
49 Modelica.Electrical.MultiPhase.Basic.Inductor inductor(m=m, final L=fill(
50 LGrid, m)) annotation (Placement(transformation(
51 extent={{-10,-10},{10,10}},
52 rotation=90,
53 origin={-80,60})));
54
55 Modelica.Electrical.MultiPhase.Basic.Star star1(m=m) annotation (Placement(
56 transformation(
57 extent={{-10,-10},{10,10}},
58 rotation=270,
59 origin={-30,50})));
60 Modelica.Electrical.Analog.Basic.Inductor inductor1(L=0.001) annotation (
61 Placement(transformation(
62 extent={{-10,-10},{10,10}},
63 rotation=-90,
64 origin={-30,16})));
65 Modelica.Electrical.Analog.Basic.Ground ground1 annotation (Placement(
66 transformation(origin={-30,-14}, extent={{-10,-10},{10,10}})));
67equation
68 connect(sineVoltage.plug_n, star.plug_p)
69 annotation (Line(points={{-80,-40},{-80,-50}}, color={0,0,255}));
70 connect(star.pin_n, ground.p)
71 annotation (Line(points={{-80,-70},{-80,-80}}, color={0,0,255}));
72 connect(resistor.plug_n, inductor.plug_p)
73 annotation (Line(points={{-80,40},{-80,50}}, color={0,0,255}));
74 connect(resistor.plug_p, gridCurrent.plug_p)
75 annotation (Line(points={{-80,20},{-80,10}}, color={0,0,255}));
76 connect(gridCurrent.plug_n, sineVoltage.plug_p)
77 annotation (Line(points={{-80,-10},{-80,-20}}, color={0,0,255}));
78 connect(inductor.plug_n, star1.plug_p) annotation (Line(points={{-80,70},{-80,
79 74},{-30,74},{-30,60}}, color={0,0,255}));
80 connect(star1.pin_n, inductor1.p)
81 annotation (Line(points={{-30,40},{-30,26}}, color={0,0,255}));
82 connect(inductor1.n, ground1.p)
83 annotation (Line(points={{-30,6},{-30,-4}}, color={0,0,255}));
84 annotation (experiment(
85 StopTime=1.5,
86 Interval=5e-05,
87 Tolerance=1e-06), Documentation(
88 info="<html>
89<p>
90This is a model of a complete inverter drive comprising:
91</p>
92<ul>
93<li>a grid model and a line choke</li>
94<li><a href=\"modelica://Modelica.Electrical.PowerConverters.ACDC.DiodeBridge2mPulse\">a diode rectifier</a></li>
95<li>a buffer capacitor</li>
96<li><a href=\"modelica://Modelica.Electrical.PowerConverters.DCAC.MultiPhase2Level\">a switching inverter</a></li>
97<li><a href=\"modelica://Modelica.Electrical.PowerConverters.DCAC.Control.PWM\">a pulse width modulation</a></li>
98<li><a href=\"modelica://Modelica.Electrical.Machines.Utilities.VfController\">a voltage/frequency characteristic</a></li>
99<li>the reference frequency ramped up</li>
100<li>an induction machine with squirrel cage</li>
101<li>a load inertia and quadratic speed dependent load torque (like a fan or pump)</li>
102</ul>
103<p>Please note: Be patient, two switching devices cause many event iteratons which cost performance.</p>
104<p>Note that due to the voltage drop the voltage at the machine can't reach the full voltage which means torque reduction.</p>
105<p>Default machine parameters are adapted to nominal phase voltage 400 V and nominal phase current 25 A.</p>
106</html>"),
107 uses(Modelica(version="3.2.3")));
108end TestIndexReduction;