CogniPilot

MODELICA LIBRARY · ENGINEERING REFERENCE

package

MathUtilities

General scalar and array math utilities

Signal shaping and limits

Small scalar and array functions for control and estimation. Use clip for component bounds, limitNorm for a vector magnitude bound, and wrapAngle for periodic angles. Component clipping and norm limiting have different geometry.

lowPass, lowPass3 and rateLimit are explicit update maps: the caller supplies prior state and timing. They do not create a hidden sampling clock. Match argument units and update intervals to the calling model.

Members

NameKindDescription
clipfunctionClamp a scalar to a closed interval
clipVectorfunctionClamp every element of a vector to a closed interval
deadzonefunctionRemove a centered dead band and rescale the remaining travel to full range
expofunctionBlend a linear and a cubic response curve
limitNormfunctionScale a vector so its Euclidean norm respects a bound
wrapAnglefunctionWrap an angle to the principal interval
lowPassfunctionApply a scalar first-order sample blend
lowPass3functionApply a first-order sample blend to a 3-vector
rateLimitfunctionLimit the change from a current value to a target
squareRootRampfunctionCorrection toward zero error that a bounded derivative can still unwind
norm2functionEuclidean norm of a 2-vector
norm3functionEuclidean norm of a 3-vector
norm4functionEuclidean norm of a 4-vector

Modelica declarations and implementation

Show parameters, interfaces and source

Parameters, inputs, outputs, defaults and equations from the source file.

package MathUtilities "General scalar and array math utilities"
  annotation(Documentation(info = "<html>
    <h4>Signal shaping and limits</h4>
<p>Small scalar and array functions for control and estimation. Use
<a href=\"modelica://MathUtilities.clip\">clip</a> for component bounds,
<a href=\"modelica://MathUtilities.limitNorm\">limitNorm</a> for a vector magnitude
bound, and <a href=\"modelica://MathUtilities.wrapAngle\">wrapAngle</a> for periodic
angles. Component clipping and norm limiting have different geometry.</p>
<p><a href=\"modelica://MathUtilities.lowPass\">lowPass</a>,
<a href=\"modelica://MathUtilities.lowPass3\">lowPass3</a> and
<a href=\"modelica://MathUtilities.rateLimit\">rateLimit</a> are explicit update
maps: the caller supplies prior state and timing. They do not create a hidden
sampling clock. Match argument units and update intervals to the calling model.</p>
    </html>"));
end MathUtilities;