Using Simulink    
Integrator

Integrate a signal.

Library

Continuous

Description

The Integrator block integrates its input. The output of the integrator is simply its state, the integral. The Integrator block allows you to:

Use the Discrete-Time Integrator block, when constructing a purely discrete system.

Defining Initial Conditions

You can define the initial conditions as a parameter on the block dialog box or input them from an external signal:

Using the State Port

In two known situations, you must use the state port instead of the output port:

You can correct these problems by passing the state through the state port rather than the output port. Although the values are the same, Simulink generates them at slightly different times, which protects your model from these problems.You output the block state by selecting the Show state port check box. By default, the state port appears on the top of the block, as shown in this figure.

Limiting the Integral

To prevent the output from exceeding specifiable levels, select the Limit output check box and enter the limits in the appropriate parameter fields. Doing so causes the block to function as a limited integrator. When the output reaches the limits, the integral action is turned off to prevent integral wind up. During a simulation, you can change the limits but you cannot change whether the output is limited. The output is determined as follows:

To generate a signal that indicates when the state is being limited, select the Show saturation port check box. A saturation port appears below the block output port, as shown on this figure.

The signal has one of three values:

When this option is selected, the block has three zero crossings: one to detect when it enters the upper saturation limit, one to detect when it enters the lower saturation limit, and one to detect when it leaves saturation.

Resetting the State

The block can reset its state to the specified initial condition based on an external signal. To cause the block to reset its state, select one of the External reset choices. A trigger port appears below the block's input port and indicates the trigger type, as shown in this figure.

The reset port has direct feedthrough. If the block output is fed back into this port, either directly or through a series of blocks with direct feedthrough, an algebraic loop results. To resolve this loop, feed the block state into the reset port instead. To access the block's state, select the Show state port check box.

Specifying the Absolute Tolerance for the Block State

When your model contains states having vastly different magnitudes, defining the absolute tolerance for the model might not provide sufficient error control. To define the absolute tolerance for an Integrator block's state, provide a value for the Absolute tolerance parameter. If the block has more than one state, the same value is applied to all states.

For more information about error control, see Error Tolerances.

Choosing All Options

When all options are selected, the icon looks like this.

Data Type Support

An Integrator block accepts and outputs signals of type double on its data ports. Its external reset port accepts signals of type double or boolean.

Parameters and Dialog Box

External reset
Resets the states to their initial conditions when a trigger event (rising, falling, either, or level) occurs in the reset signal.
Initial condition source
Gets the states' initial conditions from the Initial condition parameter (if set to internal) or from an external block (if set to external).
Initial condition
The states' initial conditions. Set the Initial condition source parameter value to internal.
Limit output
If checked, limits the states to a value between the Lower saturation limit and Upper saturation limit parameters.
Upper saturation limit
The upper limit for the integral. The default is inf.
Lower saturation limit
The lower limit for the integral. The default is -inf.
Show saturation port
If checked, adds a saturation output port to the block.
Show state port
If checked, adds an output port to the block for the block's state.
Absolute tolerance
Absolute tolerance for the block's states.

Characteristics

Direct Feedthrough
Yes, of the reset and external initial condition source ports
Sample Time
Continuous
Scalar Expansion
Of parameters
States
Inherited from driving block or parameter
Dimensionalized
Yes
Zero Crossing
If the Limit output option is selected, one for detecting reset; one each to detect upper and lower saturation limits, one when leaving saturation


 Inport Interpolation (n-D) Using PreLook-Up