Discrete-Time Integrator - Perform discrete-time integration or accumulation of signal

Library

Discrete

Description

You can use the Discrete-Time Integrator block in place of the Integrator block to create a purely discrete system.

The Discrete-Time Integrator block allows you to

These features are described below.

Integration and Accumulation Methods

The block can integrate or accumulate using the Forward Euler, Backward Euler, and Trapezoidal methods. For a given step n, Simulink® software updates y(n) and x(n+1). In integration mode, T is the block's sample time (delta T in the case of triggered sample time). In accumulation mode, T = 1; the block's sample time determines when the block's output is computed but not the output's value. K is the gain value. Values are clipped according to upper or lower limits.

The block reflects the selected integration or accumulation method, as this figure shows.

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 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 software 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 in this figure.

The signal has one of three values:

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 parameter 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 output of the block's state port into the reset port instead. To access the block's state, select the Show state port check box.

Reset Trigger Types

The External reset parameter lets you determine the attribute of the reset signal that triggers the reset. The trigger options include:

Choosing All Options

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

Data Type Support

The Discrete-Time Integrator block accepts real signals of any data type supported by Simulink software, including fixed-point data types.

Parameters and Dialog Box

The Main pane of the Discrete-Time Integrator block dialog appears as follows:

Integrator method

Specify the integration or accumulation method.

Gain value

Specify a value by which to multiply the integrator input. Specifying a value other than 1.0 (the default) is semantically equivalent to connecting a signal to the input of the integrator via a Gain block, i.e., to

Using this parameter to specify the input gain eliminates a multiplication operation in the generated code. Realizing this benefit, however, requires that this parameter be nontunable. Accordingly, the Real-Time Workshop® software generates a warning during code generation if the Model Parameter Configuration dialog box for this model declares this parameter to be tunable. If you want to tune the input gain, set this parameter to 1.0 and use an external Gain block to specify the input gain.

External reset

Resets the states to their initial conditions when a trigger event occurs in the reset signal. See Resetting the State for more information.

Initial condition source

Gets the states' initial conditions from the Initial condition parameter (internal) or from an external block (external). Simulink software does not allow the initial condition of this block to be inf or NaN.

Initial condition

The states' initial conditions. This parameter is only available if the Initial condition source parameter is set to internal. Simulink software does not allow the initial condition of this block to be inf or NaN.

Use initial condition as initial and reset value for

When you set this parameter to State and output,

y(0) = IC

x(0) = IC

or at reset

y(n) = IC

x(n) = IC

When you set this parameter to State only (most efficient),

x(0) = IC

or at reset

x(n) = IC

Sample time

The time interval between samples. The default is 1. In accumulation mode, the sample time specifies when the block's output is computed. See Specifying Sample Time.

Limit output

If selected, limits the block's output to a value between the Lower saturation limit and Upper saturation limit parameters.

Upper saturation limit

The upper limit for the integral. This parameter is only available if you select the Limit output parameter.

Lower saturation limit

The lower limit for the integral. This parameter is only available if you select the Limit output parameter.

Show saturation port

If selected, adds a saturation output port to the block.

Show state port

If selected, adds an output port to the block for the block's state.

Ignore limit and reset when linearizing

Select this option to cause Simulink linearization commands to treat this block as unresettable and as having no limits on its output, regardless of the settings of the block's reset and output limitation options. This allows you to linearize a model around an operating point that causes the integrator to reset or saturate.

The Signal Attributes pane of the Discrete-Time Integrator block dialog appears as follows:

Output minimum

Specify the minimum value that the block should output. The default value, [], is equivalent to -Inf. Simulink software uses this value to perform:

Output maximum

Specify the maximum value that the block should output. The default value, [], is equivalent to Inf. Simulink software uses this value to perform:

Output data type

Specify the output data type. You can set it to:

Click the Show data type assistant button to display the Data Type Assistant, which helps you set the Output data type parameter.

See Specifying Block Output Data Types for more information.

Lock output scaling against changes by the autoscaling tool

Select to lock scaling of outputs. This parameter is visible only if you enter an expression for the Output data type parameter.

Round integer calculations toward

Select the rounding mode for fixed-point operations. For more information, see Rounding in the Simulink® Fixed Point™ User's Guide.

Saturate on integer overflow

Select to have overflows saturate.

The State Attributes pane of this block pertains to code generation and has no effect on model simulation. See Block State Storage and Interfacing in the Real-Time Workshop User's Guide for more information.

Characteristics

Direct Feedthrough

Yes, of the reset and external initial condition source ports. The input has direct feedthrough for every integration method except forward Euler and accumulation forward Euler.

Sample Time

Specified in the Sample time parameter

Scalar Expansion

Yes, of parameters

States

Inherited from driving block and parameter

Dimensionalized

Yes

Zero Crossing

No

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS