Skip to content

Commit

Permalink
Merge branch 'OpAmpsSignalGenerator' of https://github.com/AHaumer/Mo…
Browse files Browse the repository at this point in the history
…delicaStandardLibrary into OpAmpsSignalGenerator
  • Loading branch information
AHaumer committed Jan 10, 2025
2 parents 5a45f29 + c969546 commit 3e0b6c8
Show file tree
Hide file tree
Showing 14 changed files with 676 additions and 466 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/checkCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
cmake --build build -- -j8
fi
- name: Run tests
run: ctest --test-dir build --build-config ${{ matrix.configuration }} --verbose
run: ctest --no-tests=error --test-dir build --build-config ${{ matrix.configuration }} --verbose

external_c_checks_cmake_cygwin:
name: external_c_checks_cmake_windows-cygwin
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
- name: Run tests
run: |
export PATH=/usr/bin:$PATH
ctest --test-dir build --build-config Debug --verbose
ctest --no-tests=error --test-dir build --build-config Debug --verbose
shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}'

html_documentation_checks:
Expand Down
2 changes: 2 additions & 0 deletions Modelica/Electrical/Polyphase/Basic/Capacitor.mo
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ model Capacitor "Ideal linear electrical capacitors"
extends Interfaces.TwoPlug;
parameter SI.Capacitance C[m](start=fill(1, m))
"Capacitance";
SI.Voltage vC[m](start=zeros(m), fixed=fill(false,m))=v "Capacitor voltages"
annotation(Dialog(showStartAttribute=true));
Modelica.Electrical.Analog.Basic.Capacitor capacitor[m](final C=C)
annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
equation
Expand Down
2 changes: 2 additions & 0 deletions Modelica/Electrical/Polyphase/Basic/Inductor.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ within Modelica.Electrical.Polyphase.Basic;
model Inductor "Ideal linear electrical inductors"
extends Interfaces.TwoPlug;
parameter SI.Inductance L[m](start=fill(1, m)) "Inductance";
SI.Current iL[m](start=zeros(m), fixed=fill(false,m))=i "Inductor currents"
annotation(Dialog(showStartAttribute=true));
Modelica.Electrical.Analog.Basic.Inductor inductor[m](final L=L)
annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
equation
Expand Down
36 changes: 27 additions & 9 deletions Modelica/Electrical/Polyphase/Examples/TransformerYY.mo
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ model TransformerYY "Test example with polyphase components"
transformation(extent={{-30,-100},{-10,-80}})));
Basic.Resistor transformerR(m=m, R=fill(RT, m)) annotation (Placement(
transformation(extent={{0,10},{20,30}})));
Basic.Inductor transformerL(m=m, L=fill(LT, m)) annotation (Placement(
Basic.Inductor transformerL(m=m, L=fill(LT, m),
iL(start=zeros(m), fixed=cat(1,fill(true,m-1),{false}))) annotation (Placement(
transformation(extent={{30,10},{50,30}})));
Basic.Resistor loadR(m=m, R=fill(RL, m)) annotation (Placement(
transformation(extent={{70,10},{90,30}})));
Expand All @@ -50,9 +51,6 @@ model TransformerYY "Test example with polyphase components"
rotation=270)));
Modelica.Electrical.Analog.Basic.Ground groundT1 annotation (Placement(
transformation(extent={{-50,-100},{-30,-80}})));
initial equation
transformerL.i[1:m - 1] = zeros(m - 1) "Y-connection";

equation
connect(starS.pin_n, groundS.p)
annotation (Line(points={{-90,-72},{-90,-80}}, color={0,0,255}));
Expand All @@ -77,12 +75,32 @@ equation
connect(loadR.plug_n, starL.plug_p)
annotation (Line(points={{90,20},{90,-52}}, color={0,0,255}));
annotation (Documentation(info="<html>
<p>Test example with polyphase components:</p>
<p>Star-connected voltage source feeds via a Y-Y-transformer with internal impedance (RT, LT) a load resistor RT.</p>
<p>Using f=5 Hz LT=3mH defines nominal voltage drop of approximately 10 &percnt;.</p>
<p>Simulate for 1 second (2 periods) and compare voltages and currents of source, transformer and load. </p>
<h4>Note</h4>
<p>
Test example with polyphase components:<br>
Star-connected voltage source feeds via a Y-Y-transformer with internal impedance (RT, LT) a load resistor RT.<br>
Using f=5 Hz LT=3mH defines nominal voltage drop of approximately 10 %.<br>
Simulate for 1 second (2 periods) and compare voltages and currents of source, transformer and load.
From the <code>m</code> currents <code>m-1</code> have to be initialized with fixed = true, one of the <code>m</code> currents with fixed = false,
due to the fact that the star connection enforces sum of the currents = 0.
</p>
<p>
Tools are expected to present a proper initialization section of the menu of <code>transformerL</code> which allows
to set the start values of the <code>m</code> currents and the fixed attributes individually, i.e. as an array.
Especially, a checkbox for the fixed attributes should be avoided.
</p>
<p>
If this is not the case, you have to write the code manually:
</p>
<p><code>
Modelica.Electrical.PolyPhase.Basic.Inductor transformerL(m=m, L=fill(LT, m),
<strong>iL(start=zeros(m), fixed=cat(1,fill(true,m-1),{false}))</strong>);</code>
</p>
</html>"),
experiment(StopTime=1.0, Interval=0.001));
experiment(StopTime=1.0, Interval=0.001),
Diagram(graphics={Text(
extent={{0,60},{80,40}},
textColor={28,108,200},
textString="Regarding initialization:
see Documentation")}));
end TransformerYY;
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ model SymmetricPolyphaseWinding
final Lsigma=(1 - ratioCommonLeakage)*Lsigma)
"Symmetric winding"
annotation (Placement(transformation(extent={{-10,-20},{10,0}})));
Modelica.Electrical.Polyphase.Basic.ZeroInductor zeroInductor(final m=m, final Lzero=Lzero) if
mBase<>2 "Zero sequence inductance of winding"
Modelica.Electrical.Polyphase.Basic.ZeroInductor zeroInductor(final m=m, final Lzero=Lzero)
if mBase<>2 "Zero sequence inductance of winding"
annotation (Placement(transformation(
origin={-70,-30},
extent={{10,-10},{-10,10}},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ model IMC_YD
TsOperational=293.15,
effectiveStatorTurns=aimcData.effectiveStatorTurns,
alpha20r=aimcData.alpha20r,
TrOperational=293.15)
TrOperational=293.15,
stator(zeroInductor(i0(nominal=10))))
annotation (Placement(transformation(extent={{20,10},{40,30}})));
Modelica.Electrical.Machines.Sensors.CurrentQuasiRMSSensor currentQuasiRMSSensor
annotation (Placement(transformation(
Expand Down Expand Up @@ -112,8 +113,8 @@ equation
points={{40,20},{50,20}}));
annotation (experiment(
StopTime=2.5,
Interval=1E-4,
Tolerance=1e-06), Documentation(
Interval=0.0001,
Tolerance=1e-06), Documentation(
info="<html>
<p>At start time tStart three-phase voltage is supplied to the induction machine with squirrel cage,
first star-connected, then delta-connected; the machine starts from standstill,
Expand Down
Loading

0 comments on commit 3e0b6c8

Please sign in to comment.