Integrator ​
Integrates the input signal with optional gain factor.
An integrator that computes the time integral of the input signal multiplied by a gain factor. The block implements the transfer function 1/s scaled by gain k.
Outputs y = ∫k*u dt, corresponding to the transfer function \frac{1}{s}.
This component extends from SISO
Usage ​
BlockComponents.Integrator(x0=0, k=1.0)
Parameters: ​
| Name | Description | Units | Default value |
|---|---|---|---|
x0 | Initial value of the integrator state at simulation start | – | 0 |
k | Gain factor applied to the input before integration | – | 1 |
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)
Variables ​
| Name | Description | Units |
|---|---|---|
x | Internal state variable that stores the integrated value | – |
Behavior ​
Source ​
dyad
"""
Integrates the input signal with optional gain factor.
An integrator that computes the time integral of the input signal multiplied by a gain factor.
The block implements the transfer function 1/s scaled by gain k.math y(t) = \int_{t_0}^{t} k \cdot u(\tau) d\tau + x_0
Outputs `y = ∫k*u dt`, corresponding to the transfer function `\frac{1}{s}`.
"""
component Integrator
extends SISO
"Internal state variable that stores the integrated value"
variable x::Real
"Initial value of the integrator state at simulation start"
parameter x0::Real = 0
"Gain factor applied to the input before integration"
parameter k::Real = 1.0
relations
initial x = x0
der(x) = k * u
y = x
metadata {
"Dyad": {
"labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
"icons": {"default": "dyad://BlockComponents/Integrator.svg"}
}
}
endFlattened Source
dyad
"""
Integrates the input signal with optional gain factor.
An integrator that computes the time integral of the input signal multiplied by a gain factor.
The block implements the transfer function 1/s scaled by gain k.math y(t) = \int_{t_0}^{t} k \cdot u(\tau) d\tau + x_0
Outputs `y = ∫k*u dt`, corresponding to the transfer function `\frac{1}{s}`.
"""
component Integrator
"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}
}
}
}
"Internal state variable that stores the integrated value"
variable x::Real
"Initial value of the integrator state at simulation start"
parameter x0::Real = 0
"Gain factor applied to the input before integration"
parameter k::Real = 1.0
relations
initial x = x0
der(x) = k * u
y = x
metadata {
"Dyad": {
"labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
"icons": {"default": "dyad://BlockComponents/Integrator.svg"}
}
}
endTest Cases ​
No test cases defined.