Skip to content
MultiSensor.md

MultiSensor

Ideal sensor measuring absolute velocity, transmitted force, and power flow between two mechanical flanges.

This sensor measures key physical quantities between its two mechanical connection ports, flange_a and flange_b. It assumes an ideal connection where the positions of the flanges are identical (flange_a.s = flange_b.s). The component outputs:

  • The absolute velocity v of flange_a, calculated as v=d(flange_a.s)dt.

  • The force f transmitted from flange_a to flange_b, taken as f=flange_a.f.

  • The power power flowing from flange_a to flange_b, calculated as power=fv.

These quantities are made available as real output signals for monitoring or control purposes.

This component extends from PartialRelativeSensor

Usage

MultiSensor()

Connectors

  • flange_a - (Flange)

  • flange_b - (Flange)

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

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

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

Behavior

0=flange_b.f(t)+flange_a.f(t)flange_a.s(t)=flange_b.s(t)f(t)=flange_a.f(t)v(t)=dflange_a.s(t)dtpower(t)=v(t)f(t)

Source

dyad
# Ideal sensor measuring absolute velocity, transmitted force, and power flow between two mechanical flanges.
#
# This sensor measures key physical quantities between its two mechanical connection
# ports, `flange_a` and `flange_b`. It assumes an ideal connection where the positions
# of the flanges are identical (`flange_a.s = flange_b.s`). The component outputs:
# - The absolute velocity `v` of `flange_a`, calculated as $v = \frac{d(flange\_a.s)}{dt}$.
# - The force `f` transmitted from `flange_a` to `flange_b`, taken as $f = flange\_a.f$.
# - The power `power` flowing from `flange_a` to `flange_b`, calculated as $power = f \cdot v$.
# These quantities are made available as real output signals for monitoring or control purposes.
component MultiSensor
  extends PartialRelativeSensor
  # Power flowing from `flange_a` to `flange_b` as output signal
  power = RealOutput() [{
    "Dyad": {
      "placement": {"icon": {"x1": 175, "y1": 950, "x2": 275, "y2": 1050, "rot": 90}}
    }
  }]
  # Force transmitted from `flange_a` to `flange_b` as output signal
  f = RealOutput() [{
    "Dyad": {
      "placement": {"icon": {"x1": 450, "y1": 950, "x2": 550, "y2": 1050, "rot": 90}}
    }
  }]
  # Absolute velocity of `flange_a` as output signal
  v = RealOutput() [{
    "Dyad": {
      "placement": {"icon": {"x1": 725, "y1": 950, "x2": 825, "y2": 1050, "rot": 90}}
    }
  }]
relations
  flange_a.s = flange_b.s
  f = flange_a.f
  v = der(flange_a.s)
  power = f*v
end
Flattened Source
dyad
# Ideal sensor measuring absolute velocity, transmitted force, and power flow between two mechanical flanges.
#
# This sensor measures key physical quantities between its two mechanical connection
# ports, `flange_a` and `flange_b`. It assumes an ideal connection where the positions
# of the flanges are identical (`flange_a.s = flange_b.s`). The component outputs:
# - The absolute velocity `v` of `flange_a`, calculated as $v = \frac{d(flange\_a.s)}{dt}$.
# - The force `f` transmitted from `flange_a` to `flange_b`, taken as $f = flange\_a.f$.
# - The power `power` flowing from `flange_a` to `flange_b`, calculated as $power = f \cdot v$.
# These quantities are made available as real output signals for monitoring or control purposes.
component MultiSensor
  # 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}}}}]
  # Power flowing from `flange_a` to `flange_b` as output signal
  power = RealOutput() [{
    "Dyad": {
      "placement": {"icon": {"x1": 175, "y1": 950, "x2": 275, "y2": 1050, "rot": 90}}
    }
  }]
  # Force transmitted from `flange_a` to `flange_b` as output signal
  f = RealOutput() [{
    "Dyad": {
      "placement": {"icon": {"x1": 450, "y1": 950, "x2": 550, "y2": 1050, "rot": 90}}
    }
  }]
  # Absolute velocity of `flange_a` as output signal
  v = RealOutput() [{
    "Dyad": {
      "placement": {"icon": {"x1": 725, "y1": 950, "x2": 825, "y2": 1050, "rot": 90}}
    }
  }]
relations
  0 = flange_a.f+flange_b.f
  flange_a.s = flange_b.s
  f = flange_a.f
  v = der(flange_a.s)
  power = f*v
metadata {}
end


Test Cases

This is setup code, that must be run before each test case.

julia
using TranslationalComponents
using ModelingToolkit, OrdinaryDiffEqDefault
using Plots
using CSV, DataFrames

snapshotsdir = joinpath(dirname(dirname(pathof(TranslationalComponents))), "test", "snapshots")
"/home/actions-runner-10/.julia/packages/TranslationalComponents/khJb7/test/snapshots"
  • Examples

  • Experiments

  • Analyses