---
url: /dyad/dev/stdlib/BlockComponents/components/Continuous.Plant.md
description: >-
  Dyad Continuous.Plant docs.  Second-order linear system for testing control
  designs.
---

# `Continuous.Plant` {#Continuous.Plant}

Second-order linear system for testing control designs.

A linear dynamic system with second-order behavior that exhibits damped oscillations in response to inputs.

The system is described by the state-space representation:

$$\begin{align}
\dot{x}\_1 &= x_2 \\
\dot{x}\_2 &= -x_1 - 0.5x_2 + u \\
y &= 0.5x_1 + x_2
\end{align}$$

where states `x1` and `x2` represent position and velocity in a mechanical system analogy.

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

## Usage {#Usage}

`BlockComponents.Continuous.Plant()`

## 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 |
| ----:| ------------------------------------------------------:| -----:|
| `x1` |  First state variable (position in mechanical analogy) |     – |
| `x2` | Second state variable (velocity in mechanical analogy) |     – |

## Behavior {#Behavior}

$$ \begin{align}
\frac{\mathrm{d}\mathtt{x1}\left( t \right)}{\mathrm{d}t} &= \mathtt{x2}\left( t \right) \\
\frac{\mathrm{d}\mathtt{x2}\left( t \right)}{\mathrm{d}t} &= u\left( t \right) - \mathtt{x1}\left( t \right) - 0.5 ~ \mathtt{x2}\left( t \right) \\
y\left( t \right) &= 0.5 ~ \mathtt{x1}\left( t \right) + \mathtt{x2}\left( t \right)
\end{align}
$$

## Source {#Source}

````dyad
"""
Second-order linear system for testing control designs.

A linear dynamic system with second-order behavior that exhibits damped oscillations in response to inputs.

The system is described by the state-space representation:

```math
\begin{align}
\dot{x}_1 &= x_2 \\
\dot{x}_2 &= -x_1 - 0.5x_2 + u \\
y &= 0.5x_1 + x_2
\end{align}
```

where states `x1` and `x2` represent position and velocity in a mechanical system analogy.
"""
component Plant
  extends BlockComponents.Interfaces.SISO
  "First state variable (position in mechanical analogy)"
  variable x1::Real
  "Second state variable (velocity in mechanical analogy)"
  variable x2::Real
relations
  der(x1) = x2
  der(x2) = -x1 - 0.5 * x2 + u
  y = 0.5 * x1 + x2
metadata {
  "Dyad": {
    "icons": {"default": "dyad://BlockComponents/SecondOrder.svg"},
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}]
  }
}
end
````

````dyad
"""
Second-order linear system for testing control designs.

A linear dynamic system with second-order behavior that exhibits damped oscillations in response to inputs.

The system is described by the state-space representation:

```math
\begin{align}
\dot{x}_1 &= x_2 \\
\dot{x}_2 &= -x_1 - 0.5x_2 + u \\
y &= 0.5x_1 + x_2
\end{align}
```

where states `x1` and `x2` represent position and velocity in a mechanical system analogy.
"""
component Plant
  "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}
      }
    }
  }
  "First state variable (position in mechanical analogy)"
  variable x1::Real
  "Second state variable (velocity in mechanical analogy)"
  variable x2::Real
relations
  der(x1) = x2
  der(x2) = -x1 - 0.5 * x2 + u
  y = 0.5 * x1 + x2
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://BlockComponents/SecondOrder.svg"}
  }
}
end
````

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses

* Tests
  * [`LimPID`](Continuous.Plant.md)

  * [`LimPIDExternalDerivative`](Continuous.Plant.md)

  * [`LimPIDPOnly`](Continuous.Plant.md)

  * [`LimPIDWithoutD`](Continuous.Plant.md)

  * [`LimPIDWithoutI`](Continuous.Plant.md)

  * [`PID`](Continuous.Plant.md)
