Skip to content
LIBRARY
tests.UniversalPendulum.md

tests.UniversalPendulum

Universal Pendulum

A pendulum using a Universal joint, ported from the Multibody.jl test suite. The universal joint connects the world frame to a bar with a body at the end, creating a two-degree-of-freedom pendulum.

Usage

MultibodyComponents.tests.UniversalPendulum()

Behavior

Source

dyad
"""
# Universal Pendulum

A pendulum using a Universal joint, ported from the Multibody.jl test suite.
The universal joint connects the world frame to a bar with a body at the end,
creating a two-degree-of-freedom pendulum.
"""
example component UniversalPendulum
  world = MultibodyComponents.World() {}
  joint = MultibodyComponents.Universal(phi_a(initial = sqrt(2)), phi_b(initial = 0), w_a(initial = 0), w_b(initial = 0)) {}
  bar = MultibodyComponents.FixedTranslation(r = [0, -1, 0]) {}
  body = MultibodyComponents.Body(m = 1, r_cm = [0.1, 0, 0]) {}
relations
  connect(world.frame_b, joint.frame_a) {}
  connect(joint.frame_b, bar.frame_a) {}
  connect(bar.frame_b, body.frame_a) {}
end
Flattened Source
dyad
"""
# Universal Pendulum

A pendulum using a Universal joint, ported from the Multibody.jl test suite.
The universal joint connects the world frame to a bar with a body at the end,
creating a two-degree-of-freedom pendulum.
"""
example component UniversalPendulum
  world = MultibodyComponents.World() {}
  joint = MultibodyComponents.Universal(phi_a(initial = sqrt(2)), phi_b(initial = 0), w_a(initial = 0), w_b(initial = 0)) {}
  bar = MultibodyComponents.FixedTranslation(r = [0, -1, 0]) {}
  body = MultibodyComponents.Body(m = 1, r_cm = [0.1, 0, 0]) {}
relations
  connect(world.frame_b, joint.frame_a) {}
  connect(joint.frame_b, bar.frame_a) {}
  connect(bar.frame_b, body.frame_a) {}
metadata {}
end


Test Cases

No test cases defined.

  • Examples

  • Experiments

  • Analyses