Discrete integrator
signal.discrete_integrator
Adds k Ts u to the output at every sample, taken every Ts seconds from t = Ts on, and holds the sum in between. At t = n Ts the output is y0 + k Ts (u(Ts) + u(2 Ts) + ... + u(n Ts)).
Ports
| Name | Domain | Direction |
|---|---|---|
u | signal | in |
y | signal | out |
Parameters
| Name | Unit | Default | Range | Description |
|---|---|---|---|---|
k | 1 | 1 | Gain | |
y0 | 1 | 0 | Start value | |
Ts | s | 0.1 | 0 to ∞ | Sample period |
Variables
| Name | Unit | Start | Description |
|---|---|---|---|
sum | 1 | y0 | Accumulated sum |
next | s | Ts | Time of the next sample |
Equations
der(sum) = 0 der(next) = 0 when time >= next then reinit(sum, sum + k * Ts * u), reinit(next, next + Ts) y = sum