Skip to content
LIBRARY
tests.PointMassPendulum.md

tests.PointMassPendulum

A PointMass pendulum next to an equivalent zero-inertia Body pendulum.

Both chains are a revolute joint plus a massless rod carrying a lumped mass at the tip, released from the same angle. A point mass is exactly a Body with a zero inertia tensor and no centre-of-mass offset, so the two must move identically – and the PointMass must transmit no torque through its frame.

Here isroot stays at its default false: the point mass reads its frame orientation from the rod it hangs on.

Usage

MultibodyComponents.tests.PointMassPendulum()

Behavior

Source

dyad
"""
A `PointMass` pendulum next to an equivalent zero-inertia `Body` pendulum.

Both chains are a revolute joint plus a massless rod carrying a lumped mass at
the tip, released from the same angle. A point mass is exactly a `Body` with a
zero inertia tensor and no centre-of-mass offset, so the two must move
identically -- and the `PointMass` must transmit no torque through its frame.

Here `isroot` stays at its default `false`: the point mass reads its frame
orientation from the rod it hangs on.
"""
example component PointMassPendulum
  world = MultibodyComponents.World() {}
  # PointMass chain
  rev1 = MultibodyComponents.Revolute(n = [0, 0, 1], phi(initial = 0.5), w(initial = 0)) {}
  rod1 = MultibodyComponents.FixedTranslation(r = [1, 0, 0]) {}
  pm = MultibodyComponents.PointMass(m = 1) {}
  # Reference chain: zero-inertia Body, anchored slightly below so both render
  anchor = MultibodyComponents.Fixed(r = [0, -0.3, 0]) {}
  rev2 = MultibodyComponents.Revolute(n = [0, 0, 1], phi(initial = 0.5), w(initial = 0)) {}
  rod2 = MultibodyComponents.FixedTranslation(r = [1, 0, 0]) {}
  bd = MultibodyComponents.Body(m = 1, r_cm = [0, 0, 0], I_11 = 0, I_22 = 0, I_33 = 0) {}
relations
  connect(world.frame_b, rev1.frame_a) {}
  connect(rev1.frame_b, rod1.frame_a) {}
  connect(rod1.frame_b, pm.frame_a) {}
  connect(anchor.frame_b, rev2.frame_a) {}
  connect(rev2.frame_b, rod2.frame_a) {}
  connect(rod2.frame_b, bd.frame_a) {}
end
Flattened Source
dyad
"""
A `PointMass` pendulum next to an equivalent zero-inertia `Body` pendulum.

Both chains are a revolute joint plus a massless rod carrying a lumped mass at
the tip, released from the same angle. A point mass is exactly a `Body` with a
zero inertia tensor and no centre-of-mass offset, so the two must move
identically -- and the `PointMass` must transmit no torque through its frame.

Here `isroot` stays at its default `false`: the point mass reads its frame
orientation from the rod it hangs on.
"""
example component PointMassPendulum
  world = MultibodyComponents.World() {}
  # PointMass chain
  rev1 = MultibodyComponents.Revolute(n = [0, 0, 1], phi(initial = 0.5), w(initial = 0)) {}
  rod1 = MultibodyComponents.FixedTranslation(r = [1, 0, 0]) {}
  pm = MultibodyComponents.PointMass(m = 1) {}
  # Reference chain: zero-inertia Body, anchored slightly below so both render
  anchor = MultibodyComponents.Fixed(r = [0, -0.3, 0]) {}
  rev2 = MultibodyComponents.Revolute(n = [0, 0, 1], phi(initial = 0.5), w(initial = 0)) {}
  rod2 = MultibodyComponents.FixedTranslation(r = [1, 0, 0]) {}
  bd = MultibodyComponents.Body(m = 1, r_cm = [0, 0, 0], I_11 = 0, I_22 = 0, I_33 = 0) {}
relations
  connect(world.frame_b, rev1.frame_a) {}
  connect(rev1.frame_b, rod1.frame_a) {}
  connect(rod1.frame_b, pm.frame_a) {}
  connect(anchor.frame_b, rev2.frame_a) {}
  connect(rev2.frame_b, rod2.frame_a) {}
  connect(rod2.frame_b, bd.frame_a) {}
metadata {}
end


Test Cases

No test cases defined.

  • Examples

  • Experiments

  • Analyses