s_rel$(instance)RelativePositionSensor Icon

RelativePositionSensor

Measures the ideal relative translational position between two mechanical flanges.

This component calculates the translational position of flange_b with respect to flange_a. It provides this relative position as an output signal s_rel. The sensor is considered ideal because it does not exert any forces on the flanges it connects to, meaning it does not influence the dynamics of the mechanical system. This is enforced by the equation flange_a.f = 0. The primary relationship is:

\[s_{rel} = flange_b.s - flange_a.s\]

where s_{rel} is the relative position, flange_b.s is the absolute position of flange_b, and flange_a.s is the absolute position of flange_a.

PartialRelativeSensor

Usage

RelativePositionSensor()

Connectors

  • flange_a - This connector represents a mechanical flange with position and force as the potential and flow variables, respectively. (Flange)
  • flange_b - This connector represents a mechanical flange with position and force as the potential and flow variables, respectively. (Flange)
  • s_rel - This connector represents a real signal as an output from a component (RealOutput)

Behavior

\[ \begin{align} 0 &= \mathtt{flange\_b.f}\left( t \right) + \mathtt{flange\_a.f}\left( t \right) \\ \mathtt{s\_rel}\left( t \right) &= \mathtt{flange\_b.s}\left( t \right) - \mathtt{flange\_a.s}\left( t \right) \\ 0 &= \mathtt{flange\_a.f}\left( t \right) \end{align} \]

Source

# Measures the ideal relative translational position between two mechanical flanges.
#
# This component calculates the translational position of `flange_b` with respect to `flange_a`.
# It provides this relative position as an output signal `s_rel`. The sensor is considered
# ideal because it does not exert any forces on the flanges it connects to, meaning it
# does not influence the dynamics of the mechanical system. This is enforced by the
# equation `flange_a.f = 0`. The primary relationship is:
# ```math
# s_{rel} = flange_b.s - flange_a.s
# ```
# where `s_{rel}` is the relative position, `flange_b.s` is the absolute position of `flange_b`,
# and `flange_a.s` is the absolute position of `flange_a`.
component RelativePositionSensor
  extends PartialRelativeSensor
  # Relative position of `flange_b` relative to `flange_a` as output signal
  s_rel = RealOutput() [{
    "Dyad": {
      "placement": {"icon": {"x1": 450, "y1": 950, "x2": 550, "y2": 1050, "rot": 90}}
    }
  }]
relations
  s_rel = flange_b.s-flange_a.s
  0 = flange_a.f
metadata {
  "Dyad": {"icons": {"default": "dyad://TranslationalComponents/RelativeSensor.svg"}}
}
end
Flattened Source
# Measures the ideal relative translational position between two mechanical flanges.
#
# This component calculates the translational position of `flange_b` with respect to `flange_a`.
# It provides this relative position as an output signal `s_rel`. The sensor is considered
# ideal because it does not exert any forces on the flanges it connects to, meaning it
# does not influence the dynamics of the mechanical system. This is enforced by the
# equation `flange_a.f = 0`. The primary relationship is:
# ```math
# s_{rel} = flange_b.s - flange_a.s
# ```
# where `s_{rel}` is the relative position, `flange_b.s` is the absolute position of `flange_b`,
# and `flange_a.s` is the absolute position of `flange_a`.
component RelativePositionSensor
  # Negative connection flange of the sensor, often considered the reference point.
  flange_a = Flange() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
  # Positive connection flange of the sensor, where the measurement is taken relative to flange_a.
  flange_b = Flange() [{"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}]
  # Relative position of `flange_b` relative to `flange_a` as output signal
  s_rel = RealOutput() [{
    "Dyad": {
      "placement": {"icon": {"x1": 450, "y1": 950, "x2": 550, "y2": 1050, "rot": 90}}
    }
  }]
relations
  0 = flange_a.f+flange_b.f
  s_rel = flange_b.s-flange_a.s
  0 = flange_a.f
metadata {
  "Dyad": {"icons": {"default": "dyad://TranslationalComponents/RelativeSensor.svg"}}
}
end


Test Cases

No test cases defined.