# PS Integrator

Integrate physical signal

**Libraries:**

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(t)={\displaystyle \underset{{t}_{0}}{\overset{t}{\int}}u(t)dt}+{y}_{0}$$

where:

*u*is the physical signal at input port**I**.*y*_{0}is the initial condition.*y*is the physical signal at output port**O**.*t*is time.

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

$$x=y(t)$$

$${x}_{0}={y}_{0}$$

$$\dot{x}=u(t)$$

The solver computes the output of the PS Integrator block at the current time step by using the current input value and the value of the state at the previous time step. The PS Integrator block saves its output at the current time step for the solver to use to compute the output at the next time step. The block also provides the solver with an initial condition to use to compute the initial state of the block 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 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 for the**Initial condition**parameter.To provide the initial condition from an external source, specify the

**Initial condition source**parameter as`External`

. Selecting this option exposes port**X0**. Connect the external initial condition signal to this port.

Because the block performs integration of the input signal over time, 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.

Selecting any of these options exposes a trigger port, **R**. Connect
the reset physical signal to this port.

### Limiting the Output

The block can function as a limited integrator, holding its output within the specified saturation bounds:

When the integral is less than or equal to the lower saturation limit, the block holds the output at the lower saturation limit.

When the integral is between the lower saturation limit and the upper saturation limit, the output is the integral.

When the integral is greater than or equal to the upper saturation limit, the block holds the output at the upper saturation limit.

Use the **Limit output** parameter to specify whether to limit the
output at the lower bound, upper bound, or both. The **Limit output
source** parameter provides two ways of specifying the upper and lower
bounds:

`Internal`

— Define the saturation bounds using the**Upper limit**and**Lower limit**parameters.`External`

— Define the saturation bounds using the external physical signals at ports**U**and**L**.

## Examples

## Ports

### Input

### Output

## Parameters

## Extended Capabilities

## Version History

**Introduced in R2007a**