$(instance)SpringDamper Icon

SpringDamper

Linear 1D rotational spring and damper

This component extends from PartialCompliantWithRelativeStates

Usage

SpringDamper(d, c, phi_rel0=0.0)

Parameters:

NameDescriptionUnitsDefault value
dDamping constantN.m.s/rad
cSpring constantN.m/rad
phi_rel0Unstretched spring anglerad0

Connectors

Variables

NameDescriptionUnits
phi_relRelative rotation angle between splinesrad
tauTorque between splinesN.m
w_relRelative angular velocity between splinesrad/s
a_relRelative angular acceleration between splinesrad/s2
tau_cSpring torqueN.m
tau_dDamper torqueN.m

Behavior

\[ \begin{align} \mathtt{phi\_rel}\left( t \right) &= \mathtt{spline\_b.phi}\left( t \right) - \mathtt{spline\_a.phi}\left( t \right) \\ \mathtt{spline\_b.tau}\left( t \right) &= \mathtt{tau}\left( t \right) \\ \mathtt{spline\_a.tau}\left( t \right) &= - \mathtt{tau}\left( t \right) \\ \frac{\mathrm{d} \mathtt{phi\_rel}\left( t \right)}{\mathrm{d}t} &= \mathtt{w\_rel}\left( t \right) \\ \frac{\mathrm{d} \mathtt{w\_rel}\left( t \right)}{\mathrm{d}t} &= \mathtt{a\_rel}\left( t \right) \\ \mathtt{tau\_c}\left( t \right) &= c \left( - \mathtt{phi\_rel0} + \mathtt{phi\_rel}\left( t \right) \right) \\ \mathtt{tau\_d}\left( t \right) &= d \mathtt{w\_rel}\left( t \right) \\ \mathtt{tau}\left( t \right) &= \mathtt{tau\_d}\left( t \right) + \mathtt{tau\_c}\left( t \right) \end{align} \]

Source

# Linear 1D rotational spring and damper
component SpringDamper
  extends PartialCompliantWithRelativeStates
  # Spring torque
  variable tau_c::Torque
  # Damper torque
  variable tau_d::Torque
  # Damping constant
  parameter d::RotationalDampingConstant
  # Spring constant
  parameter c::RotationalSpringConstant
  # Unstretched spring angle
  parameter phi_rel0::Angle = 0.0
relations
  tau_c = c*(phi_rel-phi_rel0)
  tau_d = d*w_rel
  tau = tau_c+tau_d
metadata {
  "JuliaSim": {"icons": {"default": "jsml://RotationalComponents/SpringDamper.svg"}}
}
end
Flattened Source
# Linear 1D rotational spring and damper
component SpringDamper
  spline_a = Spline() [{
    "JuliaSim": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}
  }]
  spline_b = Spline() [{
    "JuliaSim": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}
  }]
  # Relative rotation angle between splines
  variable phi_rel::Angle
  # Torque between splines
  variable tau::Torque
  # Relative angular velocity between splines
  variable w_rel::AngularVelocity
  # Relative angular acceleration between splines
  variable a_rel::AngularAcceleration
  # Spring torque
  variable tau_c::Torque
  # Damper torque
  variable tau_d::Torque
  # Damping constant
  parameter d::RotationalDampingConstant
  # Spring constant
  parameter c::RotationalSpringConstant
  # Unstretched spring angle
  parameter phi_rel0::Angle = 0.0
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_c = c*(phi_rel-phi_rel0)
  tau_d = d*w_rel
  tau = tau_c+tau_d
metadata {
  "JuliaSim": {"icons": {"default": "jsml://RotationalComponents/SpringDamper.svg"}}
}
end

Test Cases

  • Examples
  • Experiments
  • Analyses
This documentation is not for the latest stable release, but for either the development version or an older release.
Click here to go to the documentation for the latest stable release.