# Rate Limiter

Limit rate of change of signal

Discontinuities

## Description

The Rate Limiter block limits the first derivative of the signal passing through it. The output changes no faster than the specified limit. The derivative is calculated using this equation:`

`$rate=\frac{u\left(i\right)-y\left(i-1\right)}{t\left(i\right)-t\left(i-1\right)}$`

u(i) and t(i) are the current block input and time, and y(i–1) and t(i–1) are the output and time at the previous step. The output is determined by comparing rate to the Rising slew rate and Falling slew rate parameters:

• If rate is greater than the Rising slew rate parameter (R), the output is calculated as

`$y\left(i\right)=\Delta t\cdot R+y\left(i-1\right).$`
• If rate is less than the Falling slew rate parameter (F), the output is calculated as

`$y\left(i\right)=\Delta t\cdot F+y\left(i-1\right).$`
• If rate is between the bounds of R and F, the change in output is equal to the change in input:

`$y\left(i\right)=u\left(i\right)$`

When the block is running in continuous mode (for example, Sample time mode is `inherited` and Sample time of the driving block is zero), the Initial condition is ignored. The block output at ```t = 0``` is equal to the initial input:

`$y\left(0\right)=u\left(0\right)$`

When the block is running in discrete mode (for example, Sample time mode is `inherited` and Sample time of the driving block is nonzero), the Initial condition is preserved:

`$y\left(-1\right)=Ic$`

where Ic is the initial condition. The block output at `t = 0` is calculated as if rate is outside the bounds of R and F. For `t = 0`, rate is calculated as follows:

`$rate=\frac{u\left(0\right)-y\left(-1\right)}{sample\text{\hspace{0.17em}}time}$`
 Note:   You cannot use a Rate Limiter block inside a Triggered Subsystem. Use the Rate Limiter Dynamic block instead.

## Data Type Support

The Rate Limiter block accepts and outputs signals of any numeric data type that Simulink® supports, except `Boolean`. The Rate Limiter block supports fixed-point data types.

## Parameters and Dialog Box

Rising slew rate

Specify the limit of the derivative of an increasing input signal. This parameter is tunable for fixed-point inputs.

Falling slew rate

Specify the limit of the derivative of a decreasing input signal. This parameter is tunable for fixed-point inputs.

Sample time mode

Specify the sample time mode, `continuous` or `inherited` from the driving block.

Initial condition

Set the initial output of the simulation. Simulink software does not allow you to set the initial condition of this block to `inf` or `NaN`.

Treat as gain when linearizing

Linearization commands in Simulink software treat this block as a gain in state space. Select this check box to cause the linearization commands to treat the gain as 1; otherwise, the commands treat the gain as 0.

## Characteristics

 Data Types Double | Single| Base Integer | Fixed-Point Sample Time Continuous or inherited (specified in the Sample time mode parameter) Direct Feedthrough Yes Multidimensional Signals No Variable-Size Signals No Zero-Crossing Detection No Code Generation Yes