Skip to content

Commit

Permalink
Editorial changes to CDL, and updated Constants.small (#3704)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwetter authored Mar 15, 2024
1 parent b4e5c58 commit 35bec49
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 10 deletions.
8 changes: 7 additions & 1 deletion Buildings/Controls/OBC/CDL/Constants.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package Constants
// Machine dependent constants
final constant Real eps=1E-15
"Biggest number such that 1.0 + eps = 1.0";
final constant Real small=1E-60
final constant Real small=1E-37
"Smallest number such that small and -small are representable on the machine";
final constant Real pi=2*Modelica.Math.asin(
1.0)
Expand All @@ -19,6 +19,12 @@ This package provides often needed constants.
revisions="<html>
<ul>
<li>
March 12, 2024, by Michael Wetter:<br/>
Changed <code>small</code> to <i>1E-37</i>.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3695\">issue 3695</a>.
</li>
<li>
March 27, 2017, by Michael Wetter:<br/>
First implementation, based on the implementation of the
Modelica Standard Library.
Expand Down
6 changes: 5 additions & 1 deletion Buildings/Controls/OBC/CDL/Continuous/Limiter.mo
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,16 @@ and
<code>uMax</code> and <code>uMin</code> are parameters.
</p>
<p>
If <code>uMax &lt; uMin</code>, an error occurs and no output is produced.
If <code>uMax &lt; uMin</code>, an error occurs.
</p>
</html>",
revisions="<html>
<ul>
<li>
February 15, 2024, by Michael Wetter:<br/>
Updated documentation.
</li>
<li>
March 2, 2020, by Michael Wetter:<br/>
Changed icon to display dynamically the output value.
</li>
Expand Down
10 changes: 7 additions & 3 deletions Buildings/Controls/OBC/CDL/Continuous/MatrixGain.mo
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,25 @@ gain matrix <i>K</i> with the input signal vector <i>u</i> as
For example,
</p>
<pre>
parameter Real K[:,:] = [0.12 2; 3 1.5];
parameter Real K[:,:] = [0.12, 2; 3, 1.5];
</pre>
<p>
results in
</p>
<pre>
| y[1] | | 0.12 2.00 | | u[1] |
| y[1] | | 0.12, 2.00 | | u[1] |
| | = | | * | |
| y[2] | | 3.00 1.50 | | u[2] |
| y[2] | | 3.00, 1.50 | | u[2] |
</pre>
</html>",
revisions="<html>
<ul>
<li>
February 15, 2024, by Michael Wetter:<br/>
Updated documentation to have valid syntax.
</li>
<li>
February 11, 2019, by Milica Grahovac:<br/>
First implementation, based on the implementation of the
Modelica Standard Library.
Expand Down
6 changes: 5 additions & 1 deletion Buildings/Controls/OBC/CDL/Continuous/Sqrt.mo
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,16 @@ equation
info="<html>
<p>
Block that outputs square root of the input <code>y = sqrt(u)</code>,
where <code>u</code> is an input. All elements of the input vector shall be non-negative.
where <code>u</code> is an input. The input <code>u</code> must be non-negative.
</p>
</html>",
revisions="<html>
<ul>
<li>
February 15, 2024, by Michael Wetter:<br/>
Updated documentation.
</li>
<li>
March 2, 2020, by Michael Wetter:<br/>
Changed icon to display dynamically the output value.
</li>
Expand Down
4 changes: 2 additions & 2 deletions Buildings/Controls/OBC/CDL/Conversions/RealToInteger.mo
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ as the nearest integer value of the input <code>u</code>.
The block outputs
</p>
<pre>
y = integer( floor( u + 0.5 ) ) for u &gt; 0,
y = integer( ceil ( u - 0.5 ) ) for u &lt; 0.
y = integer( floor( u + 0.5 ) ) if u &gt; 0,
y = integer( ceil ( u - 0.5 ) ) otherwise.
</pre>
</html>",
revisions="<html>
Expand Down
4 changes: 2 additions & 2 deletions Buildings/Controls/OBC/CDL/Routing/RealVectorReplicator.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ within Buildings.Controls.OBC.CDL.Routing;
block RealVectorReplicator "Real vector signal replicator"
parameter Integer nin=1 "Size of input vector";
parameter Integer nout=1 "Number of row in output";
Interfaces.RealInput u[nin]
Interfaces.RealInput u[nin]
"Connector of Real vector input signal"
annotation (Placement(transformation(extent={{-140,-20},{-100,20}})));
Interfaces.RealOutput y[nout, nin]
Interfaces.RealOutput y[nout, nin]
"Connector of Real matrix output signals"
annotation (Placement(transformation(extent={{100,-20},{140,20}})));

Expand Down

0 comments on commit 35bec49

Please sign in to comment.