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
| Name | Kind | Description |
|---|---|---|
| clip | function | Clamp a scalar to a closed interval |
| clipVector | function | Clamp every element of a vector to a closed interval |
| deadzone | function | Remove a centered dead band and rescale the remaining travel to full range |
| expo | function | Blend a linear and a cubic response curve |
| limitNorm | function | Scale a vector so its Euclidean norm respects a bound |
| wrapAngle | function | Wrap an angle to the principal interval |
| lowPass | function | Apply a scalar first-order sample blend |
| lowPass3 | function | Apply a first-order sample blend to a 3-vector |
| rateLimit | function | Limit the change from a current value to a target |
| squareRootRamp | function | Correction toward zero error that a bounded derivative can still unwind |
| norm2 | function | Euclidean norm of a 2-vector |
| norm3 | function | Euclidean norm of a 3-vector |
| norm4 | function | Euclidean 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;