-
Notifications
You must be signed in to change notification settings - Fork 164
/
NonLinearInductor.mo
219 lines (215 loc) · 9.31 KB
/
NonLinearInductor.mo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
within Modelica.Magnetic.QuasiStatic.FluxTubes.Examples;
model NonLinearInductor "Non linear inductor with ferromagnetic core"
extends Modelica.Icons.Example;
output Modelica.SIunits.Current deviation = feedback.y "Deviation of transient and quasi-static current";
FluxTubes.Basic.Ground ground_mQS annotation (Placement(transformation(extent={{80,-90},{100,-70}})));
Modelica.Electrical.QuasiStatic.SinglePhase.Sources.VoltageSource
sourceQS(
f=50,
V=230,
gamma(fixed=true),
phi=1.5707963267949) "Voltage applied to inductor" annotation (Placement(
transformation(
origin={-90,-50},
extent={{-10,-10},{10,10}},
rotation=270)));
Modelica.Electrical.QuasiStatic.SinglePhase.Basic.Resistor
rQS(R_ref=7.5) "Inductor coil resistance"
annotation (Placement(transformation(extent={{-50,-50},
{-30,-30}})));
FluxTubes.Basic.ElectroMagneticConverter coilQS(N=600) "Inductor coil" annotation (Placement(transformation(extent={{-20,-60},{0,-40}})));
Basic.ConstantReluctance r_mLeakQS(R_m=1.2e6)
"Constant leakage reluctance"
annotation (Placement(transformation(
origin={20,-50},
extent={{-10,-10},{10,10}},
rotation=270)));
Shapes.FixedShape.GenericFluxTube
r_mAirParQS(
l=0.0001,
mu_rConst=1,
area=0.025^2)
"Reluctance of small parasitic air gap (ferromagnetic core packeted from single sheets)"
annotation (Placement(transformation(extent={{30,-50},
{50,-30}})));
Shapes.FixedShape.GenericFluxTube
r_mFeQS(
l=4*0.065,
mu_rConst=655,
area=0.025^2) "Reluctance of ferromagnetic inductor core"
annotation (Placement(transformation(
origin={90,-50},
extent={{-10,-10},{10,10}},
rotation=270)));
Modelica.Electrical.QuasiStatic.SinglePhase.Basic.Ground
groundQS
annotation (Placement(transformation(extent={{-100,
-90},{-80,-70}})));
Magnetic.FluxTubes.Basic.Ground ground_m
annotation (Placement(transformation(extent={{80,10},{100,30}})));
Modelica.Electrical.Analog.Sources.SineVoltage source(
f=50,
phase=pi/2,
V=230*sqrt(2)) "Voltage applied to inductor" annotation (Placement(
transformation(
origin={-90,50},
extent={{-10,-10},{10,10}},
rotation=270)));
Modelica.Electrical.Analog.Basic.Resistor r(R=7.5)
"Inductor coil resistance"
annotation (Placement(transformation(extent={{-50,50},
{-30,70}})));
Magnetic.FluxTubes.Basic.ElectroMagneticConverter coil(N=600, i(fixed=true))
"Inductor coil"
annotation (Placement(transformation(extent={{-20,40},{0,60}})));
Magnetic.FluxTubes.Basic.ConstantReluctance r_mLeak(R_m=1.2e6)
"Constant leakage reluctance" annotation (Placement(transformation(
origin={20,50},
extent={{-10,-10},{10,10}},
rotation=270)));
Magnetic.FluxTubes.Shapes.FixedShape.GenericFluxTube r_mAirPar(
nonLinearPermeability=false,
mu_rConst=1,
l=0.0001,
area=0.025^2)
"Reluctance of small parasitic air gap (ferromagnetic core packeted from single sheets)"
annotation (Placement(transformation(extent={{30,50},{50,70}})));
Magnetic.FluxTubes.Shapes.FixedShape.GenericFluxTube r_mFe(
l=4*0.065,
material=Magnetic.FluxTubes.Material.SoftMagnetic.ElectricSheet.M350_50A(),
B(start=0),
mu_rConst=655,
nonLinearPermeability=true,
area=0.025^2) "Reluctance of ferromagnetic inductor core" annotation (
Placement(transformation(
origin={90,50},
extent={{-10,-10},{10,10}},
rotation=270)));
Modelica.Electrical.Analog.Basic.Ground ground annotation (Placement(
transformation(extent={{-100,10},{-80,30}})));
Modelica.Electrical.QuasiStatic.SinglePhase.Sensors.CurrentSensor
currentSensorQS
annotation (Placement(transformation(extent={{-80,-30},
{-60,-50}})));
Modelica.ComplexBlocks.ComplexMath.ComplexToPolar complexToPolar annotation (
Placement(transformation(
extent={{-10,-10},{10,10}},
origin={-50,-10})));
Modelica.Electrical.Analog.Sensors.CurrentSensor currentSensor
annotation (Placement(transformation(extent={{-80,50},{-60,70}})));
Modelica.Blocks.Math.Feedback feedback
annotation (Placement(transformation(extent={{-10,10},{10,30}})));
Sensors.Transient.FundamentalWavePermabilitySensor
fundamentalWavePermabilitySensor(
f=50,
A=0.025^2,
l=4*0.065) annotation (Placement(
transformation(extent={{60,50},{80,70}})));
Modelica.Blocks.Math.Harmonic rootMeanSquare(f=50, k=1)
annotation (Placement(transformation(extent={{-60,10},{-40,30}})));
equation
connect(coilQS.port_p, r_mLeakQS.port_p) annotation (Line(points={{0,-40},{0,-40},{20,-40}},
color={255,170,85}));
connect(r_mLeakQS.port_p, r_mAirParQS.port_p)
annotation (Line(points={{20,-40},{22,-40},
{30,-40}}, color={255,170,85}));
connect(r_mAirParQS.port_n, r_mFeQS.port_p)
annotation (Line(points={{50,-40},{50,-40},
{90,-40}}, color={255,170,85}));
connect(r_mFeQS.port_n, r_mLeakQS.port_n) annotation (Line(points={{90,-60},
{20,-60}}, color={255,170,85}));
connect(r_mFeQS.port_n, coilQS.port_n) annotation (Line(points={{90,-60},{0,-60},{0,-60}},
color={255,170,85}));
connect(ground_mQS.port, r_mFeQS.port_n) annotation (Line(
points={{90,-70},{90,-60}},
color={255,170,85}));
connect(rQS.pin_n, coilQS.pin_p) annotation (Line(
points={{-30,-40},{-20,-40},{-20,-40}},
color={85,170,255}));
connect(sourceQS.pin_n, coilQS.pin_n) annotation (Line(
points={{-90,-60},{-20,-60},{-20,-60}},
color={85,170,255}));
connect(sourceQS.pin_n, groundQS.pin) annotation (Line(
points={{-90,-60},{-90,-70}},
color={85,170,255}));
connect(r.n, coil.p)
annotation (Line(points={{-30,60},{-20,60},{-20,60}}, color={0,0,255}));
connect(source.n, coil.n)
annotation (Line(points={{-90,40},{-20,40},{-20,40}}, color={0,0,255}));
connect(coil.port_p, r_mLeak.port_p)
annotation (Line(points={{0,60},{0,60},{20,60}}, color={255,170,85}));
connect(r_mLeak.port_p, r_mAirPar.port_p)
annotation (Line(points={{20,60},{30,60}}, color={255,170,85}));
connect(r_mFe.port_n, r_mLeak.port_n) annotation (Line(points={{90,40},
{20,40}}, color={255,170,85}));
connect(r_mFe.port_n, coil.port_n)
annotation (Line(points={{90,40},{0,40},{0,40}}, color={255,170,85}));
connect(ground.p, source.n) annotation (Line(
points={{-90,30},{-90,40}},
color={0,0,255}));
connect(ground_m.port, r_mFe.port_n) annotation (Line(
points={{90,30},{90,40}},
color={255,170,85}));
connect(sourceQS.pin_p, currentSensorQS.pin_p) annotation (Line(
points={{-90,-40},{-80,-40}},
color={85,170,255}));
connect(currentSensorQS.pin_n, rQS.pin_p) annotation (Line(
points={{-60,-40},{-50,-40}},
color={85,170,255}));
connect(currentSensorQS.i, complexToPolar.u) annotation (Line(
points={{-70,-29},{-70,-10},{-62,-10}},
color={85,170,255}));
connect(source.p, currentSensor.p) annotation (Line(
points={{-90,60},{-80,60}},
color={0,0,255}));
connect(currentSensor.n, r.p) annotation (Line(
points={{-60,60},{-50,60}},
color={0,0,255}));
connect(r_mAirPar.port_n,
fundamentalWavePermabilitySensor.fluxP)
annotation (Line(
points={{50,60},{60,60}},
color={255,170,85}));
connect(fundamentalWavePermabilitySensor.fluxN,
r_mFe.port_p) annotation (Line(
points={{80,60},{90,60}},
color={255,170,85}));
connect(fundamentalWavePermabilitySensor.fluxP,
fundamentalWavePermabilitySensor.potentialP)
annotation (Line(
points={{60,60},{60,70},{70,70}},
color={255,170,85}));
connect(fundamentalWavePermabilitySensor.potentialN,
r_mFe.port_n) annotation (Line(
points={{70,50},{70,40},{90,40}},
color={255,170,85}));
connect(complexToPolar.len, feedback.u2) annotation (Line(
points={{-38,-4},{0,-4},{0,12}},
color={0,0,127}));
connect(currentSensor.i, rootMeanSquare.u) annotation (Line(
points={{-70,49},{-70,20},{-62,20}},
color={0,0,127}));
connect(rootMeanSquare.y_rms, feedback.u1) annotation (Line(
points={{-39,26},{-20,26},{-20,20},{-8,20}},
color={0,0,127}));
annotation (experiment(
StopTime=0.2,
Tolerance=1e-07), Documentation(
info="<html>
<p>
This model compares a transient non-linear magnetic circuit with a linearized quasi-static magnetic circuit. A sinusoidal voltage is applied to an inductor with a closed ferromagnetic core of rectangular shape.
</p>
<p>Compare the following quantities</p>
<ul>
<li>Sinusoidal supply voltage<br>
<code>source.v | sourceQS.v.re|im</code></li>
<li>Non-linear transient current due to saturation and equivalent quasi-static current<br>
<code>currentSensor.i | currentSensorQS.i.re|im</code></li>
<li>Difference between RMS fundamental wave of transient current and the RMS quasi-static current<br>
<code>feedback.y</code></li>
<li>Effective fundamental wave relative permeability of iron core of transient and quasi-static circuit<br>
<code>fundamentalWavePermabilitySensor.mur | r_mFeQS.mu_rConst</code></li>
</ul>
</html>"),
Diagram(coordinateSystem(preserveAspectRatio=false)));
end NonLinearInductor;