Skip to content
LIBRARY
Sources.Speed.md

Sources.Speed

Deprecated alias for VelocitySource.

Speed has been renamed to VelocitySource to align the Translational library naming with the Dyad mechanical libraries. This alias is retained so existing models keep working; use TranslationalComponents.Sources.VelocitySource in new models.

This component extends from TranslationalComponents.Sources.VelocitySource

Usage

TranslationalComponents.Sources.Speed()

Parameters:

NameDescriptionUnitsDefault value
ref_typeType of reference signal handlingTranslation....Filtered()

Connectors

  • flange - This connector represents a mechanical flange with position and force as the potential and flow variables, respectively. (Flange)

  • support - This connector represents a mechanical flange with position and force as the potential and flow variables, respectively. (Flange)

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

Variables

NameDescriptionUnits
sDistance between flange and support (= flange.s - support.s)m
vVelocity of flange with respect to supportm/s
aAcceleration of flange with respect to supportm/s2

Behavior

julia
using TranslationalComponents #hide
using ModelingToolkit #hide
@named sys = TranslationalComponents.Sources.Speed() #hide
let eqs = full_equations(sys); Base.length(eqs) > 25 ? nothing : eqs end #hide
<< @example-block not executed in draft mode >>

Source

dyad
"""
Deprecated alias for `VelocitySource`.

`Speed` has been renamed to `VelocitySource` to align the Translational library naming
with the Dyad mechanical libraries. This alias is retained so existing models keep
working; use `TranslationalComponents.Sources.VelocitySource` in new models.
"""
component Speed
  extends TranslationalComponents.Sources.VelocitySource
relations
metadata {
  "Dyad": {
    "icons": {"default": "dyad://TranslationalComponents/VelocitySource.svg"},
    "deprecated": {
      "message": "`Speed` has been renamed to `VelocitySource`. Use `TranslationalComponents.Sources.VelocitySource` instead.",
      "hotfix": {"action": "replace", "value": "TranslationalComponents.Sources.VelocitySource"}
    }
  }
}
end
Flattened Source
dyad
"""
Deprecated alias for `VelocitySource`.

`Speed` has been renamed to `VelocitySource` to align the Translational library naming
with the Dyad mechanical libraries. This alias is retained so existing models keep
working; use `TranslationalComponents.Sources.VelocitySource` in new models.
"""
component Speed
  "Flange of component"
  flange = Flange() {"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}
  "Support/housing of component"
  support = Flange() {"Dyad": {"placement": {"icon": {"x1": 450, "y1": 950, "x2": 550, "y2": 1050}}}}
  "Distance between flange and support (= flange.s - support.s)"
  variable s::Length
  "Reference speed of flange as input signal"
  v_ref = RealInput(units = "m/s") {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}
  "Type of reference signal handling"
  structural parameter ref_type::TranslationalComponents.Sources.ReferenceType = TranslationalComponents.Sources.ReferenceType.Filtered()
  "Velocity of flange with respect to support"
  variable v::Velocity(statePriority = 50)
  "Acceleration of flange with respect to support"
  variable a::Acceleration
relations
  s = flange.s - support.s
  support.f = -flange.f
  v = der(s)
  switch ref_type
    case Exact
      v = v_ref
      a = 0
    case Filtered
      initial v = v_ref
      a = der(v)
      a = (v_ref - v) * 2 * π * getproperty(ref_type, Symbol("f_crit"))
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://TranslationalComponents/VelocitySource.svg"},
    "deprecated": {
      "message": "`Speed` has been renamed to `VelocitySource`. Use `TranslationalComponents.Sources.VelocitySource` instead.",
      "hotfix": {"action": "replace", "value": "TranslationalComponents.Sources.VelocitySource"}
    }
  }
}
end


Test Cases

No test cases defined.