> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/rt-lab/simulink-blocks-reference/rt-events-library/rte-integrator.md).

# RTE Integrator

## Description

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-d5a5d37449374cfd817e671866345bec34c92c41%2FRTE_integrator.png?alt=media" alt="" width="96"><figcaption></figcaption></figure>

The **RTE Integrator** block, located in the **RT-EVENTS/Discrete** library, integrates the input signal and compensates for discrete-time error caused by discrete reset events occurring between sampling points. The block output is the integral of the input.

**Capabilities:**

* Select the integration method.
* Reset the integrator based on a reset input.
* Set initial conditions and choose their source.
* Apply upper and lower output limits.

**Integration methods**

For step k, Simulink updates output y(k) and state x(k+1), with Ts as the sampling period. Values are clipped according to the upper and lower limits. The initial output is always the initial condition.

* Trapezoidal: Approximates 1/s by Ts/2\*(z+1)/(z-1). Inputs have direct feedthrough.
* RT-EVENTS: Approximates 1/s using a proprietary relation. Inputs have non-direct feedthrough, allowing direct connection of this block’s outputs to its inputs in loops without adding another non-direct feedthrough block.

**Reset behavior**

The block can reset its state to zero (or to the initial condition) using an RTE Boolean reset signal. Select rising to reset on a rising edge, falling to reset on a falling edge, or either to reset on either edge. Level is also available.

**Initial conditions**

Set the Initial condition source to internal to enter a value in the Initial condition parameter, or to external to provide it via an input port.

{% hint style="info" %}
Set Initial condition source to external, an additional input appears.
{% endhint %}

**Output limiting**

Select Limit output and specify Upper saturation limit and Lower saturation limit to use the block as a limited integrator. When the output is outside the limits, the integral action is disabled to prevent windup.

## Mask parameters

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-86d2a8a99cba2ae8996decee7fc9710bf472f8ed%2FRTE_integrator_mask.png?alt=media" alt="" width="316"><figcaption></figcaption></figure>

<table><thead><tr><th width="240.4000244140625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Integrator Method</strong></td><td>The integration method. The default is Trapezoidal.</td></tr><tr><td><strong>External Reset</strong></td><td>Resets the states to zero or to their initial conditions when a trigger event (rising, falling, either, level) occurs in the RTE Boolean reset signal.</td></tr><tr><td><strong>Initial Condition Source</strong></td><td>Gets the states' initial conditions from the Initial condition parameter (if set to internal) or from an external block (if set to external).</td></tr><tr><td><strong>Initial Condition</strong></td><td>The states' initial conditions. Set the Initial condition source parameter value to internal.</td></tr><tr><td><strong>Limit Output</strong></td><td>If checked, limits the block's output to a value between the Lower saturation limit and Upper saturation limit parameters.</td></tr><tr><td><strong>Upper Saturation Limit</strong></td><td>The upper limit for the integral. The default is inf.</td></tr><tr><td><strong>Lower Saturation Limit</strong></td><td>The lower limit for the integral. The default is -inf.</td></tr><tr><td><strong>Sample time</strong></td><td>The time interval between samples.</td></tr></tbody></table>

## Inputs

<table><thead><tr><th width="240.39996337890625">Input</th><th>Description</th></tr></thead><tbody><tr><td><strong>Input (Double)</strong></td><td>Signal to integrate.</td></tr><tr><td><strong>Reset (RTE Boolean)</strong></td><td>RTE Boolean signal used to reset the state of the integrator.</td></tr><tr><td><strong>Initial Condition (Double)</strong></td><td>The states' initial condition. Set the Initial condition source parameter value to external.</td></tr></tbody></table>

## Outputs

<table><thead><tr><th width="239.60003662109375">Output</th><th>Description</th></tr></thead><tbody><tr><td><strong>Output (Double)</strong></td><td>Integral of the input.</td></tr></tbody></table>

## Characteristics and limitations

| Characteristic     | Value                                                |
| ------------------ | ---------------------------------------------------- |
| Direct Feedthrough | Yes for trapezoidal method. No for RT-EVENTS method. |
| Sample Time        | Fixed discrete.                                      |
| Work offline       | Yes                                                  |
| Dimensionalized    | Yes                                                  |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/rt-lab/simulink-blocks-reference/rt-events-library/rte-integrator.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
