Discrete

DiscreteIntegrator Block

Discrete-time integrator (accumulator). Supports forward Euler, backward Euler, and trapezoidal methods.

Open DiscreteIntegrator in BlockWerk →

# DiscreteIntegrator Block

Description

Discrete-time integrator that accumulates the input signal over time. Equivalent to a running sum scaled by the sample time.

Mathematical Model

\begin{aligned} &\text{Forward Euler:} && y[n] = y[n-1] + T \cdot u[n-1] \\ &\text{Backward Euler:} && y[n] = y[n-1] + T \cdot u[n] \\ &\text{Trapezoidal:} && y[n] = y[n-1] + \frac{T}{2} (u[n] + u[n-1]) \end{aligned}

where y[n] is the current output, u[n] the current input, and T the sample time.

Parameters

method

Integration method:

initialCondition

Starting value of the accumulator.

sampleTime

Discrete sample period (seconds).

Remarks

Examples

See Also