---
url: /dyad/stable/stdlib/BlockComponents/components/Continuous.Integrator.md
description: >-
  Dyad Continuous.Integrator docs.  Integrates the input signal with optional
  gain factor.
---

# `Continuous.Integrator` {#Continuous.Integrator}

Integrates the input signal with optional gain factor.

An integrator that computes the time integral of the input signal multiplied by a gain factor. The block implements the transfer function 1/s scaled by gain k.

$$y(t) = \int\_{t_0}^{t} k \cdot u(\tau) d\tau + x_0$$

Outputs `y = ∫k*u dt`, corresponding to the transfer function `\frac{1}{s}`.

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

## Usage {#Usage}

`BlockComponents.Continuous.Integrator(x0=0, k=1.0)`

## Parameters: {#Parameters:}

| Name |                                               Description | Units | Default value |
| ----:| ---------------------------------------------------------:| -----:| -------------:|
| `x0` | Initial value of the integrator state at simulation start |     – |             0 |
|  `k` |       Gain factor applied to the input before integration |     – |           1.0 |

## 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))

## Variables {#Variables}

| Name |                                              Description | Units |
| ----:| --------------------------------------------------------:| -----:|
|  `x` | Internal state variable that stores the integrated value |     – |

## Behavior {#Behavior}

$$ \begin{align}
\frac{\mathrm{d}x\left( t \right)}{\mathrm{d}t} &= k ~ u\left( t \right) \\
y\left( t \right) &= x\left( t \right)
\end{align}
$$

## Source {#Source}

````dyad
"""
Integrates the input signal with optional gain factor.

An integrator that computes the time integral of the input signal multiplied by a gain factor.
The block implements the transfer function 1/s scaled by gain k.

```math
y(t) = \int_{t_0}^{t} k \cdot u(\tau) d\tau + x_0
```

Outputs `y = ∫k*u dt`, corresponding to the transfer function `\frac{1}{s}`.
"""
component Integrator
  extends BlockComponents.Interfaces.SISO
  "Internal state variable that stores the integrated value"
  variable x::Real(stateSelect = StateSelect.Prefer)
  "Initial value of the integrator state at simulation start"
  parameter x0::Real = 0
  "Gain factor applied to the input before integration"
  parameter k::Real = 1.0
relations
  initial x = x0
  der(x) = k * u
  y = x
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://BlockComponents/Integrator.svg"}
  }
}
end
````

````dyad
"""
Integrates the input signal with optional gain factor.

An integrator that computes the time integral of the input signal multiplied by a gain factor.
The block implements the transfer function 1/s scaled by gain k.

```math
y(t) = \int_{t_0}^{t} k \cdot u(\tau) d\tau + x_0
```

Outputs `y = ∫k*u dt`, corresponding to the transfer function `\frac{1}{s}`.
"""
component Integrator
  "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}
      }
    }
  }
  "Internal state variable that stores the integrated value"
  variable x::Real(stateSelect = StateSelect.Prefer)
  "Initial value of the integrator state at simulation start"
  parameter x0::Real = 0
  "Gain factor applied to the input before integration"
  parameter k::Real = 1.0
relations
  initial x = x0
  der(x) = k * u
  y = x
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://BlockComponents/Integrator.svg"}
  }
}
end
````

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses

* Tests
  * [`Chirp`](Continuous.Integrator.md)

  * [`ContinuousClock`](Continuous.Integrator.md)

  * [`Cosine`](Continuous.Integrator.md)

  * [`CosineModes`](Continuous.Integrator.md)

  * [`DerivativeIntegratorTerminator`](Continuous.Integrator.md)

  * [`ExpSine`](Continuous.Integrator.md)

  * [`ExpSineModes`](Continuous.Integrator.md)

  * [`KinematicPTP`](Continuous.Integrator.md)

  * [`Limiter`](Continuous.Integrator.md)

  * [`Pulse`](Continuous.Integrator.md)

  * [`Ramp`](Continuous.Integrator.md)

  * [`Sine`](Continuous.Integrator.md)

  * [`SineModes`](Continuous.Integrator.md)

  * [`Square`](Continuous.Integrator.md)

  * [`StateSpace`](Continuous.Integrator.md)

  * [`Triangular`](Continuous.Integrator.md)
