# PS Integrator

Integrate physical signal

• Library:
• Simscape / Foundation Library / Physical Signals / Linear Operators

## Description

The PS Integrator block outputs the integral of its input at the current time step. The following equation represents the output of the block:

`$y\left(t\right)=\underset{{t}_{0}}{\overset{t}{\int }}u\left(t\right)dt+{y}_{0}$`

where

 `u` Physical signal at the input port I `y0` Initial condition `y` Physical signal at the output port O `t` Time

The PS Integrator block is a dynamic system with one state, its output. The PS Integrator block's input is the state's time derivative:

`$x=y\left(t\right)$`
`${x}_{0}={y}_{0}$`
`$\stackrel{˙}{x}=u\left(t\right)$`

The solver computes the output of the PS Integrator block at the current time step, using the current input value and the value of the state at the previous time step. To support this computational model, the PS Integrator block saves its output at the current time step for use by the solver to compute its output at the next time step. The block also provides the solver with an initial condition for use in computing the block's initial state at the beginning of a simulation run. The default value of the initial condition is 0 s. You can specify another value for the initial condition as either a block parameter or an additional input signal:

• To define the initial condition as a block parameter, specify the Initial condition source parameter as `Internal` and enter the value and unit in the Initial condition fields.

• To provide the initial condition from an external source, specify the Initial condition source parameter as `External`. An additional physical signal input port, X0, appears below the block's input port. Connect the external initial condition signal to port X0.

The block performs integration of the input signal over time, therefore the unit of the output signal equals the unit of the input signal multiplied by the unit of time, s. For example, if the input signal is in `m/s`, then the output signal is in `m`. The unit specified for the Initial condition parameter, or the unit of the external initial condition signal at port X0, must be commensurate with the unit of the output signal.

### Resetting the State

The block can reset its state to the specified initial condition based on an external signal. By default, the External reset parameter is set to `None`. To cause the block to reset its state, select one of the other External reset choices:

• Select `Rising` to reset the state when the reset signal rises from a negative or zero value to a positive value.

• Select `Falling` to reset the state when the reset signal falls from a positive value to a zero or negative value.

• Select `Either` to reset the state when the reset signal changes from zero to a nonzero value, from a nonzero value to zero, or changes sign.

When you select either of these options, a trigger port R appears below the block's input port. Connect the reset physical signal to port R.

## Ports

### Input

expand all

Input physical signal.

The port name is not visible in the block icon, but you can see this name in the underlying source file (accessible by clicking the Source code link in the block dialog box).

Reset physical signal. Depending on the External reset parameter value, the block resets the output to initial condition on the rising edge, falling edge, or both the rising and the falling edge of the reset signal.

#### Dependencies

To enable this port, set the External reset parameter to `Rising`, `Falling`, or `Either`.

Physical signal input port for specifying the block's initial condition. The unit of the initial condition signal XO must be commensurate with the unit of the output signal, y.

#### Dependencies

To enable this port, set the Initial condition source parameter to `External`.

### Output

expand all

Output physical signal.

The port name is not visible in the block icon, but you can see this name in the underlying source file (accessible by clicking the Source code link in the block dialog box).

## Parameters

expand all

By default, the block does not reset its state to the initial condition. Setting this parameter to an option other than `None` exposes the input port R. Depending on the parameter value, the block resets its state on the rising edge, falling edge, or both the rising and the falling edge of the reset signal.

You can specify the block's initial condition as either a block parameter or an additional input signal:

• `Internal` — Define the initial condition for integration using the Initial condition parameter.

• `External` — Define the initial condition for integration using the external physical signal at port X0.

Specify the initial condition for use in computing the block's initial state at the beginning of a simulation run.

The unit specified for the Initial condition parameter must match the unit of the output signal. By default, the input signal is unitless. Then the output signal is in `s`, and the Initial condition parameter unit is also `s`. If your input signal has a physical unit, multiply this unit by a unit of time to set the correct unit for the Initial condition parameter. For example, if the input signal is in `m/s`, then specify the Initial condition parameter unit as `m`.

#### Dependencies

To enable this parameter, set Initial condition source to `Internal`.

## Compatibility Considerations

expand all

Behavior changed in R2019a