GreaterOrEqual Icon
Compare.GreaterOrEqual
GreaterOrEqual()Compares two real-valued input signals (u1 and u2) and checks whether the first input (u1) is greater than or equal to the second (u2).
Variables
u1: First real input signalu2: Second real input signaly: Real output (1.0 if u1 ≥ u2, 0.0 otherwise)
Description
This component extends the partialComparison component and outputs a logical (real) value.
Examples
u1 = 7.0, u2 = 5.0 → y = 1.0 (u1 is greater)
u1 = 5.0, u2 = 5.0 → y = 1.0 (u1 equals u2)
u1 = 4.9, u2 = 5.0 → y = 0.0 (u1 is less)This component extends from partialComparison
Usage
PrimitiveComponents.Compare.GreaterOrEqual()
Connectors
y- This connector represents a real signal as an output from a component (RealOutput)u1- This connector represents a real signal as an input to a component (RealInput)u2- This connector represents a real signal as an input to a component (RealInput)
Behavior
\[ \begin{align} y\left( t \right) &= ifelse\left( \mathtt{u1}\left( t \right) \geq \mathtt{u2}\left( t \right), 1, 0 \right) \end{align} \]
Source
"""
GreaterOrEqual()
Compares two real-valued input signals (u1 and u2) and checks whether the first input (u1) is greater than or equal to the second (u2).
# Variables
- `u1`: First real input signal
- `u2`: Second real input signal
- `y`: Real output (1.0 if u1 ≥ u2, 0.0 otherwise)
# Description
This component extends the `partialComparison` component and outputs a logical (real) value.
# Examplesu1 = 7.0, u2 = 5.0 → y = 1.0 (u1 is greater) u1 = 5.0, u2 = 5.0 → y = 1.0 (u1 equals u2) u1 = 4.9, u2 = 5.0 → y = 0.0 (u1 is less)
"""</span>
<span class="hljs-keyword">component</span> GreaterOrEqual
<span class="hljs-keyword">extends</span> <span class="hljs-link"><a href="../../types/partialComparison.html">partialComparison</a></span>()
<span class="hljs-keyword">relations</span>
# y = 1.0 when u1 ≥ u2 ,otherwisey = 0.0
y = ifelse(u1 >= u2, float_sym(1.0), float_sym(0.0))
<span class="hljs-keyword">metadata</span> {
"Dyad": {"icons": {"default": "dyad://PrimitiveComponents/GreaterEqualThreshold.svg"}}
}
<span class="hljs-keyword">end</span></code></pre>
Flattened Source
"""
GreaterOrEqual()
Compares two real-valued input signals (u1 and u2) and checks whether the first input (u1) is greater than or equal to the second (u2).
# Variables
- `u1`: First real input signal
- `u2`: Second real input signal
- `y`: Real output (1.0 if u1 ≥ u2, 0.0 otherwise)
# Description
This component extends the `partialComparison` component and outputs a logical (real) value.
# Examplesu1 = 7.0, u2 = 5.0 → y = 1.0 (u1 is greater) u1 = 5.0, u2 = 5.0 → y = 1.0 (u1 equals u2) u1 = 4.9, u2 = 5.0 → y = 0.0 (u1 is less)
"""</span>
<span class="hljs-keyword">component</span> GreaterOrEqual
# Real output signal representing the result of the comparison (either 1.0 or 0.0)
<span class="hljs-symbol">y</span> = <span>Dyad.RealOutput</span>() {
"Dyad": {
"placement": {
"diagram": {"x1": 1000, "x2": 1040, "y1": 480, "y2": 520, "sh": 1, "sw": 1, "rot": 0},
"icon": {"x1": 1000, "x2": 1040, "y1": 480, "y2": 520, "sh": 1, "sw": 1, "rot": 0}
}
}
}
# First real input signal
<span class="hljs-symbol">u1</span> = <span>Dyad.RealInput</span>() {
"Dyad": {
"placement": {
"diagram": {"x1": -40, "x2": 0, "y1": 170, "y2": 210, "sh": 0.04, "sw": 0.04, "rot": 0},
"icon": {"x1": -40, "x2": 0, "y1": 170, "y2": 210, "sh": 0.04, "sw": 0.04, "rot": 0}
}
}
}
# Second real input signal
<span class="hljs-symbol">u2</span> = <span>Dyad.RealInput</span>() {
"Dyad": {
"placement": {
"diagram": {"x1": -40, "x2": 0, "y1": 710, "y2": 750, "sh": 1, "sw": 1, "rot": 0},
"icon": {"x1": -40, "x2": 0, "y1": 710, "y2": 750, "sh": 1, "sw": 1, "rot": 0}
}
}
}
<span class="hljs-keyword">relations</span>
# y = 1.0 when u1 ≥ u2 ,otherwisey = 0.0
y = ifelse(u1 >= u2, float_sym(1.0), float_sym(0.0))
<span class="hljs-keyword">metadata</span> {
"Dyad": {"icons": {"default": "dyad://PrimitiveComponents/GreaterEqualThreshold.svg"}}
}
<span class="hljs-keyword">end</span></code></pre>
Test Cases
No test cases defined.
Related
- Examples
- Experiments
- Analyses