Skip to content
LIBRARY
PointMass.md

PointMass

Point mass: mass without an inertia tensor, with a single frame connector.

Equivalent to a Body with a zero inertia tensor and r_cm = [0,0,0], but cheaper: it carries no rotational quantities at all and transmits no torque.

Because a point mass has no orientation of its own it normally reads frame_a.R from whatever it is attached to. Set isroot = true only for a point mass whose frame_a is connected to nothing (a free-flying mass acted on by gravity alone): its frame orientation is then fixed to the world orientation, which is the only meaningful choice, and the torque equation is dropped in exchange (an unconnected connector's flows are zero anyway).

A rigid assembly built purely from PointMass and FixedTranslation – with no Body and no anchor to the world – has no component that owns its orientation and cannot be built here; give such an assembly a Body (with orientation_state Euler or Quaternion) or anchor it to the world instead.

linearStatePriority defaults to 0, i.e. no preference, which is Modelica's StateSelect.avoid on this library's scale (every other component declares a positive priority). Raise it for a free-flying mass whose position and velocity should be the state.

This component extends from Renderable

Usage

MultibodyComponents.PointMass(render=true, color=world_default_body_color(), specular_coefficient=1.5, m=1, radius=world_default_body_diameter() / 2)

Parameters:

NameDescriptionUnitsDefault value
isrootFix frame_a's orientation to the world orientation. Use only when frame_a is unconnected; see the component documentation.false
linearStatePriorityState priority of the position and velocity states0
point_gravityUse a point-gravity field pointing towards the world origin instead of the uniform field g*n. Structural: only the selected field model is emitted into the equations.false
rendertrue
colorworld_defau...ody_color()
specular_coefficient1.5
mmasskg1
radiusRadius of the sphere in animationsworld_defau...meter() / 2

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)

Variables

NameDescriptionUnits
r_0Position vector from origin of world frame to origin of frame_am
v_0Absolute velocity of frame_a, resolved in world frame (= D(r_0))m/s
a_0Absolute acceleration of frame_a resolved in world frame (= D(v_0))m/s2
g_0gravity accelerationm/s2

Behavior

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

Source

dyad
"""
Point mass: mass without an inertia tensor, with a single frame connector.

Equivalent to a `Body` with a zero inertia tensor and `r_cm = [0,0,0]`, but
cheaper: it carries no rotational quantities at all and transmits no torque.

Because a point mass has no orientation of its own it normally *reads* `frame_a.R`
from whatever it is attached to. Set `isroot = true` only for a point mass whose
`frame_a` is connected to nothing (a free-flying mass acted on by gravity alone):
its frame orientation is then fixed to the world orientation, which is the only
meaningful choice, and the torque equation is dropped in exchange (an unconnected
connector's flows are zero anyway).

A rigid assembly built purely from `PointMass` and `FixedTranslation` -- with no
`Body` and no anchor to the world -- has no component that owns its orientation
and cannot be built here; give such an assembly a `Body` (with `orientation_state`
`Euler` or `Quaternion`) or anchor it to the world instead.

`linearStatePriority` defaults to 0, i.e. no preference, which is Modelica's
`StateSelect.avoid` on this library's scale (every other component declares a
positive priority). Raise it for a free-flying mass whose position and velocity
should be the state.
"""
component PointMass
  extends Renderable(color = world_default_body_color())
  frame_a = Frame3D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 450, "x2": 50, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  sphere_shape = SphereShape(render = render, color = color, r = frame_a.r_0, R = transpose(frame_a.R), length = 2 * radius, width = 2 * radius, height = 2 * radius)
  "Fix frame_a's orientation to the world orientation. Use only when frame_a is unconnected; see the component documentation."
  structural parameter isroot::Boolean = false
  "State priority of the position and velocity states"
  structural parameter linearStatePriority::Integer = 0
  "Use a point-gravity field pointing towards the world origin instead of the uniform field `g*n`. Structural: only the selected field model is emitted into the equations."
  structural parameter point_gravity::Boolean = false
  "mass"
  parameter m::Mass = 1
  "Radius of the sphere in animations"
  parameter radius::Real = world_default_body_diameter() / 2
  "Position vector from origin of world frame to origin of frame_a"
  variable r_0::Position(statePriority = linearStatePriority, initial = isroot ? [0.0, 0, 0] : missing)[3]
  "Absolute velocity of frame_a, resolved in world frame (= D(r_0))"
  variable v_0::Velocity(statePriority = linearStatePriority, initial = isroot ? [0.0, 0, 0] : missing)[3]
  "Absolute acceleration of frame_a resolved in world frame (= D(v_0))"
  variable a_0::Acceleration[3]
  "gravity acceleration"
  variable g_0::Acceleration[3]
