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

NameDomainDirection
usignalin
ysignalout

Parameters

NameUnitDefaultRangeDescription
k11Gain
y010Start value
Tss0.10 to ∞Sample period

Variables

NameUnitStartDescription
sum1y0Accumulated sum
nextsTsTime 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