FirstOrder
IconFirstOrder
A first-order filter with a single real pole at s = -1/T
and gain k
. The transfer function is given by $Y(s)/U(s) =$
k
───────
sT + 1
This component extends from SISO
Usage
FirstOrder(T, k=1.0)
Parameters:
Name | Description | Units | Default value |
---|---|---|---|
T | Time constant | – | |
k | Gain | – | 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 | State of FirstOrder filter | – |
Behavior
\[ \begin{align} \frac{\mathrm{d} x\left( t \right)}{\mathrm{d}t} &= \frac{ - x\left( t \right) + k u\left( t \right)}{T} \\ y\left( t \right) &= x\left( t \right) \end{align} \]
Source
# A first-order filter with a single real pole at `s = -1/T` and gain `k`. The transfer function
# is given by ``Y(s)/U(s) = ``
#
# ```
# k
# ───────
# sT + 1
# ```
component FirstOrder
extends SISO
# State of FirstOrder filter
variable x::Real
# Time constant
parameter T::Real
# Gain
parameter k::Real = 1.0
relations
der(x) = (k*u-x)/T
y = x
metadata {"JuliaSim": {"icons": {"default": "jsml://BlockComponents/FirstOrder.svg"}}}
end
Flattened Source
# A first-order filter with a single real pole at `s = -1/T` and gain `k`. The transfer function # is given by ``Y(s)/U(s) = `` # # ``` # k # ─────── # sT + 1 # ``` component FirstOrder u = RealInput() [{ "JuliaSim": { "placement": {"icon": {"iconName": "input", "x1": -50, "y1": 450, "x2": 50, "y2": 550}} } }] y = RealOutput() [{ "JuliaSim": { "placement": {"icon": {"iconName": "output", "x1": 950, "y1": 450, "x2": 1050, "y2": 550}} } }] # State of FirstOrder filter variable x::Real # Time constant parameter T::Real # Gain parameter k::Real = 1.0 relations der(x) = (k*u-x)/T y = x metadata {"JuliaSim": {"icons": {"default": "jsml://BlockComponents/FirstOrder.svg"}}} end
Test Cases
Related
- Examples
- Experiments
- Analyses