BlockWerk Documentation
∫

Discrete ∫

Discrete

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

Simulate in BlockWerk

Interactive sandbox directly in your browser — zero installation, WASM-powered.

Simulate in BlockWerk →

Mathematical Model

Forward Euler:y[n]=y[n−1]+T⋅u[n−1]Backward Euler:y[n]=y[n−1]+T⋅u[n]Trapezoidal:y[n]=y[n−1]+T2(u[n]+u[n−1])\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.

Inputs & Outputs

Direction ID Label Type Status
→ In in In number Required
→ In reset Reset number Optional
← Out out Out number Output

Parameters

Parameters Label Type Default Description
method Integration Method select forward
initialCondition Initial Condition number 0
sampleTime Sample Time number 0.01

Usage Examples

  • Zie de ingebouwde voorbeelden in de handleiding voor een demonstratie van dit blok.

Remarks & Best Practices

  • Forward Euler: Simplest method but can be unstable for fast dynamics; suitable for mild integration
  • Backward Euler: Implicit method — more stable for stiff systems; recommended for control loops
  • Trapezoidal: Best accuracy for smooth signals; matches Tustin/bilinear transform for filter design
  • Reset: The integrator can be reset by changing the initialCondition parameter at runtime
  • Windup: In feedback control loops, the integrator may wind up if the output is saturated; use anti-windup strategies

Related Components