Discrete integrator

This module implements discrete time integrations as pure functions. Thus, there is no internal state and the values of previous time steps have to be supplied.

Euler forward method

Calculation of the discrete integration using the Euler forward method for discretization is simple but only provides sufficient accuracy if the sampling time is low (i.e., high sampling frequency) compared to the system dynamics (i.e., time constant). Calculation is as follows with the output value \(y(k)\) at time step \(k\), the sampling time \(T_s\) and the input to the integrator \(x(k)\):

\[y(k)=y(k-1)+T_s \cdot x(k)\]

Reference

float uz_integrator_eulerforward(float current_value, float old_value, float sample_time, bool clamping_active)

Discrete time integration using Euler forward method.

Parameters:
  • current_value – Value of x(k) at current time step k

  • old_value – Value of x(k-1) at last time step k-1

  • sample_time – Sample time of the discrete integration

  • clamping_active – If true, clamping is active and integration is stopped

Returns:

float