---
url: /dyad/dev/stdlib/BlockComponents/components/Nonlinear.SlewRateLimiter.md
description: >-
  Dyad Nonlinear.SlewRateLimiter docs.  Limits the rate of change of a signal
  between specified rising and falling rates.
---

# `Nonlinear.SlewRateLimiter` {#Nonlinear.SlewRateLimiter}

Limits the rate of change of a signal between specified rising and falling rates.

A slew rate limiter that constrains how quickly the output signal can change in response to input variations. It ensures the derivative of the output remains between the specified maximum rising and falling rates. The output initially equals the input, and thereafter changes at a rate determined by the difference between input and output, scaled by the time derivative constant, and limited by the `rising` and `falling` rate parameters.

$$\frac{dy}{dt} = \text{clamp}\left(\frac{u-y}{td}, \text{falling}, \text{rising}\right)$$

This component extends from [`BlockComponents.Interfaces.SISO`](../types/Interfaces.SISO.md)

## Usage {#Usage}

`BlockComponents.Nonlinear.SlewRateLimiter(rising, falling=-rising, td)`

## Parameters: {#Parameters:}

|      Name |                                                     Description | Units | Default value |
| ---------:| ---------------------------------------------------------------:| -----:| -------------:|
|  `rising` | Maximum allowable positive rate of change for the output signal |   s-1 |               |
| `falling` | Maximum allowable negative rate of change for the output signal |   s-1 |       -rising |
|      `td` |   Time constant that scales the response speed to input changes |     s |               |

## Connectors {#Connectors}

* `u` - This connector represents a real signal as an input to a component ([`RealInput`](/stdlib/Dyad/connectors/RealInput#RealInput))

* `y` - This connector represents a real signal as an output from a component ([`RealOutput`](/stdlib/Dyad/connectors/RealOutput#RealOutput))

## Behavior {#Behavior}

$$ \begin{align}
\frac{\mathrm{d}y\left( t \right)}{\mathrm{d}t} &= clamp\left( \frac{u\left( t \right) - y\left( t \right)}{\mathtt{td}},  - \mathtt{rising}, \mathtt{rising} \right)
\end{align}
$$

## Source {#Source}

````dyad
"""
Limits the rate of change of a signal between specified rising and falling rates.

A slew rate limiter that constrains how quickly the output signal can change in response
to input variations. It ensures the derivative of the output remains between the specified
maximum rising and falling rates. The output initially equals the input, and thereafter
changes at a rate determined by the difference between input and output, scaled by the time
derivative constant, and limited by the `rising` and `falling` rate parameters.

```math
\frac{dy}{dt} = \text{clamp}\left(\frac{u-y}{td}, \text{falling}, \text{rising}\right)
```
"""
component SlewRateLimiter
  extends BlockComponents.Interfaces.SISO
  "Maximum allowable positive rate of change for the output signal"
  parameter rising::DecayConstant
  "Maximum allowable negative rate of change for the output signal"
  parameter falling::DecayConstant = -rising
  "Time constant that scales the response speed to input changes"
  parameter td::Time
relations
  initial y = u
  der(y) = clamp((u - y) / td, falling, rising)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://BlockComponents/SlewRateLimiter.svg"}
  }
}
end
````

````dyad
"""
Limits the rate of change of a signal between specified rising and falling rates.

A slew rate limiter that constrains how quickly the output signal can change in response
to input variations. It ensures the derivative of the output remains between the specified
maximum rising and falling rates. The output initially equals the input, and thereafter
changes at a rate determined by the difference between input and output, scaled by the time
derivative constant, and limited by the `rising` and `falling` rate parameters.

```math
\frac{dy}{dt} = \text{clamp}\left(\frac{u-y}{td}, \text{falling}, \text{rising}\right)
```
"""
component SlewRateLimiter
  "Input signal port"
  u = RealInput() {
    "Dyad": {
      "placement": {
        "icon": {"iconName": "input", "x1": -100, "y1": 450, "x2": 0, "y2": 550, "rot": 0},
        "diagram": {"iconName": "input", "x1": -100, "y1": 450, "x2": 0, "y2": 550, "rot": 0}
      }
    }
  }
  "Output signal port"
  y = RealOutput() {
    "Dyad": {
      "placement": {
        "icon": {"iconName": "output", "x1": 1000, "y1": 450, "x2": 1100, "y2": 550, "rot": 0},
        "diagram": {"iconName": "output", "x1": 1000, "y1": 450, "x2": 1100, "y2": 550, "rot": 0}
      }
    }
  }
  "Maximum allowable positive rate of change for the output signal"
  parameter rising::DecayConstant
  "Maximum allowable negative rate of change for the output signal"
  parameter falling::DecayConstant = -rising
  "Time constant that scales the response speed to input changes"
  parameter td::Time
relations
  initial y = u
  der(y) = clamp((u - y) / td, falling, rising)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://BlockComponents/SlewRateLimiter.svg"}
  }
}
end
````

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses

* Tests
  * [`Sine`](Nonlinear.SlewRateLimiter.md)

  * [`SlewRateLimiter`](Nonlinear.SlewRateLimiter.md)

  * [`SlewRateLimiter`](Nonlinear.SlewRateLimiter.md)
