Skip to content
Damper.md

Damper

Linear translational damper relating force to relative velocity.

This component represents an ideal linear translational mechanical damper. The force f generated by the damper is proportional to the relative velocity v_{rel} between its two mechanical flanges. The constant of proportionality is the translational damping coefficient d. The force always acts to oppose the relative motion between the flanges. The component also calculates the instantaneous power lossPower dissipated by the damping action. The defining equations are:

f=dvrellossPower=fvrel=dvrel2

This component extends from PartialCompliantWithRelativeStates

Usage

Damper(d)

Parameters:

NameDescriptionUnitsDefault value
dTranslational damping coefficient relating force to relative velocityN.s/m

Connectors

Variables

NameDescriptionUnits
s_relRelative displacement between flange_b and flange_a (flange_b.s - flange_a.s).m
v_relRelative velocity between flange_b and flange_a, defined as der(s_rel).m/s
fInternal force exerted by the compliant element between the flanges.N
lossPowerInstantaneous power dissipated by the damperW

Behavior

s_rel(t)=flange_b.s(t)flange_a.s(t)v_rel(t)=ds_rel(t)dtflange_b.f(t)=f(t)flange_a.f(t)=f(t)f(t)=dv_rel(t)lossPower(t)=v_rel(t)f(t)

Source

dyad
# Linear translational damper relating force to relative velocity.
#
# This component represents an ideal linear translational mechanical damper.
# The force `f` generated by the damper is proportional to the relative velocity `v_{rel}` between its two mechanical flanges.
# The constant of proportionality is the translational damping coefficient `d`.
# The force always acts to oppose the relative motion between the flanges.
# The component also calculates the instantaneous power `lossPower` dissipated by the damping action.
# The defining equations are:
# ```math
# f = d \cdot v_{rel}
# ```
# ```math
# lossPower = f \cdot v_{rel} = d \cdot v_{rel}^2
# ```
component Damper
  extends PartialCompliantWithRelativeStates
  # Translational damping coefficient relating force to relative velocity
  parameter d::TranslationalDampingConstant
  # Instantaneous power dissipated by the damper
  variable lossPower::Power
relations
  f = d*v_rel
  lossPower = f*v_rel
metadata {"Dyad": {"icons": {"default": "dyad://TranslationalComponents/Damper.svg"}}}
end
Flattened Source
dyad
# Linear translational damper relating force to relative velocity.
#
# This component represents an ideal linear translational mechanical damper.
# The force `f` generated by the damper is proportional to the relative velocity `v_{rel}` between its two mechanical flanges.
# The constant of proportionality is the translational damping coefficient `d`.
# The force always acts to oppose the relative motion between the flanges.
# The component also calculates the instantaneous power `lossPower` dissipated by the damping action.
# The defining equations are:
# ```math
# f = d \cdot v_{rel}
# ```
# ```math
# lossPower = f \cdot v_{rel} = d \cdot v_{rel}^2
# ```
component Damper
  # Port for the first mechanical translational flange.
  flange_a = Flange() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
  # Port for the second mechanical translational flange.
  flange_b = Flange() [{"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}]
  # Relative displacement between flange_b and flange_a (flange_b.s - flange_a.s).
  variable s_rel::Distance
  # Relative velocity between flange_b and flange_a, defined as der(s_rel).
  variable v_rel::Velocity
  # Internal force exerted by the compliant element between the flanges.
  variable f::Dyad.Force
  # Translational damping coefficient relating force to relative velocity
  parameter d::TranslationalDampingConstant
  # Instantaneous power dissipated by the damper
  variable lossPower::Power
relations
  s_rel = flange_b.s-flange_a.s
  v_rel = der(s_rel)
  flange_b.f = f
  flange_a.f = -f
  f = d*v_rel
  lossPower = f*v_rel
metadata {"Dyad": {"icons": {"default": "dyad://TranslationalComponents/Damper.svg"}}}
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"