Skip to content
Damper.md

Damper

Models a linear rotational mechanical damping element where torque is proportional to relative angular velocity.

This component describes a viscous damper for 1D rotational systems. It generates a torque that opposes the relative motion between its two mechanical rotational ports (flanges). The relationship between the torque τ and the relative angular velocity wrel across the damper is linear and governed by the damping constant d. The defining equation is:

τ=dcdotwrel

where d is the damping constant (parameter) and wrel is the relative angular velocity between the component's flanges.

This component extends from PartialCompliantWithRelativeStates

Usage

Damper(d)

Parameters:

NameDescriptionUnitsDefault value
dDamping coefficient, relating torque to relative angular velocity.N.m.s/rad

Connectors

Variables

NameDescriptionUnits
phi_relRelative rotation angle between spline_b and spline_arad
tauTorque transmitted between the splinesN.m
w_relRelative angular velocity between splinesrad/s
a_relRelative angular acceleration between splinesrad/s2

Behavior

phi_rel(t)=spline_b.phi(t)spline_a.phi(t)spline_b.tau(t)=tau(t)spline_a.tau(t)=tau(t)dphi_rel(t)dt=w_rel(t)dw_rel(t)dt=a_rel(t)tau(t)=dw_rel(t)

Source

dyad
# Models a linear rotational mechanical damping element where torque is proportional to relative angular velocity.
#
# This component describes a viscous damper for 1D rotational systems. It generates a torque that opposes
# the relative motion between its two mechanical rotational ports (flanges). The relationship between the
# torque \$\tau\$ and the relative angular velocity \$w_{rel}\$ across the damper is linear and
# governed by the damping constant `d`. The defining equation is:
# ```math
# \tau = d \\cdot w_{rel}
# ```
# where `d` is the damping constant (parameter) and \$w_{rel}\$ is the relative angular velocity
# between the component's flanges.
component Damper
  extends PartialCompliantWithRelativeStates
  # Damping coefficient, relating torque to relative angular velocity.
  parameter d::RotationalDampingConstant
relations
  tau = d*w_rel
metadata {"Dyad": {"icons": {"default": "dyad://RotationalComponents/Damper.svg"}}}
end
Flattened Source
dyad
# Models a linear rotational mechanical damping element where torque is proportional to relative angular velocity.
#
# This component describes a viscous damper for 1D rotational systems. It generates a torque that opposes
# the relative motion between its two mechanical rotational ports (flanges). The relationship between the
# torque \$\tau\$ and the relative angular velocity \$w_{rel}\$ across the damper is linear and
# governed by the damping constant `d`. The defining equation is:
# ```math
# \tau = d \\cdot w_{rel}
# ```
# where `d` is the damping constant (parameter) and \$w_{rel}\$ is the relative angular velocity
# between the component's flanges.
component Damper
  # First rotational spline interface
  spline_a = Spline() [{"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}]
  # Second rotational spline interface
  spline_b = Spline() [{"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}]
  # Relative rotation angle between spline_b and spline_a
  variable phi_rel::Angle
  # Torque transmitted between the splines
  variable tau::Torque
  # Relative angular velocity between splines
  variable w_rel::AngularVelocity
  # Relative angular acceleration between splines
  variable a_rel::AngularAcceleration
  # Damping coefficient, relating torque to relative angular velocity.
  parameter d::RotationalDampingConstant
relations
  phi_rel = spline_b.phi-spline_a.phi
  spline_b.tau = tau
  spline_a.tau = -tau
  der(phi_rel) = w_rel
  der(w_rel) = a_rel
  tau = d*w_rel
metadata {"Dyad": {"icons": {"default": "dyad://RotationalComponents/Damper.svg"}}}
end


Test Cases

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

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

snapshotsdir = joinpath(dirname(dirname(pathof(RotationalComponents))), "test", "snapshots")
"/home/actions-runner-10/.julia/packages/RotationalComponents/0VPxm/test/snapshots"