Skip to content
LIBRARY
SpringDamperParallel.md

SpringDamperParallel ​

Linear spring and linear damper in parallel acting as line force between frame_a and frame_b.

f = c * (s - s_unstretched) + d * D(s)

This component extends from PartialLineForce This component extends from Renderable

Usage ​

MultibodyComponents.SpringDamperParallel(s_small=1e-10, render=true, color=world_default_spring_color(), specular_coefficient=1.5, c=1.0, d=1.0, s_unstretched=0, radius=world_default_force_width(), num_windings=6, N=200, end_ratio=0.1)

Parameters: ​

NameDescriptionUnitsDefault value
fixed_rotation_at_frame_a–false
fixed_rotation_at_frame_b–false
s_small–1e-10
render–true
color–world_defau...ing_color()
specular_coefficient–1.5
cSpring constantN/m1.0
dDamping coefficientN.s/m1.0
s_unstretchedUnstretched spring lengthm0
radiusRadius in animations–world_defau...rce_width()
num_windingsNumber of windings in animations–6
NNumber of points used to render each winding–200
end_ratioFraction of total length used for the tapered ends–0.1

Connectors ​

  • frame_a - Frame3D is the fundamental 3D connector used for 6DOF motion. Most components have one or several Frame

connectors that can be connected together (Frame3D)

  • frame_b - Frame3D is the fundamental 3D connector used for 6DOF motion. Most components have one or several Frame

connectors that can be connected together (Frame3D)

Variables ​

NameDescriptionUnits
lengthDistance between the origin of frame_a and the origin of frame_bm
s(Guarded) distance between the origin of frame_a and the origin of frame_b (>= s_small))m
r_rel_0Position vector from frame_a to frame_b resolved in world framem
e_rel_0Unit vector in direction from frame_a to frame_b, resolved in world frame–
r_rel_aPosition vector from frame_a to frame_b, resolved in frame_am
e_aUnit vector from frame_a to frame_b, resolved in frame_a–
fScalar line force (positive = tension)N

Behavior ​

Dict{MIME{Symbol("text/plain")}, String} with 1 entry: MIME type text/plain => "Error displaying result"

Source ​

dyad
"""
Linear spring and linear damper in parallel acting as line force between
`frame_a` and `frame_b`.

`f = c * (s - s_unstretched) + d * D(s)`
"""
component SpringDamperParallel
  extends PartialLineForce
  extends Renderable(color = world_default_spring_color())
  # Visualization shape
  spring_shape = SpringShape(render = render, color = color, num_windings = num_windings, N = N, end_ratio = end_ratio, r = frame_a.r_0, length_direction = r_rel_0, length = s, width = radius)
  "Spring constant"
  parameter c::TranslationalSpringConstant = 1.0
  "Damping coefficient"
  parameter d::TranslationalDampingConstant = 1.0
  "Unstretched spring length"
  parameter s_unstretched::Length = 0
  "Radius in animations"
  parameter radius::Real = world_default_force_width()
  "Number of windings in animations"
  parameter num_windings::Real = 6
  "Number of points used to render each winding"
  parameter N::Integer = 200
  "Fraction of total length used for the tapered ends"
  parameter end_ratio::Real = 0.1
relations
  f = c * (s - s_unstretched) + d * der(s)
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/SpringDamper.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 100,
        "rot": 0,
        "attrs": {"font-size": "160"}
      }
    ]
  }
}
end
Flattened Source
dyad
"""
Linear spring and linear damper in parallel acting as line force between
`frame_a` and `frame_b`.

`f = c * (s - s_unstretched) + d * D(s)`
"""
component SpringDamperParallel
  frame_a = Frame3D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 450, "x2": 50, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  frame_b = Frame3D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 950, "y1": 450, "x2": 1050, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  structural parameter fixed_rotation_at_frame_a::Boolean = false
  structural parameter fixed_rotation_at_frame_b::Boolean = false
  parameter s_small::Real = 1e-10
  "Distance between the origin of frame_a and the origin of frame_b"
  variable length::Length
  "(Guarded) distance between the origin of frame_a and the origin of frame_b (>= s_small))"
  variable s::Length
  "Position vector from frame_a to frame_b resolved in world frame"
  variable r_rel_0::Position[3]
  "Unit vector in direction from frame_a to frame_b, resolved in world frame"
  variable e_rel_0::Real[3]
  "Position vector from frame_a to frame_b, resolved in frame_a"
  variable r_rel_a::Position[3]
  "Unit vector from frame_a to frame_b, resolved in frame_a"
  variable e_a::Real[3]
  "Scalar line force (positive = tension)"
  variable f::Dyad.Force
  parameter render::Boolean = true
  parameter color::Real[4] = [0.5, 0.5, 0.5, 1.0]
  parameter specular_coefficient::Real = 1.5
  # Visualization shape
  spring_shape = SpringShape(render = render, color = color, num_windings = num_windings, N = N, end_ratio = end_ratio, r = frame_a.r_0, length_direction = r_rel_0, length = s, width = radius)
  "Spring constant"
  parameter c::TranslationalSpringConstant = 1.0
  "Damping coefficient"
  parameter d::TranslationalDampingConstant = 1.0
  "Unstretched spring length"
  parameter s_unstretched::Length = 0
  "Radius in animations"
  parameter radius::Real = world_default_force_width()
  "Number of windings in animations"
  parameter num_windings::Real = 6
  "Number of points used to render each winding"
  parameter N::Integer = 200
  "Fraction of total length used for the tapered ends"
  parameter end_ratio::Real = 0.1
relations
  # Relative position and distance
  r_rel_0 = frame_b.r_0 - frame_a.r_0
  length = norm_(r_rel_0)
  assert(length > s_small, "The distance between the origin of frame_a and the origin of frame_b of a line force component became smaller than parameter s_small.")
  s = max(length, s_small)
  e_rel_0 = r_rel_0 / s
  # frame_a: fix rotation to identity or set tau = 0
  if fixed_rotation_at_frame_a
    frame_a.R = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
  else
    frame_a.tau = [0, 0, 0]
  end
  # frame_b: fix rotation to identity or set tau = 0
  if fixed_rotation_at_frame_b
    frame_b.R = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
  else
    frame_b.tau = [0, 0, 0]
  end
  r_rel_a = resolve2(frame_a.R, r_rel_0)
  e_a = r_rel_a / s
  frame_a.f = -e_a * f
  frame_b.f = -resolve2(frame_b.R, resolve1(frame_a.R, frame_a.f))
  f = c * (s - s_unstretched) + d * der(s)
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/SpringDamper.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 100,
        "rot": 0,
        "attrs": {"font-size": "160"}
      }
    ]
  }
}
end


Test Cases ​

No test cases defined.

  • Examples

  • Experiments

  • Analyses