relations
  r_0 = frame_a.r_0
  v_0 = der(r_0)
  a_0 = der(v_0)
  g_0 = gravity_acceleration(r_0, point_gravity)
  # Newton's second law; f is resolved in frame_a, hence the resolve2
  frame_a.f = m * resolve2(frame_a.R, a_0 - g_0)
  if isroot
    # Root: own the orientation. The (necessarily unconnected) connector's zero
    # flows then supply frame_a.tau, as for an unconnected Body.
    frame_a.R = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
  else
    # A point mass transmits no torque; frame_a.R comes from the neighbour.
    frame_a.tau = [0, 0, 0]
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/PointMass.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 150,
        "rot": 0,
        "attrs": {"font-size": "160"}
      }
    ]
  }
}
end
Flattened Source
dyad
"""
Point mass: mass without an inertia tensor, with a single frame connector.

Equivalent to a `Body` with a zero inertia tensor and `r_cm = [0,0,0]`, but
cheaper: it carries no rotational quantities at all and transmits no torque.

Because a point mass has no orientation of its own it normally *reads* `frame_a.R`
from whatever it is attached to. Set `isroot = true` only for a point mass whose
`frame_a` is connected to nothing (a free-flying mass acted on by gravity alone):
its frame orientation is then fixed to the world orientation, which is the only
meaningful choice, and the torque equation is dropped in exchange (an unconnected
connector's flows are zero anyway).

A rigid assembly built purely from `PointMass` and `FixedTranslation` -- with no
`Body` and no anchor to the world -- has no component that owns its orientation
and cannot be built here; give such an assembly a `Body` (with `orientation_state`
`Euler` or `Quaternion`) or anchor it to the world instead.

`linearStatePriority` defaults to 0, i.e. no preference, which is Modelica's
`StateSelect.avoid` on this library's scale (every other component declares a
positive priority). Raise it for a free-flying mass whose position and velocity
should be the state.
"""
component PointMass
  parameter render::Boolean = true
  parameter color::Real[4] = [0.5, 0.5, 0.5, 1.0]
  parameter specular_coefficient::Real = 1.5
  frame_a = Frame3D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 450, "x2": 50, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  sphere_shape = SphereShape(render = render, color = color, r = frame_a.r_0, R = transpose(frame_a.R), length = 2 * radius, width = 2 * radius, height = 2 * radius)
  "Fix frame_a's orientation to the world orientation. Use only when frame_a is unconnected; see the component documentation."
  structural parameter isroot::Boolean = false
  "State priority of the position and velocity states"
  structural parameter linearStatePriority::Integer = 0
  "Use a point-gravity field pointing towards the world origin instead of the uniform field `g*n`. Structural: only the selected field model is emitted into the equations."
  structural parameter point_gravity::Boolean = false
  "mass"
  parameter m::Mass = 1
  "Radius of the sphere in animations"
  parameter radius::Real = world_default_body_diameter() / 2
  "Position vector from origin of world frame to origin of frame_a"
  variable r_0::Position(statePriority = linearStatePriority, initial = isroot ? [0.0, 0, 0] : missing)[3]
  "Absolute velocity of frame_a, resolved in world frame (= D(r_0))"
  variable v_0::Velocity(statePriority = linearStatePriority, initial = isroot ? [0.0, 0, 0] : missing)[3]
  "Absolute acceleration of frame_a resolved in world frame (= D(v_0))"
  variable a_0::Acceleration[3]
  "gravity acceleration"
  variable g_0::Acceleration[3]
relations
  r_0 = frame_a.r_0
  v_0 = der(r_0)
  a_0 = der(v_0)
  g_0 = gravity_acceleration(r_0, point_gravity)
  # Newton's second law; f is resolved in frame_a, hence the resolve2
  frame_a.f = m * resolve2(frame_a.R, a_0 - g_0)
  if isroot
    # Root: own the orientation. The (necessarily unconnected) connector's zero
    # flows then supply frame_a.tau, as for an unconnected Body.
    frame_a.R = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
  else
    # A point mass transmits no torque; frame_a.R comes from the neighbour.
    frame_a.tau = [0, 0, 0]
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/PointMass.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 150,
        "rot": 0,
        "attrs": {"font-size": "160"}
      }
    ]
  }
}
end


Test Cases

No test cases defined.

  • Examples

  • Experiments

  • Analyses