Skip to content

Commit bce24db

Browse files
committed
Merge remote-tracking branch 'central/master' into testonly-moistair-unit-error
2 parents 96589ae + 10bae7f commit bce24db

216 files changed

Lines changed: 3225 additions & 2211 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.CI/check_deprecated_line_color.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33

44
'''
5-
Copyright (C) 2021, Modelica Association and contributors
5+
Copyright (C) 2021-2023, Modelica Association and contributors
66
All rights reserved.
77
88
Check for deprecated Text.lineColor annotation
@@ -13,7 +13,7 @@
1313
import re
1414
import sys
1515

16-
PATTERN = re.compile(r'(Text\s*\([^\).]*)lineColor')
16+
PATTERN = re.compile(r'(?:Text\s*\([^\)]*?(?:\"(?:\\.|[^\"])*\")?[^\)]*?)(lineColor)')
1717

1818
def _checkDeprecatedFileLineColor(file_name):
1919
errors = 0

.github/workflows/checkCI.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
timeout-minutes: 5
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v3
1111
with:
1212
fetch-depth: 5
1313
- name: Build libraries
@@ -34,11 +34,11 @@ jobs:
3434
timeout-minutes: 5
3535
runs-on: ubuntu-latest
3636
steps:
37-
- uses: actions/checkout@v2
37+
- uses: actions/checkout@v3
3838
with:
3939
fetch-depth: 5
4040
- name: Setup python environment
41-
uses: actions/setup-python@v2
41+
uses: actions/setup-python@v4
4242
with:
4343
python-version: 3.8
4444
- name: Install python packages
@@ -68,7 +68,7 @@ jobs:
6868
timeout-minutes: 5
6969
runs-on: ubuntu-latest
7070
steps:
71-
- uses: actions/checkout@v2
71+
- uses: actions/checkout@v3
7272
with:
7373
fetch-depth: 5
7474
- name: Get moparser
@@ -86,11 +86,11 @@ jobs:
8686
timeout-minutes: 5
8787
runs-on: ubuntu-latest
8888
steps:
89-
- uses: actions/checkout@v2
89+
- uses: actions/checkout@v3
9090
with:
9191
fetch-depth: 5
9292
- name: Setup python environment
93-
uses: actions/setup-python@v2
93+
uses: actions/setup-python@v4
9494
with:
9595
python-version: 3.8
9696
- name: Check deprecated Text.lineColor annotation

.github/workflows/checkCron.yml

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111
if: github.repository_owner == 'modelica'
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3
1515
with:
1616
fetch-depth: 5
1717
- name: Setup python environment
18-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@v4
1919
with:
2020
python-version: 3.8
2121
- name: Install python packages
@@ -28,37 +28,61 @@ jobs:
2828
if: github.repository_owner == 'modelica'
2929
runs-on: ubuntu-latest
3030
steps:
31-
- uses: actions/checkout@v2
31+
- uses: actions/checkout@v3
3232
with:
3333
fetch-depth: 5
3434
- name: Setup python environment
35-
uses: actions/setup-python@v2
35+
uses: actions/setup-python@v4
3636
with:
3737
python-version: 3.8
3838
- name: Install python packages
39-
run: pip install --user codespell
39+
run: pip install --disable-pip-version-check --user codespell
4040
- name: Check for spelling errors
4141
run: |
4242
printf "[codespell]\nenable-colors=\n" >> .codespellrc
43+
codespell -L additionals,inport,manuel ./Modelica/package.mo
44+
codespell -L bu,nin ./Modelica/Clocked/RealSignals/Periodic/StateSpace.mo
4345
codespell -L mesures ./Modelica/Constants.mo
4446
codespell -L nin,inport,fo ./Modelica/StateGraph.mo
4547
codespell -L addd,nd,nin ./Modelica/Blocks/Continuous.mo
4648
codespell -L utput ./Modelica/Electrical/Digital.mo
4749
codespell -L ser ./Modelica/Electrical/Polyphase/Examples/PolyphaseRectifier.mo
4850
codespell -L ser ./Modelica/Electrical/Polyphase/Examples/Utilities/PolyphaseRectifierData.mo
51+
codespell -L manuel ./Modelica/Fluid/package.mo
4952
codespell -L pres ./Modelica/Fluid/Dissipation.mo
50-
codespell -L fo,alo,als,cacl,ba,nd ./Modelica/Media/IdealGases/package.mo
51-
codespell -L fo,alo,als,cacl,ba,nd,alow ./Modelica/Media/IdealGases/Common/SingleGasesData.mo
53+
codespell -L manuel ./Modelica/Fluid/Vessels.mo
54+
codespell -L manuel,nin,inport ./Modelica/Fluid/Examples/AST_BatchPlant.mo
55+
codespell -L fo,alo,als,cacl,ba,nd,ges,caf,inh ./Modelica/Media/IdealGases/package.mo
56+
codespell -L fo,alo,als,cacl,ba,nd,alow,ges,caf,inh ./Modelica/Media/IdealGases/Common/SingleGasesData.mo
5257
codespell -L alow ./Modelica/Media/IdealGases/Common/Functions.mo
5358
codespell -L alow ./Modelica/Media/IdealGases/Common/package.mo
54-
codespell -L dout ./Modelica/Media/Water/IF97_Utilities.mo
59+
codespell -L delt ./Modelica/Media/Air/ReferenceAir.mo
60+
codespell -L scrit,delt ./Modelica/Media/R134a.mo
61+
codespell -L dout,scrit,delt ./Modelica/Media/Water/IF97_Utilities.mo
5562
codespell -L archiv ./Modelica/Electrical/Polyphase/UsersGuide/References.mo
63+
codespell -L additionals,vie ./Modelica/Electrical/Spice3.mo
64+
codespell -L vai ./Modelica/Electrical/Machines/BasicMachines/Components/PartialAirGapDC.mo
5665
codespell -L mot ./Modelica/Electrical/Machines/Examples/ControlledDCDrives
5766
codespell -L singal ./Modelica/Electrical/Analog/UsersGuide/References.mo
5867
codespell -L numer ./Modelica/Math/package.mo
59-
codespell -L inport,nd,wit ./Modelica/Mechanics/Rotational
68+
codespell -L inport,nd,supportt,wit ./Modelica/Mechanics/Rotational
6069
codespell -L wit ./Modelica/Mechanics/Translational
6170
codespell -L ist ./Modelica/Mechanics/MultiBody
6271
codespell -L klick ./Modelica/Magnetic/FluxTubes/UsersGuide/Contact.mo
72+
codespell -L nife ./Modelica/Magnetic/FluxTubes/Material/SoftMagnetic/NickelIron
6373
codespell -L technik ./Modelica/Magnetic/FundamentalWave/UsersGuide/References.mo
64-
codespell --skip ./ObsoleteModelica4.mo,./Modelica/Constants.mo,./Modelica/Blocks/Continuous.mo,./Modelica/StateGraph.mo,./Modelica/Electrical/Digital.mo,./Modelica/Electrical/Polyphase/Examples/PolyphaseRectifier.mo,./Modelica/Electrical/Polyphase/Examples/Utilities/PolyphaseRectifierData.mo,./Modelica/Fluid/Dissipation.mo,./Modelica/Resources,./Modelica/Media/IdealGases/package.mo,./Modelica/Media/IdealGases/Common/SingleGasesData.mo,./Modelica/Media/IdealGases/Common/Functions.mo,./Modelica/Media/IdealGases/Common/package.mo,./Modelica/Media/Water/IF97_Utilities.mo,./Modelica/Electrical/Polyphase/UsersGuide/References.mo,./Modelica/Electrical/Machines/Examples/ControlledDCDrives,./Modelica/Electrical/Analog/UsersGuide/References.mo,./Modelica/Math/package.mo,./Modelica/Mechanics/Rotational,./Modelica/Mechanics/Translational,./Modelica/Mechanics/MultiBody,./Modelica/Magnetic/FluxTubes/UsersGuide/Contact.mo,./Modelica/Magnetic/FundamentalWave/UsersGuide/References.mo,./.CI,./.github,./.git,*.png -L nin,inport,te,sinc,vie,commutating
74+
codespell -L supportt ./ModelicaTest/Rotational.mo
75+
codespell -L lamda,inport ./ModelicaTestConversion4.mo
76+
codespell --skip ./ObsoleteModelica4.mo,./Modelica/package.mo,./Modelica/Clocked/RealSignals/Periodic/StateSpace.mo,./Modelica/Constants.mo,./Modelica/Blocks/Continuous.mo,./Modelica/StateGraph.mo,./Modelica/Electrical/Digital.mo,./Modelica/Electrical/Polyphase/Examples/PolyphaseRectifier.mo,./Modelica/Electrical/Polyphase/Examples/Utilities/PolyphaseRectifierData.mo,./Modelica/Fluid/package.mo,./Modelica/Fluid/Dissipation.mo,./Modelica/Fluid/Vessels.mo,./Modelica/Fluid/Examples/AST_BatchPlant.mo,./Modelica/Resources,./Modelica/Media/IdealGases/package.mo,./Modelica/Media/IdealGases/Common/SingleGasesData.mo,./Modelica/Media/IdealGases/Common/Functions.mo,./Modelica/Media/IdealGases/Common/package.mo,./Modelica/Media/Air/ReferenceAir.mo,./Modelica/Media/R134a.mo,./Modelica/Media/Water/IF97_Utilities.mo,./Modelica/Electrical/Polyphase/UsersGuide/References.mo,./Modelica/Electrical/Spice3.mo,./Modelica/Electrical/Machines/BasicMachines/Components/PartialAirGapDC.mo,./Modelica/Electrical/Machines/Examples/ControlledDCDrives,./Modelica/Electrical/Analog/UsersGuide/References.mo,./Modelica/Math/package.mo,./Modelica/Mechanics/Rotational,./Modelica/Mechanics/Translational,./Modelica/Mechanics/MultiBody,./Modelica/Magnetic/FluxTubes/UsersGuide/Contact.mo,./Modelica/Magnetic/FluxTubes/Material/SoftMagnetic/NickelIron,./Modelica/Magnetic/FundamentalWave/UsersGuide/References.mo,./ModelicaTest/Rotational.mo,./ModelicaTestConversion4.mo,./.CI,./.github,./.git,*.png -L nin,inport,te,sinc,vie,commutating
77+
clean_workflow_runs:
78+
timeout-minutes: 5
79+
if: github.repository_owner == 'modelica'
80+
runs-on: ubuntu-latest
81+
steps:
82+
- name: Delete workflow runs
83+
uses: dmvict/clean-workflow-runs@v1
84+
with:
85+
run_conclusions: skipped,success
86+
save_period: 90
87+
save_min_runs_number: 25
88+
dry: false

.github/workflows/generateReleaseNotes.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ jobs:
1717
timeout-minutes: 5
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v3
2121
with:
2222
fetch-depth: 5
2323
- name: Setup python environment
24-
uses: actions/setup-python@v2
24+
uses: actions/setup-python@v4
2525
with:
2626
python-version: 3.8
2727
- name: Install python packages
2828
run: pip install --user requests
2929
- name: Generate MSL release notes from closed GitHub issues
3030
timeout-minutes: 3
3131
run: python ./Modelica/Resources/Documentation/Generate-ReleaseNotes.py ${{ github.event.inputs.milestone }} ${{ github.event.inputs.version }}
32-
- uses: actions/upload-artifact@v2
32+
- uses: actions/upload-artifact@v3
3333
with:
3434
name: ResolvedGitHubIssues-Version-${{ github.event.inputs.version }}
3535
path: ./Modelica/Resources/Documentation/Version-${{ github.event.inputs.version }}/

.mailmap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Anton Haumer <ahaumer@7ce873d0-865f-4ce7-a662-4bb36ea78beb>
1313
Anton Haumer <anton.haumer@gmail.com>
1414
Anton Haumer <anton.haumer@oth-regensburg.de>
1515
Antonio Froio <antonio.froio39@gmail.com>
16+
Arunkumar Narasimhan <124154466+arunkumar-narasimhan@users.noreply.github.com>
17+
Arunkumar Narasimhan <arunkumar.narasimhan@modelon.com>
1618
Bernhard Thiele <bernhard.thiele@dlr.de>
1719
Bernhard Thiele <thiele@7ce873d0-865f-4ce7-a662-4bb36ea78beb>
1820
Bruno Scaglioni <bruno.scaglioni@7ce873d0-865f-4ce7-a662-4bb36ea78beb>
@@ -69,7 +71,9 @@ Kristin Majetta <majetta@7ce873d0-865f-4ce7-a662-4bb36ea78beb>
6971
Leo Gall <leo.gall@7ce873d0-865f-4ce7-a662-4bb36ea78beb>
7072
Leo Gall <leo.gall@ltx.de>
7173
Leo Zambito <lzambito@maplesoft.com>
74+
Luigi Vanfretti <luigi.vanfretti@gmail.com>
7275
Malte Lenz <maltel@wolfram.com>
76+
Manikantan Thiyagarajan <124235109+TManikantan@users.noreply.github.com>
7377
Marco Kessler <marco.kessler@3ds.com>
7478
Marcus Baur <baur_ma@7ce873d0-865f-4ce7-a662-4bb36ea78beb>
7579
Martin Otter <Martin.Otter@dlr.de>
@@ -95,6 +99,8 @@ Per Östlund <perost86@gmail.com>
9599
Peter Harman <peter.harman@deltatheta.com>
96100
Peter Harman <pharman@7ce873d0-865f-4ce7-a662-4bb36ea78beb>
97101
Philip Jordan <pjordan@7ce873d0-865f-4ce7-a662-4bb36ea78beb>
102+
Quentin Lambert <quentinl@wolfram.com>
103+
Rüdiger Franke <rdgfranke@gmail.com>
98104
Rüdiger Franke <rfranke@7ce873d0-865f-4ce7-a662-4bb36ea78beb>
99105
Stefan Vorkoetter <svorkoetter@maplesoft.com>
100106
Stefan Wischhusen <wischhusen@7ce873d0-865f-4ce7-a662-4bb36ea78beb>

Modelica/Blocks/Continuous.mo

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ This is discussed in the description of package
598598
textString="T=%T")}));
599599
end PI;
600600

601-
block PID "PID-controller in additive description form"
601+
block PID "PID controller in additive description form"
602602
import Modelica.Blocks.Types.Init;
603603
extends Interfaces.SISO;
604604

@@ -689,8 +689,8 @@ This is discussed in the description of package
689689
textString="Ti=%Ti")}),
690690
Documentation(info="<html>
691691
<p>
692-
This is the text-book version of a PID-controller.
693-
For a more practically useful PID-controller, use
692+
This is the text-book version of a PID controller.
693+
For a more practically useful PID controller, use
694694
block LimPID.
695695
</p>
696696
@@ -765,7 +765,7 @@ to compute u by an algebraic equation.
765765
"Control error (set point - measurement)";
766766
parameter .Modelica.Blocks.Types.SimpleController controllerType=
767767
.Modelica.Blocks.Types.SimpleController.PID "Type of controller";
768-
parameter Real k(min=0) = 1 "Gain of controller";
768+
parameter Real k = 1 "Gain of controller, must be non-zero";
769769
parameter SI.Time Ti(min=Modelica.Constants.small)=0.5
770770
"Time constant of Integrator block" annotation (Dialog(enable=
771771
controllerType == .Modelica.Blocks.Types.SimpleController.PI or
@@ -881,6 +881,7 @@ to compute u by an algebraic equation.
881881
gainPID.y = y_start;
882882
end if;
883883
equation
884+
assert(abs(k) >= Modelica.Constants.small, "Controller gain must be non-zero.");
884885
if initType == Init.InitialOutput and (y_start < yMin or y_start > yMax) then
885886
Modelica.Utilities.Streams.error("LimPID: Start value y_start (=" + String(y_start) +
886887
") is outside of the limits of yMin (=" + String(yMin) +") and yMax (=" + String(yMax) + ")");
@@ -1011,18 +1012,18 @@ together) and using the following strategy:
10111012
10121013
<ol>
10131014
<li> Set very large limits, e.g., yMax = Modelica.Constants.inf</li>
1014-
<li> Select a <strong>P</strong>-controller and manually enlarge parameter <strong>k</strong>
1015+
<li> Select a <strong>P</strong> controller and manually enlarge parameter <strong>k</strong>
10151016
(the total gain of the controller) until the closed-loop response
10161017
cannot be improved any more.</li>
1017-
<li> Select a <strong>PI</strong>-controller and manually adjust parameters
1018+
<li> Select a <strong>PI</strong> controller and manually adjust parameters
10181019
<strong>k</strong> and <strong>Ti</strong> (the time constant of the integrator).
10191020
The first value of Ti can be selected, such that it is in the
10201021
order of the time constant of the oscillations occurring with
1021-
the P-controller. If, e.g., vibrations in the order of T=10 ms
1022+
the P controller. If, e.g., vibrations in the order of T=10 ms
10221023
occur in the previous step, start with Ti=0.01 s.</li>
10231024
<li> If you want to make the reaction of the control loop faster
10241025
(but probably less robust against disturbances and measurement noise)
1025-
select a <strong>PID</strong>-Controller and manually adjust parameters
1026+
select a <strong>PID</strong> controller and manually adjust parameters
10261027
<strong>k</strong>, <strong>Ti</strong>, <strong>Td</strong> (time constant of derivative block).</li>
10271028
<li> Set the limits yMax and yMin according to your specification.</li>
10281029
<li> Perform simulations such that the output of the PID controller
@@ -1968,8 +1969,7 @@ The filters are implemented in the following, reliable way:
19681969
19691970
<p>
19701971
The development of this block was partially funded by BMBF within the
1971-
<a href=\"http://www.eurosyslib.com/\">ITEA2 EUROSYSLIB</a>
1972-
project.
1972+
ITEA <a href=\"https://itea4.org/project/eurosyslib.html\">EUROSYSLIB</a> research project.
19731973
</p>
19741974
19751975
</html>"));

Modelica/Blocks/Discrete.mo

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ package Discrete
55
extends Modelica.Icons.Package;
66

77
block Sampler "Ideal sampling of continuous signals"
8-
extends Interfaces.DiscreteSISO;
8+
extends Interfaces.DiscreteSISO(y(start=0, fixed=true));
99

1010
equation
1111
when {sampleTrigger, initial()} then
12-
y = u;
12+
y = if time>=startTime then u else pre(y);
1313
end when;
1414
annotation (
1515
Icon(
@@ -44,7 +44,7 @@ via parameter <strong>samplePeriod</strong>.
4444

4545
equation
4646
when {sampleTrigger, initial()} then
47-
ySample = u;
47+
ySample = if time>=startTime then u else pre(ySample);
4848
end when;
4949
/* Define y=ySample with an infinitesimal delay to break potential
5050
algebraic loops if both the continuous and the discrete part have
@@ -407,7 +407,7 @@ the initial value defined via parameter <strong>y0</strong>.
407407
Line(points={{-35.0,0.0},{28.0,-48.0}},
408408
color={0,0,127}),
409409
Text(extent={{-86.0,24.0},{82.0,82.0}},
410-
color={0,0,127},
410+
textColor={0,0,127},
411411
textString="max"),
412412
Ellipse(lineColor={0,0,127},
413413
fillColor={255,255,255},

Modelica/Blocks/Math.mo

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2335,29 +2335,31 @@ Note: The output is updated after each period defined by 1/f.
23352335
block ContinuousMean
23362336
"Calculates the empirical expectation (mean) value of its input signal"
23372337
extends Modelica.Blocks.Icons.Block;
2338-
parameter SI.Time t_eps(min= 100*Modelica.Constants.eps)=1e-7
2338+
parameter SI.Time t_eps(min= 0)=1e-7
23392339
"Mean value calculation starts at startTime + t_eps"
23402340
annotation(Dialog(group="Advanced"));
23412341

23422342
Modelica.Blocks.Interfaces.RealInput u "Noisy input signal" annotation (Placement(transformation(extent={{-140,-20},{-100,20}})));
23432343
Modelica.Blocks.Interfaces.RealOutput y
23442344
"Expectation (mean) value of the input signal"
23452345
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
2346-
2346+
parameter Real startTime=-Modelica.Constants.inf "Starting point for mean if after simulation start-point";
23472347
protected
2348-
Real mu "Internal integrator variable";
2348+
Real mu(start=0, fixed=true) "Internal integrator variable";
23492349
parameter Real t_0(fixed=false) "Start time";
2350+
parameter Real actualStartTime=max(t_0, startTime);
23502351
initial equation
23512352
t_0 = time;
2352-
mu = u;
23532353
equation
2354-
der(mu) = noEvent(if time >= t_0 + t_eps then (u-mu)/(time-t_0) else 0);
2355-
y = noEvent(if time >= t_0 + t_eps then mu else u);
2354+
der(mu) = if time >= actualStartTime then u else 0;
2355+
y = noEvent(if time > actualStartTime+t_eps then mu/(time-actualStartTime) else u);
23562356

23572357
annotation (Documentation(revisions="<html>
23582358
<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">
23592359
<tr><th>Date</th> <th align=\"left\">Description</th></tr>
2360-
2360+
<tr><td> June 13, 2023</td>
2361+
<td>Hans Olsson. Avoid almost singularity for integrators.</td>
2362+
</tr>
23612363
<tr><td> June 22, 2015 </td>
23622364
<td>
23632365
@@ -2380,8 +2382,8 @@ y = ------------------------
23802382
time - startTime
23812383
</pre></blockquote>
23822384
<p>This can be used to determine the empirical expectation value of a random signal, such as generated by the <a href=\"modelica://Modelica.Blocks.Noise\">Noise</a> blocks.</p>
2383-
<p>The parameter t_eps is used to guard against division by zero (the mean value computation
2384-
starts at &lt;<em>simulation start time</em>&gt; + t_eps and before that time instant y = u).</p>
2385+
<p>The parameter t_eps is used to avoid large fluctuations but can be set to zero (the mean value computation
2386+
starts at &lt;<em>simulation start time</em>&gt; but is only returned after an additional t_eps and before that time instant y = u).</p>
23852387
<p>See also the <a href=\"modelica://Modelica.Blocks.Math.Mean\">Mean</a> block for a sampled implementation.</p>
23862388
23872389
<p>

0 commit comments

Comments
 (0)