---
url: /dyad/dev/stdlib/MultibodyComponents/components/Demux3.md
description: >-
  Dyad Demux3 docs.  Split a 3-element vector into three scalar outputs. Used in
  ControlledRotorCraft to expose y_pos[1..3] as named scalar ports so the PID
  meas...
---

# `Demux3` {#Demux3}

Split a 3-element vector into three scalar outputs. Used in `ControlledRotorCraft` to expose `y_pos[1..3]` as named scalar ports so the PID measurements connect through a labelled port instead of an indexed array element.

## Usage {#Usage}

`MultibodyComponents.Demux3()`

## Connectors {#Connectors}

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

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

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

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

## Behavior {#Behavior}

$$ \begin{align}
\mathtt{y1}\left( t \right) &= \mathtt{u_in}\_{1}\left( t \right) \\
\mathtt{y2}\left( t \right) &= \mathtt{u_in}\_{2}\left( t \right) \\
\mathtt{y3}\left( t \right) &= \mathtt{u_in}\_{3}\left( t \right)
\end{align}
$$

## Source {#Source}

```dyad
"""
Split a 3-element vector into three scalar outputs. Used in
`ControlledRotorCraft` to expose `y_pos[1..3]` as named scalar ports so the
PID measurements connect through a labelled port instead of an indexed
array element.
"""
component Demux3
  "3-element input vector"
  u_in = [RealInput() for i in 1:3] {
    "Dyad": {"placement": {"diagram": {"x1": -100, "x2": 0, "y1": 450, "y2": 550}}}
  }
  "First scalar output (= u_in[1])"
  y1 = RealOutput() {
    "Dyad": {"placement": {"diagram": {"x1": 1000, "x2": 1100, "y1": 140, "y2": 240}}}
  }
  "Second scalar output (= u_in[2])"
  y2 = RealOutput() {
    "Dyad": {"placement": {"diagram": {"x1": 1000, "x2": 1100, "y1": 450, "y2": 550}}}
  }
  "Third scalar output (= u_in[3])"
  y3 = RealOutput() {
    "Dyad": {"placement": {"diagram": {"x1": 1000, "x2": 1100, "y1": 730, "y2": 830}}}
  }
relations
  y1 = u_in[1]
  y2 = u_in[2]
  y3 = u_in[3]
end
```

```dyad
"""
Split a 3-element vector into three scalar outputs. Used in
`ControlledRotorCraft` to expose `y_pos[1..3]` as named scalar ports so the
PID measurements connect through a labelled port instead of an indexed
array element.
"""
component Demux3
  "3-element input vector"
  u_in = [RealInput() for i in 1:3] {
    "Dyad": {"placement": {"diagram": {"x1": -100, "x2": 0, "y1": 450, "y2": 550}}}
  }
  "First scalar output (= u_in[1])"
  y1 = RealOutput() {
    "Dyad": {"placement": {"diagram": {"x1": 1000, "x2": 1100, "y1": 140, "y2": 240}}}
  }
  "Second scalar output (= u_in[2])"
  y2 = RealOutput() {
    "Dyad": {"placement": {"diagram": {"x1": 1000, "x2": 1100, "y1": 450, "y2": 550}}}
  }
  "Third scalar output (= u_in[3])"
  y3 = RealOutput() {
    "Dyad": {"placement": {"diagram": {"x1": 1000, "x2": 1100, "y1": 730, "y2": 830}}}
  }
relations
  y1 = u_in[1]
  y2 = u_in[2]
  y3 = u_in[3]
metadata {}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses
