1 | encapsulated package TestMove
|
---|
2 | import Modelica;
|
---|
3 | import RLCPkg;
|
---|
4 |
|
---|
5 | model RL_P
|
---|
6 | Modelica.Electrical.Analog.Basic.Resistor resistor1(R = 1) annotation(
|
---|
7 | Placement(visible = true, transformation(origin = {64, 18}, extent = {{-10, -10}, {10, 10}}, rotation = 270)));
|
---|
8 | Modelica.Electrical.Analog.Basic.Inductor inductor(L = 10e-3) annotation(
|
---|
9 | Placement(visible = true, transformation(origin = {64, -12}, extent = {{-10, -10}, {10, 10}}, rotation = 270)));
|
---|
10 | Modelica.Electrical.Analog.Sensors.PowerSensor pMeas annotation(
|
---|
11 | Placement(visible = true, transformation(extent = {{-14, 20}, {6, 40}}, rotation = 0)));
|
---|
12 | Modelica.Electrical.Analog.Basic.Ground ground annotation(
|
---|
13 | Placement(visible = true, transformation(extent = {{-10, -66}, {10, -46}}, rotation = 0)));
|
---|
14 | Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage(freqHz = 50, V = 100) annotation(
|
---|
15 | Placement(visible = true, transformation(origin = {-60, 4}, extent = {{-10, 10}, {10, -10}}, rotation = 270)));
|
---|
16 | equation
|
---|
17 | connect(pMeas.pv, pMeas.pc) annotation(
|
---|
18 | Line(points = {{-4, 38}, {-14, 38}, {-14, 28}}, color = {0, 0, 255}));
|
---|
19 | connect(sineVoltage.p, pMeas.pc) annotation(
|
---|
20 | Line(points = {{-60, 14}, {-60, 28}, {-14, 28}}, color = {0, 0, 255}));
|
---|
21 | connect(pMeas.nv, inductor.n) annotation(
|
---|
22 | Line(points = {{-4, 18}, {-4, -36}, {64, -36}, {64, -22}}, color = {0, 0, 255}));
|
---|
23 | connect(pMeas.nc, resistor1.p) annotation(
|
---|
24 | Line(points = {{6, 28}, {6, 28}, {64, 28}}, color = {0, 0, 255}));
|
---|
25 | connect(resistor1.n, inductor.p) annotation(
|
---|
26 | Line(points = {{64, 8}, {64, -2}}, color = {0, 0, 255}));
|
---|
27 | connect(sineVoltage.n, inductor.n) annotation(
|
---|
28 | Line(points = {{-60, -6}, {-60, -6}, {-60, -36}, {64, -36}, {64, -22}}, color = {0, 0, 255}));
|
---|
29 | connect(ground.p, inductor.n) annotation(
|
---|
30 | Line(points = {{0, -46}, {0, -36}, {64, -36}, {64, -22}}, color = {0, 0, 255}));
|
---|
31 | annotation(
|
---|
32 | experiment(StopTime = 0.1),
|
---|
33 | experimentSetupOutput,
|
---|
34 | Documentation(info = "<html>
|
---|
35 | <p>Misura di potenza attiva e reattiva istantanea su carico RLC</p>
|
---|
36 | </html>"),
|
---|
37 | Diagram(coordinateSystem(extent = {{-80, -60}, {80, 60}}, preserveAspectRatio = false, initialScale = 0.1)),
|
---|
38 | Icon(coordinateSystem(extent = {{-80, -60}, {80, 60}}, preserveAspectRatio = false, initialScale = 0.1)));
|
---|
39 | end RL_P;
|
---|
40 |
|
---|
41 | package ConDiodo
|
---|
42 | model RLD
|
---|
43 | Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage(freqHz = 50, V = 100) annotation(
|
---|
44 | Placement(visible = true, transformation(origin = {-30, 4}, extent = {{-10, -10}, {10, 10}}, rotation = 270)));
|
---|
45 | Modelica.Electrical.Analog.Basic.Inductor inductor(L = 1e-3, i(fixed = true)) annotation(
|
---|
46 | Placement(visible = true, transformation(origin = {30, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 270)));
|
---|
47 | Modelica.Electrical.Analog.Basic.Ground ground annotation(
|
---|
48 | Placement(visible = true, transformation(extent = {{-60, -40}, {-40, -20}}, rotation = 0)));
|
---|
49 | Modelica.Electrical.Analog.Basic.Resistor Rload(R = 1) annotation(
|
---|
50 | Placement(visible = true, transformation(origin = {30, -20}, extent = {{-10, -10}, {10, 10}}, rotation = 270)));
|
---|
51 | Modelica.Electrical.Analog.Ideal.IdealDiode idealDiode annotation(
|
---|
52 | Placement(visible = true, transformation(extent = {{-10, 24}, {10, 44}}, rotation = 0)));
|
---|
53 | Modelica.Electrical.Analog.Basic.Resistor Rload1(R = 1e5) annotation(
|
---|
54 | Placement(visible = true, transformation(origin = {58, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 270)));
|
---|
55 | equation
|
---|
56 | connect(Rload1.n, inductor.n) annotation(
|
---|
57 | Line(points = {{58, 2}, {30, 2}}, color = {0, 0, 255}));
|
---|
58 | connect(Rload1.p, inductor.p) annotation(
|
---|
59 | Line(points = {{58, 22}, {30, 22}}, color = {0, 0, 255}));
|
---|
60 | connect(idealDiode.p, sineVoltage.p) annotation(
|
---|
61 | Line(points = {{-10, 34}, {-20, 34}, {-30, 34}, {-30, 23}, {-30, 14}}, color = {0, 0, 255}));
|
---|
62 | connect(idealDiode.n, inductor.p) annotation(
|
---|
63 | Line(points = {{10, 34}, {20, 34}, {30, 34}, {30, 27}, {30, 22}}, color = {0, 0, 255}));
|
---|
64 | connect(Rload.n, sineVoltage.n) annotation(
|
---|
65 | Line(points = {{30, -30}, {30, -35}, {30, -35}, {30, -38}, {-30, -38}, {-30, -23}, {-30, -23}, {-30, -6}}, color = {0, 0, 255}));
|
---|
66 | connect(Rload.p, inductor.n) annotation(
|
---|
67 | Line(points = {{30, -10}, {30, -6}, {30, -2}, {30, 2}}, color = {0, 0, 255}));
|
---|
68 | connect(ground.p, sineVoltage.n) annotation(
|
---|
69 | Line(points = {{-50, -20}, {-50, -6}, {-30, -6}}, color = {0, 0, 255}));
|
---|
70 | annotation(
|
---|
71 | experiment(StopTime = 0.06),
|
---|
72 | __Dymola_experimentSetupOutput,
|
---|
73 | Diagram(coordinateSystem(extent = {{-80, -60}, {80, 60}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})),
|
---|
74 | Icon(coordinateSystem(extent = {{-80, -60}, {80, 60}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})));
|
---|
75 | end RLD;
|
---|
76 | end ConDiodo;
|
---|
77 | annotation(
|
---|
78 | uses(Modelica(version = "3.2.2")));
|
---|
79 | end TestMove;
|
---|