Sign
Sign of the input: −1, 0, or 1.
- signal
- Modelica Standard Library
- 2 ports
signLibraryMathDescription
Outputs the sign of its input: 1 for positive, −1 for negative, 0 at exactly zero.
Example
Math functions Gain, absolute value, square root, sign, negation, and power of a sine; sine and cosine of time.
u = 2 sin(πt/2)Gain 0.5|u|√|u|sign(u)−uu²Timesin(t)cos(t)
Also in this example:PowerSine waveClockGainAbsSqrtSinCosUnary minus
Ports
Inputs 1
-
u
Input signal.
Outputs 1
-
y
Output signal: −1, 0, or 1.
Equations
Modelica
y = 1 if u > 0 y = −1 if u < 0 y = 0 if u = 0
Implementation
Modelica Standard Library 4.1.0
MSL documentation Modelica.Blocks.Math.SignAssumptions and limitations
- The output jumps where u crosses zero, which causes a solver event at each crossing.
See also
Select a block in Gradara and press F1 to open its page offline.