Ticket #3260: TestSave.2.mo

File TestSave.2.mo, 22.0 KB (added by massimo ceraolo, 10 years ago)
Line 
1within ;
2encapsulated package TestSave
3 import Modelica;
4
5 model RLC
6 Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage(V = 1, freqHz = 50) annotation(Placement(visible = true, transformation(origin = {-42, 2}, extent = {{-10, -10}, {10, 10}}, rotation = 270)));
7 Modelica.Electrical.Analog.Basic.Resistor resistor(R = 1) annotation(Placement(visible = true, transformation(extent = {{-10, 30}, {10, 50}}, rotation = 0)));
8 Modelica.Electrical.Analog.Basic.Capacitor capacitor(C = 10e-6) annotation(Placement(visible = true, transformation(origin = {50, -30}, extent = {{-10, -10}, {10, 10}}, rotation = 270)));
9 Modelica.Electrical.Analog.Basic.Inductor inductor(L = 0.01) annotation(Placement(visible = true, transformation(origin = {50, 8}, extent = {{-10, -10}, {10, 10}}, rotation = 270)));
10 Modelica.Electrical.Analog.Basic.Ground ground annotation(Placement(visible = true, transformation(extent = {{-72, -46}, {-52, -26}}, rotation = 0)));
11 equation
12 connect(ground.p, sineVoltage.n) annotation(Line(points = {{-62, -26}, {-62, -8}, {-42, -8}}, color = {0, 0, 255}));
13 connect(inductor.n, capacitor.p) annotation(Line(points = {{50, -2}, {50, -20}}, color = {0, 0, 255}));
14 connect(inductor.p, resistor.n) annotation(Line(points = {{50, 18}, {50, 40}, {10, 40}}, color = {0, 0, 255}));
15 connect(sineVoltage.n, capacitor.n) annotation(Line(points = {{-42, -8}, {-42, -40}, {50, -40}}, color = {0, 0, 255}));
16 connect(resistor.p, sineVoltage.p) annotation(Line(points = {{-10, 40}, {-42, 40}, {-42, 12}}, color = {0, 0, 255}));
17 annotation(experiment(StopTime = 0.1), experimentSetupOutput, Diagram(coordinateSystem(extent = {{-100, -60}, {100, 60}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})), Icon(coordinateSystem(extent = {{-100, -60}, {100, 60}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})));
18 end RLC;
19
20 model RLC_PQ
21 Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage(freqHz = 50, V = 100) annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 270, origin = {-52, 4})));
22 Modelica.Electrical.Analog.Basic.Ground ground annotation(Placement(transformation(extent = {{-82, -40}, {-62, -20}})));
23 Modelica.Electrical.Analog.Sensors.PowerSensor pMeas annotation(Placement(transformation(extent = {{-32, 30}, {-12, 50}})));
24 QMonoSensor qMeas annotation(Placement(transformation(extent = {{10, 30}, {30, 50}})));
25 Avg avg annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 180, origin = {-70, 30})));
26 Modelica.Blocks.Math.Mean mean(f = 50) annotation(Placement(transformation(extent = {{-60, 60}, {-80, 80}})));
27 Avg avgQ annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 90, origin = {0, 76})));
28 Modelica.Electrical.Analog.Basic.Inductor inductor(L = 10e-3) annotation(Placement(visible = true, transformation(origin = {50, -20}, extent = {{-10, -10}, {10, 10}}, rotation = 270)));
29 Modelica.Electrical.Analog.Basic.Resistor resistor1(R = 1) annotation(Placement(visible = true, transformation(origin = {50, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 270)));
30 Modelica.Electrical.Analog.Basic.Capacitor capacitor(C = 10e-6) annotation(Placement(visible = true, transformation(origin = {50, -50}, extent = {{-10, -10}, {10, 10}}, rotation = 270)));
31 equation
32 connect(capacitor.n, sineVoltage.n) annotation(Line(points = {{50, -60}, {50, -58}, {-52, -58}, {-52, -6}}, color = {0, 0, 255}));
33 connect(inductor.n, capacitor.p) annotation(Line(points = {{50, -30}, {50, -40}}, color = {0, 0, 255}));
34 connect(qMeas.nc, resistor1.p) annotation(Line(points = {{30, 40}, {54, 40}, {50, 40}}, color = {0, 0, 255}));
35 connect(resistor1.n, inductor.p) annotation(Line(points = {{50, 20}, {50, -10}}, color = {0, 0, 255}));
36 connect(ground.p, sineVoltage.n) annotation(Line(points = {{-72, -20}, {-72, -6}, {-52, -6}}, color = {0, 0, 255}, smooth = Smooth.None));
37 connect(pMeas.pv, pMeas.pc) annotation(Line(points = {{-22, 50}, {-32, 50}, {-32, 40}}, color = {0, 0, 255}, smooth = Smooth.None));
38 connect(pMeas.pc, sineVoltage.p) annotation(Line(points = {{-32, 40}, {-52, 40}, {-52, 14}}, color = {0, 0, 255}, smooth = Smooth.None));
39 connect(pMeas.nv, sineVoltage.n) annotation(Line(points = {{-22, 30}, {-22, -6}, {-52, -6}}, color = {0, 0, 255}, smooth = Smooth.None));
40 connect(qMeas.pc, pMeas.nc) annotation(Line(points = {{10, 40}, {-12, 40}}, color = {0, 0, 255}, smooth = Smooth.None));
41 connect(qMeas.nv, sineVoltage.n) annotation(Line(points = {{20, 30}, {20, -6}, {-52, -6}}, color = {0, 0, 255}, smooth = Smooth.None));
42 connect(qMeas.pv, qMeas.pc) annotation(Line(points = {{20, 50}, {10, 50}, {10, 40}}, color = {0, 0, 255}, smooth = Smooth.None));
43 connect(avg.u, pMeas.power) annotation(Line(points = {{-58, 30}, {-44, 30}, {-44, 29}, {-30, 29}}, color = {0, 0, 127}, smooth = Smooth.None));
44 connect(mean.u, pMeas.power) annotation(Line(points = {{-58, 70}, {-38, 70}, {-38, 29}, {-30, 29}}, color = {0, 0, 127}, smooth = Smooth.None));
45 connect(avgQ.u, qMeas.power) annotation(Line(points = {{-6.66134e-016, 64}, {-6.66134e-016, 24}, {12, 24}, {12, 29}}, color = {0, 0, 127}, smooth = Smooth.None));
46 annotation(experiment(StopTime = 0.1), experimentSetupOutput, Documentation(info = "<html>
47 <p>Misura di potenza attiva e reattiva istantanea su carico RLC</p>
48 </html>"), Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {1, 1})), Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false, initialScale = 0.1, grid = {1, 1})));
49 end RLC_PQ;
50
51 model RLC_PQ2 "pq istantanee e medie"
52 Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage(freqHz = 50, V = 100) annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 270, origin = {-52, 2})));
53 Modelica.Electrical.Analog.Basic.Inductor inductor(L = 2e-3) annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 270, origin = {54, -16})));
54 Modelica.Electrical.Analog.Basic.Ground ground annotation(Placement(transformation(extent = {{-82, -42}, {-62, -22}})));
55 Modelica.Electrical.Analog.Sensors.PowerSensor powerSensor annotation(Placement(transformation(extent = {{-20, 30}, {0, 50}})));
56 Modelica.Electrical.Analog.Basic.Resistor resistor1(R = 10) annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 270, origin = {54, 16})));
57 Modelica.Electrical.Analog.Basic.Capacitor capacitor(C = 50e-6) annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 270, origin = {54, -48})));
58 QMonoSensor qMonoSensor annotation(Placement(transformation(extent = {{18, 30}, {38, 50}})));
59 Avg Pav annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 270, origin = {-22, 10})));
60 Avg Qav annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 270, origin = {12, 10})));
61 equation
62 connect(ground.p, sineVoltage.n) annotation(Line(points = {{-72, -22}, {-72, -8}, {-52, -8}}, color = {0, 0, 255}, smooth = Smooth.None));
63 connect(powerSensor.pv, powerSensor.pc) annotation(Line(points = {{-10, 50}, {-20, 50}, {-20, 40}}, color = {0, 0, 255}, smooth = Smooth.None));
64 connect(resistor1.n, inductor.p) annotation(Line(points = {{54, 6}, {54, -6}}, color = {0, 0, 255}, smooth = Smooth.None));
65 connect(powerSensor.pc, sineVoltage.p) annotation(Line(points = {{-20, 40}, {-52, 40}, {-52, 12}}, color = {0, 0, 255}, smooth = Smooth.None));
66 connect(powerSensor.nv, sineVoltage.n) annotation(Line(points = {{-10, 30}, {-10, -8}, {-52, -8}}, color = {0, 0, 255}, smooth = Smooth.None));
67 connect(inductor.n, capacitor.p) annotation(Line(points = {{54, -26}, {54, -38}}, color = {0, 0, 255}, smooth = Smooth.None));
68 connect(capacitor.n, sineVoltage.n) annotation(Line(points = {{54, -58}, {54, -60}, {-52, -60}, {-52, -8}}, color = {0, 0, 255}, smooth = Smooth.None));
69 connect(qMonoSensor.pc, powerSensor.nc) annotation(Line(points = {{18, 40}, {0, 40}}, color = {0, 0, 255}, smooth = Smooth.None));
70 connect(qMonoSensor.nc, resistor1.p) annotation(Line(points = {{38, 40}, {54, 40}, {54, 26}}, color = {0, 0, 255}, smooth = Smooth.None));
71 connect(qMonoSensor.nv, sineVoltage.n) annotation(Line(points = {{28, 30}, {28, -8}, {-52, -8}}, color = {0, 0, 255}, smooth = Smooth.None));
72 connect(qMonoSensor.pv, qMonoSensor.pc) annotation(Line(points = {{28, 50}, {28, 50}, {18, 50}, {18, 40}}, color = {0, 0, 255}, smooth = Smooth.None));
73 connect(Pav.u, powerSensor.power) annotation(Line(points = {{-22, 22}, {-22, 23.9}, {-18, 23.9}, {-18, 29}}, color = {0, 0, 127}, smooth = Smooth.None));
74 connect(Qav.u, qMonoSensor.power) annotation(Line(points = {{12, 22}, {12, 24.9}, {20, 24.9}, {20, 29}}, color = {0, 0, 127}, smooth = Smooth.None));
75 annotation(Diagram(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}), graphics), experiment(StopTime = 0.1), experimentSetupOutput, Documentation(info = "<html>
76 <p>Misura di potenza attiva e reattiva istantanea e media su carico RLC</p>
77 </html>"));
78 end RLC_PQ2;
79
80 model RLD
81 Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage(freqHz = 50, V = 100) annotation(Placement(visible = true, transformation(origin = {-30, 4}, extent = {{-10, -10}, {10, 10}}, rotation = 270)));
82 Modelica.Electrical.Analog.Basic.Inductor inductor(L = 1e-3, i(fixed = true)) annotation(Placement(visible = true, transformation(origin = {30, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 270)));
83 Modelica.Electrical.Analog.Basic.Ground ground annotation(Placement(visible = true, transformation(extent = {{-60, -40}, {-40, -20}}, rotation = 0)));
84 Modelica.Electrical.Analog.Basic.Resistor Rload(R = 1) annotation(Placement(visible = true, transformation(origin = {30, -20}, extent = {{-10, -10}, {10, 10}}, rotation = 270)));
85 Modelica.Electrical.Analog.Ideal.IdealDiode idealDiode annotation(Placement(visible = true, transformation(extent = {{-10, 24}, {10, 44}}, rotation = 0)));
86 Modelica.Electrical.Analog.Basic.Resistor Rload1(R = 1e5) annotation(Placement(visible = true, transformation(origin = {58, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 270)));
87 equation
88 connect(Rload1.n, inductor.n) annotation(Line(points = {{58, 2}, {30, 2}}, color = {0, 0, 255}));
89 connect(Rload1.p, inductor.p) annotation(Line(points = {{58, 22}, {30, 22}}, color = {0, 0, 255}));
90 connect(idealDiode.p, sineVoltage.p) annotation(Line(points = {{-10, 34}, {-20, 34}, {-20, 34}, {-30, 34}, {-30, 23}, {-30, 23}, {-30, 14}}, color = {0, 0, 255}));
91 connect(idealDiode.n, inductor.p) annotation(Line(points = {{10, 34}, {20, 34}, {20, 34}, {30, 34}, {30, 27}, {30, 27}, {30, 22}}, color = {0, 0, 255}));
92 connect(Rload.n, sineVoltage.n) annotation(Line(points = {{30, -30}, {30, -35}, {30, -35}, {30, -38}, {-30, -38}, {-30, -23}, {-30, -23}, {-30, -6}}, color = {0, 0, 255}));
93 connect(Rload.p, inductor.n) annotation(Line(points = {{30, -10}, {30, -6}, {30, -6}, {30, -2}, {30, 2}, {30, 2}, {30, 2}, {30, 2}}, color = {0, 0, 255}));
94 connect(ground.p, sineVoltage.n) annotation(Line(points = {{-50, -20}, {-50, -6}, {-30, -6}}, color = {0, 0, 255}));
95 annotation(experiment(StopTime = 0.06), __Dymola_experimentSetupOutput, Diagram(coordinateSystem(extent = {{-100, -60}, {100, 60}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})), Icon(coordinateSystem(extent = {{-100, -60}, {100, 60}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})));
96 end RLD;
97
98 block Avg "Sensor to measure the average value of input"
99
100 Modelica.Blocks.Interfaces.RealInput u annotation(Placement(transformation(extent = {{-140, -20}, {-100, 20}})));
101 Modelica.Blocks.Interfaces.RealOutput y annotation(Placement(transformation(extent = {{100, -10}, {120, 10}})));
102 Modelica.Blocks.Continuous.Integrator integrator annotation(Placement(transformation(extent = {{-60, -10}, {-40, 10}})));
103 Modelica.Blocks.Math.Add add(k2 = -1) annotation(Placement(transformation(extent = {{12, -10}, {32, 10}})));
104 Modelica.Blocks.Nonlinear.FixedDelay fixedDelay1(delayTime = 1 / frequency) annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0, origin = {-14, -30})));
105 Modelica.Blocks.Math.Gain gain(k = frequency) annotation(Placement(transformation(extent = {{52, -10}, {72, 10}})));
106 parameter Real frequency = 50 "Frequency of the signals to be averaged";
107 equation
108 connect(integrator.u, u) annotation(Line(points = {{-62, 0}, {-120, 0}}, color = {0, 0, 127}, smooth = Smooth.None));
109 connect(add.u1, integrator.y) annotation(Line(points = {{10, 6}, {-14, 6}, {-14, 0}, {-39, 0}}, color = {0, 0, 127}, smooth = Smooth.None));
110 connect(fixedDelay1.y, add.u2) annotation(Line(points = {{-3, -30}, {4, -30}, {4, -6}, {10, -6}}, color = {0, 0, 127}, smooth = Smooth.None));
111 connect(fixedDelay1.u, integrator.y) annotation(Line(points = {{-26, -30}, {-28, -30}, {-28, 0}, {-39, 0}}, color = {0, 0, 127}, smooth = Smooth.None));
112 connect(gain.u, add.y) annotation(Line(points = {{50, 0}, {46, 0}, {46, 0}, {42, 0}, {42, 0}, {33, 0}}, color = {0, 0, 127}, smooth = Smooth.None));
113 connect(gain.y, y) annotation(Line(points = {{73, 0}, {110, 0}}, color = {0, 0, 127}, smooth = Smooth.None));
114 annotation(Icon(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics={ Text(extent = {{150, 66}, {-150, 106}}, lineColor = {0, 0, 255}, textString = "%name"), Rectangle(extent = {{-100, 50}, {100, -50}}, lineColor = {0, 0, 127}), Text(extent = {{-100, 32}, {100, -30}}, lineColor = {0, 0, 127}, textString = "AVG")}), Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics), Documentation(info = "<html><p>
115 This power sensor measures instantaneous electrical power of a singlephase system and has a separated voltage and current path. The pins of the voltage path are <code>pv</code> and <code>nv</code>, the pins of the current path are <code>pc</code> and <code>nc</code>. The internal resistance of the current path is zero, the internal resistance of the voltage path is infinite.
116 </p>
117 </html>", revisions = "<html>
118 <ul>
119 <li><i> January 12, 2006 </i>
120 by Anton Haumer<br> implemented<br>
121 </li>
122 </ul>
123 </html>"));
124 end Avg;
125
126 model QMonoSensor "Sensor to measure the reactive power"
127 Modelica.Electrical.Analog.Interfaces.PositivePin pc
128 "Positive pin, current path" annotation(Placement(transformation(extent = {{-90, -10}, {-110, 10}}, rotation = 0)));
129 Modelica.Electrical.Analog.Interfaces.NegativePin nc
130 "Negative pin, current path" annotation(Placement(transformation(extent = {{110, -10}, {90, 10}}, rotation = 0)));
131 Modelica.Electrical.Analog.Interfaces.PositivePin pv
132 "Positive pin, voltage path" annotation(Placement(transformation(extent = {{-10, 110}, {10, 90}}, rotation = 0)));
133 Modelica.Electrical.Analog.Interfaces.NegativePin nv
134 "Negative pin, voltage path" annotation(Placement(transformation(extent = {{10, -110}, {-10, -90}}, rotation = 0)));
135 Modelica.Electrical.Analog.Sensors.CurrentSensor currentSensor annotation(Placement(transformation(extent = {{-74, -10}, {-54, 10}}, rotation = 0)));
136 parameter Modelica.SIunits.Frequency Freq = 50.0 "Frequency of signals";
137 Modelica.Blocks.Interfaces.RealOutput power annotation(Placement(visible = true, transformation(origin = {-80, -110}, extent = {{-10, 10}, {10, -10}}, rotation = 270), iconTransformation(origin = {-80, -110}, extent = {{-10, 10}, {10, -10}}, rotation = 270)));
138 Modelica.Electrical.Analog.Sensors.VoltageSensor voltageSensor annotation(Placement(visible = true, transformation(origin = {0, -52}, extent = {{10, -10}, {-10, 10}}, rotation = 90)));
139 Modelica.Blocks.Math.Product product annotation(Placement(visible = true, transformation(origin = {-58, -60}, extent = {{-10, 10}, {10, -10}}, rotation = 270)));
140 Modelica.Blocks.Nonlinear.FixedDelay fixedDelay(delayTime = 1 / (4 * Freq)) annotation(Placement(visible = true, transformation(origin = {-30, -32}, extent = {{10, 10}, {-10, -10}}, rotation = 0)));
141 equation
142 connect(voltageSensor.n, nv) annotation(Line(points = {{-4.44089e-016, -62}, {-4.44089e-016, -63}, {0, -63}, {0, -100}}, color = {0, 0, 255}));
143 connect(pc, currentSensor.p) annotation(Line(points = {{-100, 0}, {-74, 0}}, color = {0, 0, 255}));
144 connect(currentSensor.n, nc) annotation(Line(points = {{-54, 0}, {100, 0}}, color = {0, 0, 255}));
145 connect(product.y, power) annotation(Line(points = {{-58, -71}, {-58, -80}, {-80, -80}, {-80, -110}}, color = {0, 0, 127}));
146 connect(pv, voltageSensor.p) annotation(Line(points = {{0, 100}, {6.66134e-016, 100}, {6.66134e-016, -42}}, color = {0, 0, 255}, smooth = Smooth.None));
147 connect(voltageSensor.v, fixedDelay.u) annotation(Line(points = {{10, -52}, {26, -52}, {26, -32}, {-18, -32}}, color = {0, 0, 127}, smooth = Smooth.None));
148 connect(currentSensor.i, product.u1) annotation(Line(points = {{-64, -10}, {-64, -48}}, color = {0, 0, 127}, smooth = Smooth.None));
149 connect(fixedDelay.y, product.u2) annotation(Line(points = {{-41, -32}, {-52, -32}, {-52, -48}}, color = {0, 0, 127}, smooth = Smooth.None));
150 annotation(Icon(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics={ Line(points = {{0, -70}, {0, -100}}, color = {0, 0, 255}), Line(points = {{-80, -100}, {-80, 0}}, color = {0, 0, 255}), Text(extent = {{150, 120}, {-150, 160}}, textString = "%name", lineColor = {0, 0, 255}), Ellipse(fillColor = {245, 245, 245},
151 fillPattern = FillPattern.Solid, extent = {{-70, -68}, {70, 72}}), Line(points = {{0, 72}, {0, 42}}), Line(points = {{22.9, 34.8}, {40.2, 59.3}}), Line(points = {{-22.9, 34.8}, {-40.2, 59.3}}), Line(points = {{37.6, 15.7}, {65.8, 25.9}}), Line(points = {{-37.6, 15.7}, {-65.8, 25.9}}), Ellipse(lineColor = {64, 64, 64}, fillColor = {255, 255, 255}, extent = {{-12, -10}, {12, 14}}), Polygon(origin = {0, 2}, rotation = -17.5, fillColor = {64, 64, 64}, pattern = LinePattern.None,
152 fillPattern = FillPattern.Solid, points = {{-5.0, 0.0}, {-2.0, 60.0}, {0.0, 65.0}, {2.0, 60.0}, {5.0, 0.0}}), Ellipse(fillColor = {64, 64, 64}, pattern = LinePattern.None,
153 fillPattern = FillPattern.Solid, extent = {{-7, -5}, {7, 9}}), Line(points = {{0, 102}, {0, 72}}, color = {0, 0, 255}), Line(points = {{0, 72}, {0, 42}}), Text(extent = {{-29, -9}, {30, -68}}, lineColor = {0, 0, 0}, textString = "Q"), Line(points = {{-100, 0}, {100, 0}}, color = {0, 0, 255})}), Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics), Documentation(info = "<html><p>
154 This power sensor measures instantaneous electrical power of a singlephase system and has a separated voltage and current path. The pins of the voltage path are <code>pv</code> and <code>nv</code>, the pins of the current path are <code>pc</code> and <code>nc</code>. The internal resistance of the current path is zero, the internal resistance of the voltage path is infinite.
155 </p>
156 </html>", revisions = "<html>
157 <ul>
158 <li><i> January 12, 2006 </i>
159 by Anton Haumer<br> implemented<br>
160 </li>
161 </ul>
162 </html>"));
163 end QMonoSensor;
164
165 model RLD_avg
166 Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage(freqHz = 50, V = 100) annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 270, origin = {-72, 30})));
167 Modelica.Electrical.Analog.Basic.Ground ground annotation(Placement(transformation(extent = {{-102, -14}, {-82, 6}})));
168 Modelica.Electrical.Analog.Basic.Resistor Rload(R = 1) annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 270, origin = {-12, 6})));
169 Modelica.Electrical.Analog.Ideal.IdealDiode idealDiode annotation(Placement(transformation(extent = {{-52, 50}, {-32, 70}})));
170 Modelica.Blocks.Math.Mean mean(f = 50) annotation(Placement(transformation(extent = {{60, 20}, {80, 40}})));
171 Avg avg1 annotation(Placement(transformation(extent = {{60, -10}, {80, 10}})));
172 Modelica.Electrical.Analog.Sensors.PotentialSensor potentialSensor annotation(Placement(transformation(extent = {{18, 0}, {38, 20}})));
173 equation
174 connect(ground.p, sineVoltage.n) annotation(Line(points = {{-92, 6}, {-92, 20}, {-72, 20}}, color = {0, 0, 255}, smooth = Smooth.None));
175 connect(Rload.n, sineVoltage.n) annotation(Line(points = {{-12, -4}, {-12, -12}, {-72, -12}, {-72, 20}}, color = {0, 0, 255}, smooth = Smooth.None));
176 connect(idealDiode.p, sineVoltage.p) annotation(Line(points = {{-52, 60}, {-72, 60}, {-72, 40}}, color = {0, 0, 255}, smooth = Smooth.None));
177 connect(potentialSensor.p, Rload.p) annotation(Line(points = {{18, 10}, {4, 10}, {4, 16}, {-12, 16}}, color = {0, 0, 255}, smooth = Smooth.None));
178 connect(potentialSensor.phi, mean.u) annotation(Line(points = {{39, 10}, {48, 10}, {48, 30}, {58, 30}}, color = {0, 0, 127}, smooth = Smooth.None));
179 connect(avg1.u, potentialSensor.phi) annotation(Line(points = {{58, 0}, {48, 0}, {48, 10}, {39, 10}}, color = {0, 0, 127}, smooth = Smooth.None));
180 connect(idealDiode.n, Rload.p) annotation(Line(points = {{-32, 60}, {-12, 60}, {-12, 16}}, color = {0, 0, 255}, smooth = Smooth.None));
181 annotation(Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}), graphics), experiment(StopTime = 0.06), __Dymola_experimentSetupOutput);
182 end RLD_avg;
183 annotation(uses(Modelica(version = "3.2.1")));
184end TestSave;