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 d
. The defining equation is:
where d
is the damping constant (parameter) and
This component extends from PartialCompliantWithRelativeStates
Usage
Damper(d)
Parameters:
Name | Description | Units | Default value |
---|---|---|---|
d | Damping coefficient, relating torque to relative angular velocity. | N.m.s/rad |
Connectors
Variables
Name | Description | Units |
---|---|---|
phi_rel | Relative rotation angle between spline_b and spline_a | rad |
tau | Torque transmitted between the splines | N.m |
w_rel | Relative angular velocity between splines | rad/s |
a_rel | Relative angular acceleration between splines | rad/s2 |
Behavior
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"
Related
Examples
Experiments
Analyses
Tests