PLECS 3.6 Online Help

Discrete Integrator

Purpose

Discrete integration of the input signal

Library

Control / Discrete

Description

pict

The Discrete Integrator block outputs the integral of its input signal at the current sample time step. The output signal may have an upper and lower limit. It can be reset to its initial value by an external trigger signal.

Integration Methods

You can choose between three integration methods using the Integration method parameter: Forward Euler, Backward Euler and Trapezoidal. The output and update equations for these methods are listed below:

Forward Euler

First simulation step:

y[0] = x[0]

x[1] = y[0]

Subsequent simulation steps:

y[k] = x[k]+ T ⋅u[k- 1]

x[k + 1] = y[k]

Backward Euler

First simulation step:

y[0] = x[0]

x[1] = y[0]

Subsequent simulation steps:

y[k] = x[k]+ T ⋅u[k]

x[k + 1] = y[k]

Trapezoidal

First simulation step:

y[0] = x[0]

x[1] = y[0]

Subsequent simulation steps:

           T
y[k] = x[k]+--⋅(u[k - 1]+ u[k])
           2

x[k + 1] = y[k]

 

In the above equations, if the block has a fixed-step discrete sample time (either inherited or specified explicitly), T   equals the sample period. If the block is executed within a triggered subsystem, T   equals the time span between the previous and the current trigger.

The first simulation step refers to the first time the block executes after a simulation has been started from the initial block parameters (as opposed to a stored system state) or - if the block is executed within an enabled subsystem - after the block has been enabled. If the block is executed within a triggered subsystem, the first execution after simulation start is always treated as a first simulation step even if the simulation is restarted from a stored system state because the value of T   cannot be determined in this case.

Reset Behavior

The integrator may be reset to its initial condition by an external input signal. This is controlled by the External reset parameter. The available options are rising/falling/either edge or level as described below:

Rising Edge Reset

The block output and state are reset to the initial condition if the current reset input value is non-zero and the previous reset input value was zero.

Falling Edge Reset

The block output and state are reset to the initial condition if the current reset input value is zero and the previous reset input value was non-zero.

Either Edge Reset

The block output and state are reset to the initial condition if the current reset input value is non-zero and the previous reset input value was zero or if the current reset input value is zero and the previous reset input value was non-zero.

Level Reset

The block output and state are reset to and held at the initial condition while the current reset input value is non-zero.


Note  The external reset input has a direct influence on the output signal. Therefore, the reset input signal may not directly depend on the output signal since this would cause an algebraic loop.

Parameters

Initial condition
The initial condition of the integrator. This parameter may either be a scalar or a vector corresponding to the implicit width of the component.
External reset
The behaviour of the external reset input. See Reset Behavior above.
Upper saturation limit
An upper limit for the output signal. If the value is inf the output signal is unlimited.
Lower saturation limit
A lower limit for the output signal. If the value is -inf the output signal is unlimited.
Integration method
The method used to integrate the input signal. See Integration Methods above.
Sample time
The time interval between samples. See also the Discrete-Periodic sample time type in section Sample Times.

Probe Signal

State
The internal state of the integrator.