-
Notifications
You must be signed in to change notification settings - Fork 182
Demonstrate PolyphaseInitialization #4718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AHaumer
wants to merge
8
commits into
modelica:master
Choose a base branch
from
AHaumer:PolyPhaseInitialization
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+271
−0
Open
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
045df2e
Demonstrate PolyphaseInitialization
AHaumer 7c37805
Update Modelica/Electrical/Polyphase/Examples/PolyphaseInitialization.mo
AHaumer 8699cc9
Update Modelica/Electrical/Polyphase/Examples/PolyphaseInitialization.mo
AHaumer 2ae10db
Update Modelica/Electrical/Polyphase/Examples/PolyphaseInitialization.mo
AHaumer 2d15fa1
Paying attention to reviews
AHaumer 93b44c4
Apply suggestion from @HansOlsson
christiankral 8618450
Merge branch 'master' into PolyPhaseInitialization
AHaumer 5158839
Merge branch 'master' into PolyPhaseInitialization
AHaumer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
249 changes: 249 additions & 0 deletions
249
Modelica/Electrical/Polyphase/Examples/PolyphaseInitialization.mo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,249 @@ | ||
| within Modelica.Electrical.Polyphase.Examples; | ||
| model PolyphaseInitialization | ||
| "Demonstrate initialization of inductances in 3 and 4 wire system" | ||
| extends Modelica.Icons.Example; | ||
| import Modelica.Constants.pi; | ||
| constant Integer m=3 "Number of phases"; | ||
| parameter SI.Voltage V=230 "RMS voltage line to neutral"; | ||
| parameter SI.Frequency f=50 "Source frequency"; | ||
| parameter SI.Impedance Z=10 "Total impedance"; | ||
| parameter SI.Resistance R=Z/sqrt(2) "Resistive component"; | ||
| parameter SI.Inductance L=Z/sqrt(2)/(2*pi*f) "Inductive component"; | ||
| Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage11(V=sqrt(2)*V, f=f, | ||
| phase=0) | ||
| annotation (Placement(transformation(extent={{-70,70},{-90,90}}))); | ||
| Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage12(V=sqrt(2)*V, f=f, | ||
| phase=-2*pi/3) | ||
| annotation (Placement(transformation(extent={{-70,50},{-90,70}}))); | ||
| Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage13(V=sqrt(2)*V, f=f, | ||
| phase=-4*pi/3) | ||
| annotation (Placement(transformation(extent={{-70,30},{-90,50}}))); | ||
| Modelica.Electrical.Analog.Basic.Ground ground1 | ||
| annotation (Placement(transformation(extent={{-100,0},{-80,20}}))); | ||
| Modelica.Electrical.Analog.Basic.Resistor resistor11(R=R) | ||
| annotation (Placement(transformation(extent={{-30,70},{-10,90}}))); | ||
| Modelica.Electrical.Analog.Basic.Resistor resistor12(R=R) | ||
| annotation (Placement(transformation(extent={{-30,50},{-10,70}}))); | ||
| Modelica.Electrical.Analog.Basic.Resistor resistor13(R=R) | ||
| annotation (Placement(transformation(extent={{-30,30},{-10,50}}))); | ||
| Modelica.Electrical.Analog.Basic.Inductor inductor11(L=L, i(start=0, fixed=true)) | ||
| annotation (Placement(transformation(extent={{0,70},{20,90}}))); | ||
| Modelica.Electrical.Analog.Basic.Inductor inductor12(L=L, i(start=0, fixed=true)) | ||
| annotation (Placement(transformation(extent={{0,50},{20,70}}))); | ||
| Modelica.Electrical.Analog.Basic.Inductor inductor13(L=L, i(start=0, fixed=false)) | ||
| annotation (Placement(transformation(extent={{0,30},{20,50}}))); | ||
| Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage21(V=sqrt(2)*V, f=f, | ||
| phase=0) | ||
| annotation (Placement(transformation(extent={{-70,-30},{-90,-10}}))); | ||
| Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage22(V=sqrt(2)*V, f=f, | ||
| phase=-2*pi/3) | ||
| annotation (Placement(transformation(extent={{-70,-50},{-90,-30}}))); | ||
| Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage23(V=sqrt(2)*V, f=f, | ||
| phase=-4*pi/3) | ||
| annotation (Placement(transformation(extent={{-70,-70},{-90,-50}}))); | ||
| Modelica.Electrical.Analog.Basic.Ground ground2 | ||
| annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}))); | ||
| Modelica.Electrical.Analog.Basic.Resistor resistor21(R=R) | ||
| annotation (Placement(transformation(extent={{-30,-30},{-10,-10}}))); | ||
| Modelica.Electrical.Analog.Basic.Resistor resistor22(R=R) | ||
| annotation (Placement(transformation(extent={{-30,-50},{-10,-30}}))); | ||
| Modelica.Electrical.Analog.Basic.Resistor resistor23(R=R) | ||
| annotation (Placement(transformation(extent={{-30,-70},{-10,-50}}))); | ||
| Modelica.Electrical.Analog.Basic.Inductor inductor21(L=L, i(start=0, fixed=true)) | ||
| annotation (Placement(transformation(extent={{0,-30},{20,-10}}))); | ||
| Modelica.Electrical.Analog.Basic.Inductor inductor22(L=L, i(start=0, fixed=true)) | ||
| annotation (Placement(transformation(extent={{0,-50},{20,-30}}))); | ||
| Modelica.Electrical.Analog.Basic.Inductor inductor23(L=L, i(start=0, fixed=true)) | ||
| annotation (Placement(transformation(extent={{0,-70},{20,-50}}))); | ||
| Modelica.Electrical.Polyphase.Sources.SineVoltage sineVoltage3(m=m, | ||
| V=fill(sqrt(2)*V, m), f=fill(f, m)) annotation (Placement(transformation( | ||
| extent={{-10,-10},{10,10}}, | ||
| rotation=270, | ||
| origin={40,70}))); | ||
| Modelica.Electrical.Polyphase.Basic.Star star3S(m=m) annotation (Placement( | ||
| transformation( | ||
| extent={{-10,-10},{10,10}}, | ||
| rotation=270, | ||
| origin={40,40}))); | ||
| Modelica.Electrical.Analog.Basic.Ground ground3 | ||
| annotation (Placement(transformation(extent={{30,0},{50,20}}))); | ||
| Modelica.Electrical.Polyphase.Basic.Resistor resistor3(m=m, R=fill(R, m)) | ||
| annotation (Placement(transformation(extent={{80,70},{100,90}}))); | ||
| Modelica.Electrical.Polyphase.Basic.Inductor | ||
| inductor3(m=m, L=fill(L, m), | ||
| iL(start={0,0,0}, fixed={true,true,false})) | ||
| annotation (Placement(transformation(extent={{-10,-10},{10,10}}, | ||
| rotation=270, | ||
| origin={110,70}))); | ||
| Modelica.Electrical.Polyphase.Basic.Star star3L(m=m) annotation (Placement( | ||
| transformation( | ||
| extent={{-10,-10},{10,10}}, | ||
| rotation=270, | ||
| origin={110,40}))); | ||
| Modelica.Electrical.Polyphase.Sources.SineVoltage sineVoltage4(m=m, | ||
| V=fill(sqrt(2)*V, m), f=fill(f, m)) annotation (Placement(transformation( | ||
| extent={{-10,-10},{10,10}}, | ||
| rotation=270, | ||
| origin={40,-30}))); | ||
| Modelica.Electrical.Polyphase.Basic.Star star4S(m=m) annotation (Placement( | ||
| transformation( | ||
| extent={{-10,-10},{10,10}}, | ||
| rotation=270, | ||
| origin={40,-60}))); | ||
| Modelica.Electrical.Analog.Basic.Ground ground4 | ||
| annotation (Placement(transformation(extent={{30,-100},{50,-80}}))); | ||
| Modelica.Electrical.Polyphase.Basic.Resistor resistor4(m=m, R=fill(R, m)) | ||
| annotation (Placement(transformation(extent={{80,-30},{100,-10}}))); | ||
| Modelica.Electrical.Polyphase.Basic.Inductor | ||
| inductor4(m=m, L=fill(L, m), | ||
| iL(start={0,0,0}, fixed={true,true,true})) | ||
| annotation (Placement(transformation(extent={{-10,-10},{10,10}}, | ||
| rotation=270, | ||
| origin={110,-30}))); | ||
| Modelica.Electrical.Polyphase.Basic.Star star4L(m=m) annotation (Placement( | ||
| transformation( | ||
| extent={{-10,-10},{10,10}}, | ||
| rotation=270, | ||
| origin={110,-60}))); | ||
| Modelica.Electrical.Analog.Sensors.CurrentSensor i11 | ||
| annotation (Placement(transformation(extent={{-58,72},{-42,88}}))); | ||
| Modelica.Electrical.Analog.Sensors.CurrentSensor i12 | ||
| annotation (Placement(transformation(extent={{-58,52},{-42,68}}))); | ||
| Modelica.Electrical.Analog.Sensors.CurrentSensor i13 | ||
| annotation (Placement(transformation(extent={{-58,32},{-42,48}}))); | ||
| Modelica.Electrical.Analog.Sensors.CurrentSensor i21 | ||
| annotation (Placement(transformation(extent={{-58,-28},{-42,-12}}))); | ||
| Modelica.Electrical.Analog.Sensors.CurrentSensor i22 | ||
| annotation (Placement(transformation(extent={{-58,-48},{-42,-32}}))); | ||
| Modelica.Electrical.Analog.Sensors.CurrentSensor i23 | ||
| annotation (Placement(transformation(extent={{-58,-68},{-42,-52}}))); | ||
| Modelica.Electrical.Analog.Sensors.CurrentSensor i20 | ||
| annotation (Placement(transformation(extent={{-42,-88},{-58,-72}}))); | ||
| Modelica.Electrical.Polyphase.Sensors.CurrentSensor i3(m=m) | ||
| annotation (Placement(transformation(extent={{50,70},{70,90}}))); | ||
| Modelica.Electrical.Polyphase.Sensors.CurrentSensor i4(m=m) | ||
| annotation (Placement(transformation(extent={{50,-30},{70,-10}}))); | ||
| Modelica.Electrical.Analog.Sensors.CurrentSensor i40 | ||
| annotation (Placement(transformation(extent={{70,-80},{50,-60}}))); | ||
| equation | ||
| connect(resistor13.n, inductor13.p) | ||
| annotation (Line(points={{-10,40},{0,40}}, color={0,0,255})); | ||
| connect(resistor12.n, inductor12.p) | ||
| annotation (Line(points={{-10,60},{0,60}}, color={0,0,255})); | ||
| connect(resistor11.n, inductor11.p) | ||
| annotation (Line(points={{-10,80},{0,80}}, color={0,0,255})); | ||
| connect(inductor11.n, inductor12.n) annotation (Line(points={{20,80},{20,60}}, | ||
| color={0,0,255})); | ||
| connect(inductor13.n, inductor12.n) annotation (Line(points={{20,40},{20,60}}, | ||
| color={0,0,255})); | ||
| connect(ground1.p, sineVoltage12.n) | ||
| annotation (Line(points={{-90,20},{-90,60}}, color={0,0,255})); | ||
| connect(resistor23.n, inductor23.p) | ||
| annotation (Line(points={{-10,-60},{0,-60}}, color={0,0,255})); | ||
| connect(resistor22.n, inductor22.p) | ||
| annotation (Line(points={{-10,-40},{0,-40}}, color={0,0,255})); | ||
| connect(resistor21.n, inductor21.p) | ||
| annotation (Line(points={{-10,-20},{0,-20}}, color={0,0,255})); | ||
| connect(resistor3.plug_n, inductor3.plug_p) | ||
| annotation (Line(points={{100,80},{110,80}}, | ||
| color={0,0,255})); | ||
| connect(inductor3.plug_n, star3L.plug_p) | ||
| annotation (Line(points={{110,60},{110,50}}, color={0,0,255})); | ||
| connect(sineVoltage3.plug_n, star3S.plug_p) | ||
| annotation (Line(points={{40,60},{40,50}}, color={0,0,255})); | ||
| connect(star3S.pin_n, ground3.p) | ||
| annotation (Line(points={{40,30},{40,20}}, color={0,0,255})); | ||
| connect(resistor4.plug_n,inductor4. plug_p) | ||
| annotation (Line(points={{100,-20},{110,-20}}, | ||
| color={0,0,255})); | ||
| connect(inductor4.plug_n, star4L.plug_p) | ||
| annotation (Line(points={{110,-40},{110,-50}}, color={0,0,255})); | ||
| connect(sineVoltage4.plug_n, star4S.plug_p) | ||
| annotation (Line(points={{40,-40},{40,-50}}, color={0,0,255})); | ||
| connect(star4S.pin_n, ground4.p) | ||
| annotation (Line(points={{40,-70},{40,-80}}, color={0,0,255})); | ||
| connect(sineVoltage11.p, i11.p) | ||
| annotation (Line(points={{-70,80},{-58,80}}, color={0,0,255})); | ||
| connect(i11.n, resistor11.p) | ||
| annotation (Line(points={{-42,80},{-30,80}}, color={0,0,255})); | ||
| connect(sineVoltage13.p, i13.p) | ||
| annotation (Line(points={{-70,40},{-58,40}}, color={0,0,255})); | ||
| connect(i13.n, resistor13.p) | ||
| annotation (Line(points={{-42,40},{-30,40}}, color={0,0,255})); | ||
| connect(sineVoltage12.p, i12.p) | ||
| annotation (Line(points={{-70,60},{-58,60}}, color={0,0,255})); | ||
| connect(i12.n, resistor12.p) | ||
| annotation (Line(points={{-42,60},{-30,60}}, color={0,0,255})); | ||
| connect(sineVoltage21.p, i21.p) | ||
| annotation (Line(points={{-70,-20},{-58,-20}}, color={0,0,255})); | ||
| connect(i21.n, resistor21.p) | ||
| annotation (Line(points={{-42,-20},{-30,-20}}, color={0,0,255})); | ||
| connect(sineVoltage22.p, i22.p) | ||
| annotation (Line(points={{-70,-40},{-58,-40}}, color={0,0,255})); | ||
| connect(i22.n, resistor22.p) | ||
| annotation (Line(points={{-42,-40},{-30,-40}}, color={0,0,255})); | ||
| connect(sineVoltage23.p, i23.p) | ||
| annotation (Line(points={{-70,-60},{-58,-60}}, color={0,0,255})); | ||
| connect(i23.n, resistor23.p) | ||
| annotation (Line(points={{-42,-60},{-30,-60}}, color={0,0,255})); | ||
| connect(ground2.p, i20.n) | ||
| annotation (Line(points={{-90,-80},{-58,-80}}, color={0,0,255})); | ||
| connect(i20.p, inductor22.n) | ||
| annotation (Line(points={{-42,-80},{20,-80},{20,-40}}, color={0,0,255})); | ||
| connect(resistor3.plug_p, i3.plug_n) | ||
| annotation (Line(points={{80,80},{70,80}}, color={0,0,255})); | ||
| connect(i3.plug_p, sineVoltage3.plug_p) | ||
| annotation (Line(points={{50,80},{40,80}}, color={0,0,255})); | ||
| connect(resistor4.plug_p, i4.plug_n) | ||
| annotation (Line(points={{80,-20},{70,-20}}, color={0,0,255})); | ||
| connect(i4.plug_p, sineVoltage4.plug_p) | ||
| annotation (Line(points={{50,-20},{40,-20}}, color={0,0,255})); | ||
| connect(star4S.pin_n, i40.n) | ||
| annotation (Line(points={{40,-70},{50,-70}}, color={0,0,255})); | ||
| connect(i40.p, star4L.pin_n) | ||
| annotation (Line(points={{70,-70},{110,-70}}, color={0,0,255})); | ||
| connect(ground1.p, sineVoltage11.n) | ||
| annotation (Line(points={{-90,20},{-90,80}}, color={0,0,255})); | ||
| connect(i20.p, inductor23.n) | ||
| annotation (Line(points={{-42,-80},{20,-80},{20,-60}}, color={0,0,255})); | ||
| connect(i20.p, inductor21.n) | ||
| annotation (Line(points={{-42,-80},{20,-80},{20,-20}}, color={0,0,255})); | ||
| connect(ground2.p, sineVoltage21.n) | ||
| annotation (Line(points={{-90,-80},{-90,-20}}, color={0,0,255})); | ||
| connect(ground2.p, sineVoltage22.n) | ||
| annotation (Line(points={{-90,-80},{-90,-40}}, color={0,0,255})); | ||
| connect(ground2.p, sineVoltage23.n) | ||
| annotation (Line(points={{-90,-80},{-90,-60}}, color={0,0,255})); | ||
| connect(ground1.p, sineVoltage13.n) | ||
| annotation (Line(points={{-90,20},{-90,40}}, color={0,0,255})); | ||
| annotation (preferredView="info", | ||
| Diagram(coordinateSystem(extent={{-100,-100},{120,100}})), | ||
| experiment( | ||
| StopTime=0.1, | ||
| Interval=0.0001), | ||
| Documentation(info="<html> | ||
| <p> | ||
| Proper initialization of polyphase systems require an analysis of the circuit, helping to decide | ||
| how many states and which states should be initialized with <code>fixed=true</code> (or <code>fixed=false</code>). | ||
| </p> | ||
| <p> | ||
| This examples demonstrates the initialization of threephase inductances in a 3 wire and a 4 wire system: | ||
AHaumer marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </p> | ||
| <p> | ||
| In the 3 wire system the implicit equation <code>i11 + i12 + i13 = 0</code> has to be taken into account. <br> | ||
| Therefore only 2 of the 3 currents may be initialized with <code>fixed=true</code>. | ||
| With the polyphase component, the initial values have to be set accordingly. e.g.:<br> | ||
| <code> Inductor inductor(m=3, iL(start={0, 0, 0}, fixed={true, true, false}))</code> | ||
AHaumer marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </p> | ||
| <p> | ||
| In the 4 wire system the implicit equation <code>i21 + i22 + i23 = i20</code> has to be taken into account. <br> | ||
| Therefore all 3 currents may be initialized with <code>fixed=true</code>. | ||
| With the polyphase component, the initial values have to be set accordingly, e.g.:<br> | ||
| <code> Inductor inductor(m=3, iL(start={0, 0, 0}, fixed={true, true, true }));</code> | ||
| </p> | ||
| <p> | ||
| It depends on the tool whether you have to set the <code>fixed</code> attribute textually or graphically. | ||
christiankral marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </p> | ||
| </html>"), | ||
| Icon(coordinateSystem(extent={{-100,-100},{120,100}}))); | ||
AHaumer marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| end PolyphaseInitialization; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,4 +3,5 @@ TransformerYD | |
| Rectifier | ||
| TestSensors | ||
| PolyphaseRectifier | ||
| PolyphaseInitialization | ||
| Utilities | ||
15 changes: 15 additions & 0 deletions
15
...ence/Modelica/Electrical/Polyphase/Examples/PolyphaseInitialization/comparisonSignals.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| time | ||
| i11.i | ||
| i12.i | ||
| i13.i | ||
| i21.i | ||
| i22.i | ||
| i23.i | ||
| i20.i | ||
| i3.i[1] | ||
| i3.i[2] | ||
| i3.i[3] | ||
| i4.i[1] | ||
| i4.i[2] | ||
| i4.i[3] | ||
| i40.i |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.