-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'issue169_smoothMin' of https://github.com/Mathadon/mode…
…lica-annex60 into issue169_smoothMin
- Loading branch information
Showing
11 changed files
with
126 additions
and
2 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
Annex60/Resources/ReferenceResults/Dymola/Annex60_Utilities_Math_Examples_SmoothMin.txt
This file contains 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,4 @@ | ||
last-generated=2015-03-12 | ||
smoLim[2].y=[0.00000000000000000000, 0.01000000000000000021, 0.02000000000000000042, 0.02999999999999999889, 0.04000000000000000083, 0.05000000000000000278, 0.05999999999999999778, 0.07000000000000000666, 0.08000000000000000167, 0.08999999999999999667, 0.10000000000000000555, 0.11000000000000000056, 0.11999999999999999556, 0.13000000000000000444, 0.14000000000000001332, 0.14999999999999999445, 0.16000000000000000333, 0.17000000000000001221, 0.17999999999999999334, 0.19000000000000000222, 0.20000000000000001110, 0.20999999999999999223, 0.22000000000000000111, 0.23000000000000000999, 0.23999999999999999112, 0.25000000000000000000, 0.26000000000000000888, 0.27000000000000001776, 0.28000000000000002665, 0.28999999999999998002, 0.29999999999999998890, 0.30999999999999999778, 0.32000000000000000666, 0.33000000000000001554, 0.34000000000000002442, 0.34999999999999997780, 0.35999999999999998668, 0.36999999999999999556, 0.38000000000000000444, 0.39000000000000001332, 0.40000000000000002220, 0.40999999999999997558, 0.41999999999999998446, 0.42999999999999999334, 0.44000000000000000222, 0.45000000000000001110, 0.46000000000000001998, 0.46999999999999997335, 0.48000000000031972647, 0.49119203103603126248, 0.50000000000000000000, 0.50119203103620701967, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000] | ||
smoLim[1].y=[0.00000000000000000000, 0.01000000000000000021, 0.02000000000000000042, 0.02999999999999999889, 0.04000000000000000083, 0.05000000000000000278, 0.05999999999999999778, 0.07000000000000000666, 0.08000000000000000167, 0.08999999999999999667, 0.10000000000000000555, 0.11000000000000000056, 0.11999999999999999556, 0.13000000000000000444, 0.14000000000000001332, 0.14999999999999999445, 0.16000000000000000333, 0.17000000000000001221, 0.17999999999999999334, 0.19000000000000000222, 0.20000000000000001110, 0.20999999999999999223, 0.22000000000000000111, 0.23000000000000000999, 0.23999999999999999112, 0.25000000000000000000, 0.26000000000000000888, 0.27000000000000001776, 0.28000000000000002665, 0.28999999999999998002, 0.29999999999999998890, 0.30999999999999999778, 0.32000000000000000666, 0.33000000000000001554, 0.34000000000000002442, 0.34999999999999997780, 0.35999999999999998668, 0.36999999999999999556, 0.38000000000000000444, 0.39000000000000001332, 0.40000000000000002220, 0.41000029802711407401, 0.42016942706213822323, 0.43135490175766755261, 0.44359585940314721908, 0.45596016886749107799, 0.46758108398321712729, 0.47795635575202533030, 0.48686052224826820156, 0.49421461775058495025, 0.50000000000000000000, 0.50421464755271871994, 0.50686049787469922290, 0.50795638615902805046, 0.50758111675328099199, 0.50596016886727745998, 0.50359582960083359993, 0.50135487195557659756, 0.50016939568672358352, 0.50000029801931600293, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000, 0.50000000000000000000] | ||
time=[0.00000000000000000000, 1.00000000000000000000] |
10 changes: 10 additions & 0 deletions
10
Annex60/Resources/Scripts/Dymola/Utilities/Math/Examples/SmoothMin.mos
This file contains 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,10 @@ | ||
removePlots(); | ||
simulateModel("Annex60.Utilities.Math.Examples.SmoothMin", startTime=0, method="dassl", resultFile="SmoothMin"); | ||
createPlot(id=1, | ||
position={4, 21, 531, 524}, | ||
y={"smoLim[2].y", "smoLim[1].y"}, | ||
range={0.0, 1.0, -0.05, 0.55}, | ||
grid=true, | ||
leftTitleType=1, | ||
bottomTitleType=1, | ||
colors={{0,0,255}, {255,0,0}}); |
This file contains 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 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,55 @@ | ||
within Annex60.Utilities.Math.Examples; | ||
model SmoothMin "Test model for smooth minimum" | ||
import Annex60; | ||
extends Modelica.Icons.Example; | ||
Annex60.Utilities.Math.SmoothMin smoLim[2](deltaX={0.1,0.02}) "Smooth limit" | ||
annotation (Placement(transformation(extent={{0,-10},{20,10}}))); | ||
Modelica.Blocks.Sources.Ramp ramp(height=1, duration=1) "Ramp input" | ||
annotation (Placement(transformation(extent={{-40,10},{-20,30}}))); | ||
Modelica.Blocks.Sources.Constant const(k=0.5) "Constant input" | ||
annotation (Placement(transformation(extent={{-40,-30},{-20,-10}}))); | ||
equation | ||
|
||
connect(ramp.y, smoLim[1].u1) annotation (Line( | ||
points={{-19,20},{-2,20},{-2,6}}, | ||
color={0,0,127}, | ||
smooth=Smooth.None)); | ||
connect(smoLim[2].u1, ramp.y) annotation (Line( | ||
points={{-2,6},{-2,20},{-19,20}}, | ||
color={0,0,127}, | ||
smooth=Smooth.None)); | ||
connect(const.y, smoLim[1].u2) annotation (Line( | ||
points={{-19,-20},{-2,-20},{-2,-6}}, | ||
color={0,0,127}, | ||
smooth=Smooth.None)); | ||
connect(const.y, smoLim[2].u2) annotation (Line( | ||
points={{-19,-20},{-2,-20},{-2,-6}}, | ||
color={0,0,127}, | ||
smooth=Smooth.None)); | ||
annotation(experiment(StopTime=1.0), | ||
__Dymola_Commands(file= | ||
"modelica://Annex60/Resources/Scripts/Dymola/Utilities/Math/Examples/SmoothMin.mos" | ||
"Simulate and plot"), | ||
Documentation(info="<html> | ||
<p> | ||
This model tests the implementation of | ||
<a href=\"modelica://Annex60.Utilities.Math.SmoothMin\"> | ||
Annex60.Utilities.Math.SmoothMin</a>. | ||
</p> | ||
<p> | ||
This model also illustrates that the output can be larger than | ||
the minimum of the two input signals. Smaller values for <code>deltaX</code> | ||
will reduce this effect. Therefore do not use this function when the minimum | ||
output value should be respected. | ||
</p> | ||
</html>", revisions="<html> | ||
<ul> | ||
<li> | ||
March 12, 2015, by Filip Jorissen:<br/> | ||
First implementation. | ||
</li> | ||
</ul> | ||
</html>"), | ||
Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{ | ||
100,100}}), graphics)); | ||
end SmoothMin; |
This file contains 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 |
---|---|---|
|
@@ -11,5 +11,6 @@ RegNonZeroPower | |
SmoothBlocks | ||
SmoothExponential | ||
SmoothLimit | ||
SmoothMin | ||
Splice | ||
VectorFunctions |
This file contains 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 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 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 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 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 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