Skip to content

Commit f055a68

Browse files
authored
Merge branch 'modelica:master' into Table-extrapolation_documentation
2 parents 48714de + 83189ce commit f055a68

8 files changed

Lines changed: 36 additions & 45 deletions

File tree

.github/workflows/checkCron.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ jobs:
6161
codespell -L delt ./Modelica/Media/Air/ReferenceAir.mo
6262
codespell -L scrit,delt ./Modelica/Media/R134a.mo
6363
codespell -L dout,scrit,delt ./Modelica/Media/Water/IF97_Utilities.mo
64+
codespell -L rin ./Modelica/Electrical/Analog/Ideal/AD_Converter.mo
65+
codespell -L rin ./Modelica/Electrical/Analog/Examples/AD_DA_conversion.mo
6466
codespell -L archiv ./Modelica/Electrical/Polyphase/UsersGuide/References.mo
6567
codespell -L additionals,vie ./Modelica/Electrical/Spice3.mo
6668
codespell -L vai ./Modelica/Electrical/Machines/BasicMachines/Components/PartialAirGapDC.mo
@@ -75,7 +77,7 @@ jobs:
7577
codespell -L technik ./Modelica/Magnetic/FundamentalWave/UsersGuide/References.mo
7678
codespell -L supportt ./ModelicaTest/Rotational.mo
7779
codespell -L lamda,inport ./ModelicaTestConversion4.mo
78-
codespell --skip ./ObsoleteModelica4.mo,./Modelica/package.mo,./Modelica/UsersGuide/Contact.mo,./Modelica/UsersGuide/ReleaseNotes.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
80+
codespell --skip ./ObsoleteModelica4.mo,./Modelica/package.mo,./Modelica/UsersGuide/Contact.mo,./Modelica/UsersGuide/ReleaseNotes.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/Analog/Ideal/AD_Converter.mo,./Modelica/Electrical/Analog/Examples/AD_DA_conversion.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
7981
clean_workflow_runs:
8082
timeout-minutes: 5
8183
if: github.repository_owner == 'modelica'

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Leo Zambito <lzambito@maplesoft.com>
7979
Luigi Vanfretti <luigi.vanfretti@gmail.com>
8080
Malte Lenz <maltel@wolfram.com>
8181
Manikantan Thiyagarajan <124235109+TManikantan@users.noreply.github.com>
82+
Manikantan Thiyagarajan <124235109+TManikantan@users.noreply.github.com> <x-manikantan.thiyagarajan@modelon.com>
8283
Marco Kessler <marco.kessler@3ds.com>
8384
Marcus Baur <baur_ma@7ce873d0-865f-4ce7-a662-4bb36ea78beb>
8485
Martin Otter <Martin.Otter@dlr.de>

Modelica/Blocks/package.mo

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,13 +1191,9 @@ As expected, one can see the 5<sup>th</sup>, 7<sup>th</sup>, 11<sup>th</sup>,
11911191
f_max=2000,
11921192
f_res=5,
11931193
resultFileName="rectifier12pulseFFTresult.mat")
1194-
annotation (Placement(
1195-
transformation(
1196-
extent={{-10,-10},{10,10}},
1197-
origin={-40,-20})));
1194+
annotation (Placement(transformation(extent={{-10,-10},{10,10}}, origin={-40,-20})));
11981195
equation
1199-
connect(currentSensor.i[1], realFFT.u) annotation (Line(points={{-70,-11},{-70,-20},{-52,-20}},
1200-
color={0,0,127}));
1196+
connect(currentSensor.i[1], realFFT.u) annotation (Line(points={{-70,-11},{-70,-20},{-52,-20}}, color={0,0,127}));
12011197
annotation (experiment(StopTime=0.25, Interval=0.0001),
12021198
Documentation(info="<html>
12031199
<p>
@@ -1217,7 +1213,7 @@ The resulting sampling interval is <code>samplePeriod&nbsp;=&nbsp;1/(n*f_res)&nb
12171213
Thus, we have to sample for a&nbsp;period of <code>n*samplePeriod = 1/f_res = 0.2 s</code>.
12181214
</p>
12191215
<p>
1220-
The resultfile &quot;rectifier12pulseFFTresult.mat&quot; can be used to plot amplitudes versus frequencies.
1216+
The result file &quot;rectifier12pulseFFTresult.mat&quot; can be used to plot amplitudes versus frequencies.
12211217
Note that for each frequency three rows exit: one with amplitude zero,
12221218
one with the calculated amplitude, one with amplitude zero.
12231219
Thus, the second column (amplitude) can be easily plotted versus the first column (frequency).
@@ -1236,12 +1232,12 @@ As expected, one can see the 11<sup>th</sup>, 13<sup>th</sup>, 23<sup>th</sup>,
12361232
final parameter Real THDrms = V3/sqrt(V1^2+V3^2) "Theoretically obtained THD with respect to RMS";
12371233
Modelica.Electrical.Analog.Basic.Ground ground annotation (Placement(transformation(extent={{-50,-60},{-30,-40}})));
12381234
Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage3(V=sqrt(2)*V3, f=3*f1,
1239-
startTime=0.02) annotation (Placement(transformation(
1235+
startTime=0.02) annotation (Placement(transformation(
12401236
extent={{-10,-10},{10,10}},
12411237
rotation=270,
12421238
origin={-40,10})));
12431239
Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage1(V=sqrt(2)*V1, f=f1,
1244-
startTime=0.02) annotation (Placement(transformation(
1240+
startTime=0.02) annotation (Placement(transformation(
12451241
extent={{-10,-10},{10,10}},
12461242
rotation=270,
12471243
origin={-40,-20})));
@@ -1284,7 +1280,7 @@ theoretical calculations:</p>
12841280
</html>"));
12851281
end TotalHarmonicDistortion;
12861282

1287-
model Modulation "Demonstrate amplitude modulation an frequency modulation"
1283+
model Modulation "Demonstrate amplitude modulation and frequency modulation"
12881284
extends Modelica.Icons.Example;
12891285
Modelica.Blocks.Sources.SineVariableFrequencyAndAmplitude sine(
12901286
useConstantAmplitude=true,
@@ -1503,7 +1499,7 @@ Compare the sinc signal and an exponentially damped sine.
15031499
Tolerance=1e-06), Documentation(info="<html>
15041500
<p>
15051501
This example uses a sinusoidal signal with amplitude varying sinusoidally in the range of [1,5] with a frequency of 63 Hz,
1506-
and frequency varying according to a cosine function in the range of [10, 100] Hz with a frqeuncy of 77 Hz.
1502+
and frequency varying according to a cosine function in the range of [10, 100] Hz with a frequency of 77 Hz.
15071503
</p>
15081504
<p>
15091505
Note that signalExtrema1 doesn't find the extrema exactly since sampling frequency 100 Hz is too small compared to maximum frequency of the input signal,
@@ -1538,40 +1534,40 @@ whereas signalExtrema2 catches the extrema rather good due to the fact that samp
15381534
annotation (Placement(transformation(extent={{60,70},{80,90}})));
15391535
Modelica.Blocks.Math.ContinuousSignalExtrema signalExtrema2
15401536
annotation (Placement(transformation(extent={{60,10},{80,30}})));
1541-
Sources.Sine sine1(
1537+
Sources.Sine sine1(
15421538
amplitude=1,
15431539
f=7,
15441540
offset=-2)
15451541
annotation (Placement(transformation(extent={{-60,-50},{-40,-30}})));
1546-
Sources.Pulse pulse(
1542+
Sources.Pulse pulse(
15471543
amplitude=2,
15481544
period=1/9,
15491545
offset=1)
15501546
annotation (Placement(transformation(extent={{-60,-90},{-40,-70}})));
15511547
Math.Add add
15521548
annotation (Placement(transformation(extent={{-20,-70},{0,-50}})));
1553-
Math.Product product3
1549+
Math.Product product3
15541550
annotation (Placement(transformation(extent={{20,-50},{40,-30}})));
1555-
Sources.SawTooth sawTooth1(
1551+
Sources.SawTooth sawTooth1(
15561552
amplitude=2,
15571553
period=1/13,
15581554
offset=-1)
15591555
annotation (Placement(transformation(extent={{-20,-30},{0,-10}})));
1560-
Math.ContinuousSignalExtrema signalExtrema3
1556+
Math.ContinuousSignalExtrema signalExtrema3
15611557
annotation (Placement(transformation(extent={{60,-50},{80,-30}})));
15621558
equation
15631559
connect(amplitude.y, product1.u2) annotation (Line(points={{-19,50},{-10,50},
15641560
{-10,74},{-2,74}}, color={0,0,127}));
15651561
connect(amplitude.y, product2.u1) annotation (Line(points={{-19,50},{-10,50},
1566-
{-10,26},{-2,26}}, color={0,0,127}));
1562+
{-10,26},{-2,26}}, color={0,0,127}));
15671563
connect(sine.y, product1.u1) annotation (Line(points={{-39,80},{-20,80},{-20,
15681564
86},{-2,86}}, color={0,0,127}));
15691565
connect(sawTooth.y, product2.u2) annotation (Line(points={{-39,20},{-20,20},
1570-
{-20,14},{-2,14}}, color={0,0,127}));
1566+
{-20,14},{-2,14}}, color={0,0,127}));
15711567
connect(product1.y, signalExtrema1.u)
1572-
annotation (Line(points={{21,80},{58,80}},color={0,0,127}));
1568+
annotation (Line(points={{21,80},{58,80}}, color={0,0,127}));
15731569
connect(product2.y, signalExtrema2.u)
1574-
annotation (Line(points={{21,20},{58,20}}, color={0,0,127}));
1570+
annotation (Line(points={{21,20},{58,20}}, color={0,0,127}));
15751571
connect(sine1.y, add.u1) annotation (Line(points={{-39,-40},{-32,-40},{-32,
15761572
-54},{-22,-54}}, color={0,0,127}));
15771573
connect(pulse.y, add.u2) annotation (Line(points={{-39,-80},{-32,-80},{-32,
@@ -1587,7 +1583,7 @@ whereas signalExtrema2 catches the extrema rather good due to the fact that samp
15871583
Interval=0.0001,
15881584
Tolerance=1e-06), Documentation(info="<html>
15891585
<p>
1590-
The amplitude of both a differentiable sinusoidal signal (frequency 9 Hz) and a non-differentiable sawtooth signal (period 1/9 s) is modulated sinusoidally /frequency 0.75 Hz).
1586+
The amplitudes of both a differentiable sinusoidal signal (frequency 9 Hz) and a non-differentiable sawtooth signal (period 1/9 s) are modulated sinusoidally (frequency 0.75 Hz).
15911587
</p>
15921588
<p>
15931589
Note that the ContinuousSignalExtremaBlock detects extrema of both signals without sampling.
@@ -1655,7 +1651,7 @@ Note that the ContinuousSignalExtremaBlock detects extrema of both signals witho
16551651
<td><code>y_mean</code></td>
16561652
</tr>
16571653
<tr>
1658-
<td>Rectfied mean</td>
1654+
<td>Rectified mean</td>
16591655
<td><code>rectifiedMean.y</code></td>
16601656
<td><code>y_rect</code></td>
16611657
</tr>

Modelica/Electrical/QuasiStatic/SinglePhase/Examples/MultipleResonance.mo

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ within Modelica.Electrical.QuasiStatic.SinglePhase.Examples;
22
model MultipleResonance
33
"Demonstrates series and parallel resonance using a transformer"
44
extends Icons.Example;
5-
import Modelica.ComplexMath.j;
65
import Modelica.Constants.small;
76
parameter Modelica.Units.SI.Voltage V=0.5 "Source rms voltage";
87
parameter Modelica.Units.SI.Frequency fLo=5.e6 "Lower source frequency";
98
parameter Modelica.Units.SI.Frequency fUp=15e6 "Upper source frequency";
10-
parameter Modelica.Units.SI.ComplexImpedance Zi=Modelica.Units.SI.ComplexImpedance(100 +j*0) "Source inner impedance";
9+
parameter Modelica.Units.SI.ComplexImpedance Zi=Modelica.Units.SI.ComplexImpedance(100) "Source inner impedance";
1110
parameter Modelica.Units.SI.Inductance L1=30e-6 "Transformer primary inductance";
1211
parameter Modelica.Units.SI.Inductance L2=1.e-6 "Transformer secondary inductance";
1312
parameter Real k(min=small, max=1)=0.95 "Transformer coupling factor";

Modelica/Media/package.mo

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6082,7 +6082,7 @@ Note that the (small) influence of the pressure term p/d is neglected.
60826082
extends Modelica.Icons.Function;
60836083
input AbsolutePressure p "Pressure";
60846084
input Temperature T "Temperature";
6085-
input MassFraction X[nX] "Mass fractions";
6085+
input MassFraction X[:] "Mass fractions";
60866086
output SpecificEnthalpy h "Specific enthalpy";
60876087
algorithm
60886088
h := cp_const*(T - T0);
@@ -6098,7 +6098,7 @@ This function computes the specific enthalpy of the fluid, but neglects the (sma
60986098
extends Modelica.Icons.Function;
60996099
input AbsolutePressure p "Pressure";
61006100
input SpecificEnthalpy h "Specific enthalpy";
6101-
input MassFraction X[nX] "Mass fractions";
6101+
input MassFraction X[:] "Mass fractions";
61026102
output Temperature T "Temperature";
61036103
algorithm
61046104
T := T0 + h/cp_const;
@@ -6108,7 +6108,7 @@ This function computes the specific enthalpy of the fluid, but neglects the (sma
61086108
extends Modelica.Icons.Function;
61096109
input AbsolutePressure p "Pressure";
61106110
input SpecificEnthalpy h "Specific enthalpy";
6111-
input MassFraction X[nX] "Mass fractions";
6111+
input MassFraction X[:] "Mass fractions";
61126112
output Density d "Density";
61136113
algorithm
61146114
d := density(setState_phX(
@@ -6403,7 +6403,7 @@ quantities are assumed to be constant.
64036403
extends Modelica.Icons.Function;
64046404
input AbsolutePressure p "Pressure";
64056405
input Temperature T "Temperature";
6406-
input MassFraction X[nX] "Mass fractions";
6406+
input MassFraction X[:] "Mass fractions";
64076407
output SpecificEnthalpy h "Specific enthalpy at p, T, X";
64086408
algorithm
64096409
h := cp_const*(T - T0);
@@ -6414,7 +6414,7 @@ quantities are assumed to be constant.
64146414
extends Modelica.Icons.Function;
64156415
input AbsolutePressure p "Pressure";
64166416
input SpecificEnthalpy h "Specific enthalpy";
6417-
input MassFraction X[nX] "Mass fractions";
6417+
input MassFraction X[:] "Mass fractions";
64186418
output Temperature T "Temperature";
64196419
algorithm
64206420
T := h/cp_const + T0;
@@ -6424,7 +6424,7 @@ quantities are assumed to be constant.
64246424
extends Modelica.Icons.Function;
64256425
input AbsolutePressure p "Pressure";
64266426
input SpecificEnthalpy h "Specific enthalpy";
6427-
input MassFraction X[nX] "Mass fractions";
6427+
input MassFraction X[:] "Mass fractions";
64286428
output Density d "Density";
64296429
algorithm
64306430
d := density(setState_phX(

Modelica/Resources/C-Sources/ModelicaStandardTables.c

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@
3939
Modelica.Blocks.Tables.CombiTable2Dv
4040
4141
Changelog:
42+
Jun. 04, 2024: by Thomas Beutlich
43+
Restored derivatives for one-sided extrapolation by constant
44+
continuation of 2D tables that actually degrade to 1D tables as
45+
regression of ticket #3894 (ticket #4343)
46+
4247
May 03, 2022: by Hans Olsson, Dassault Systemes
4348
Fixed index-out-of-bounds exception in spline
4449
initialization of 2D tables that actually degrade
@@ -4355,9 +4360,6 @@ double ModelicaStandardTables_CombiTable2D_getDerValue(void* _tableID, double u1
43554360
break;
43564361

43574362
case HOLD_LAST_POINT:
4358-
der_y = (TABLE(1, last2 + 2) - TABLE(1, last2 + 1))/
4359-
(TABLE_ROW0(last2 + 2) - TABLE_ROW0(last2 + 1));
4360-
der_y *= der_u2;
43614363
break;
43624364

43634365
case NO_EXTRAPOLATION:
@@ -4500,9 +4502,6 @@ double ModelicaStandardTables_CombiTable2D_getDerValue(void* _tableID, double u1
45004502
break;
45014503

45024504
case HOLD_LAST_POINT:
4503-
der_y = (TABLE(last1 + 2, 1) - TABLE(last1 + 1, 1))/
4504-
(TABLE_COL0(last1 + 2) - TABLE_COL0(last1 + 1));
4505-
der_y *= der_u1;
45064505
break;
45074506

45084507
case NO_EXTRAPOLATION:
@@ -5277,9 +5276,6 @@ double ModelicaStandardTables_CombiTable2D_getDer2Value(void* _tableID, double u
52775276
break;
52785277

52795278
case HOLD_LAST_POINT:
5280-
der2_y = (TABLE(1, last2 + 2) - TABLE(1, last2 + 1))/
5281-
(TABLE_ROW0(last2 + 2) - TABLE_ROW0(last2 + 1));
5282-
der2_y *= der2_u2;
52835279
break;
52845280

52855281
case NO_EXTRAPOLATION:
@@ -5423,9 +5419,6 @@ double ModelicaStandardTables_CombiTable2D_getDer2Value(void* _tableID, double u
54235419
break;
54245420

54255421
case HOLD_LAST_POINT:
5426-
der2_y = (TABLE(last1 + 2, 1) - TABLE(last1 + 1, 1))/
5427-
(TABLE_COL0(last1 + 2) - TABLE_COL0(last1 + 1));
5428-
der2_y *= der2_u1;
54295422
break;
54305423

54315424
case NO_EXTRAPOLATION:

Modelica/Resources/Reference/Modelica/Blocks/Examples/Noise/NormalNoiseProperties/comparisonSignals.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
time
2-
mean.mu
2+
mean.y
33
standardDeviation.variance.mu
44
standardDeviation.variance.var
55
variance.mu

Modelica/Resources/Reference/Modelica/Blocks/Examples/Noise/UniformNoiseProperties/comparisonSignals.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
time
2-
mean.mu
2+
mean.y
33
standardDeviation.variance.mu
44
standardDeviation.variance.var
55
variance.mu

0 commit comments

Comments
 (0)