integral_u = TriggeredIntegrator(u=..., active=...).y;
Real output y is the integral over the input u, that is y = integral(u*dt) whenever the Boolean input active = true. Output y is initialized to zero. When active has a rising edge, output y is re-initialized to zero.
This block is demonstrated with the following example:
results in
simulation result |