Skip to content
LIBRARY
Demux3.md

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

MultibodyComponents.Demux3()

Connectors

  • u_in - This connector represents a real signal as an input to a component (RealInput)

  • y1 - This connector represents a real signal as an output from a component (RealOutput)

  • y2 - This connector represents a real signal as an output from a component (RealOutput)

  • y3 - This connector represents a real signal as an output from a component (RealOutput)

Behavior

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
Flattened 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]
metadata {}
end


Test Cases

No test cases defined.

  • Examples

  • Experiments

  • Analyses