Tanh Icon
Mathematical.Tanh
TanhA component that computes the hyperbolic tangent of the input signal.
Description
The Tanh block computes the hyperbolic tangent of input u using the built-in tanh() function. The output y is defined as: y = tanh(u).
Variables
u(t): Input signaly(t): Output signal (hyperbolic tangent of u)
Examples
- u = 0 → y = 0
- u = 1 → y ≈ 0.761
- u = 3 → y ≈ 0.995 (approaches 1)
This component extends from BlockComponents.SISO
Usage
PrimitiveComponents.Mathematical.Tanh()
Connectors
u- This connector represents a real signal as an input to a component (RealInput)y- This connector represents a real signal as an output from a component (RealOutput)
Behavior
\[ \begin{align} y\left( t \right) &= \tanh\left( u\left( t \right) \right) \end{align} \]
Source
"""
Tanh
A component that computes the hyperbolic tangent of the input signal.
# Description
The Tanh block computes the hyperbolic tangent of input `u` using the built-in `tanh()` function.
The output `y` is defined as: y = tanh(u).
# Variables
- `u(t)`: Input signal
- `y(t)`: Output signal (hyperbolic tangent of u)
# Examples
- u = 0 → y = 0
- u = 1 → y ≈ 0.761
- u = 3 → y ≈ 0.995 (approaches 1)
"""
component Tanh
extends BlockComponents.SISO
relations
y = tanh(u)
metadata {
"Dyad": {
"icons": {"default": "dyad://PrimitiveComponents/Tanh.svg"},
"labels": [{"label": "$(instance)", "x": 500, "y": 1100}]
}
}
end
Flattened Source
"""
Tanh
A component that computes the hyperbolic tangent of the input signal.
# Description
The Tanh block computes the hyperbolic tangent of input `u` using the built-in `tanh()` function.
The output `y` is defined as: y = tanh(u).
# Variables
- `u(t)`: Input signal
- `y(t)`: Output signal (hyperbolic tangent of u)
# Examples
- u = 0 → y = 0
- u = 1 → y ≈ 0.761
- u = 3 → y ≈ 0.995 (approaches 1)
"""
component Tanh
"Input signal port"
u = RealInput() {
"Dyad": {
"placement": {
"icon": {"iconName": "input", "x1": -100, "y1": 450, "x2": 0, "y2": 550, "rot": 0},
"diagram": {"iconName": "input", "x1": -100, "y1": 450, "x2": 0, "y2": 550, "rot": 0}
}
}
}
"Output signal port"
y = RealOutput() {
"Dyad": {
"placement": {
"icon": {"iconName": "output", "x1": 1000, "y1": 450, "x2": 1100, "y2": 550, "rot": 0},
"diagram": {"iconName": "output", "x1": 1000, "y1": 450, "x2": 1100, "y2": 550, "rot": 0}
}
}
}
relations
y = tanh(u)
metadata {
"Dyad": {
"labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
"icons": {"default": "dyad://PrimitiveComponents/Tanh.svg"}
}
}
endTest Cases
No test cases defined.
Related
- Examples
- Experiments
- Analyses