Skip to content
LIBRARY
PlanarMechanics.World.md

PlanarMechanics.World

The root component for all 2D planar mechanics models.

Every planar model must include exactly one PlanarMechanics.World component. The frame_b is fixed at the origin with zero orientation.

Global gravity parameters (n, g) are set here and referenced by Body components via gravity_acceleration_2d.

Usage

MultibodyComponents.PlanarMechanics.World(render=true, n=[0, -1], g=9.80665)

Parameters:

NameDescriptionUnitsDefault value
rendertrue
ngravity direction (unit vector in 2D plane)[0, -1]
ggravitational acceleration magnitudem/s29.80665

Connectors

  • frame_b - Coordinate system (2-dim.) fixed to the component with one cut-force and cut-torque.

All variables are resolved in the planar world frame. (Frame2D)

Behavior

[frameb.x(t)=0frameb.y(t)=0frameb.phi(t)=0connect(frameb,framevis+frame_a)framevis.phi(t)=framevis.frame_a.phi(t)framevis.x_shape.r(t)=arrayliteral([3],framevis.frame_a.x(t),framevis.frame_a.y(t),framevis.z_position)framevis.x_shape.R(t)=arrayliteral([33],cos(framevis.phi(t)),sin(framevis.phi(t)),0,sin(framevis.phi(t)),cos(framevis.phi(t)),0,0,0,1)framevis.x_shape.r_shape(t)=[000]framevis.x_shape.length_direction(t)=[100]framevis.x_shape.width_direction(t)=[001]framevis.x_shape.length(t)=framevis.axis_lengthframevis.x_shape.width(t)=2framevis.axis_radiusframevis.x_shape.height(t)=2framevis.axis_radiusframevis.y_shape.r(t)=arrayliteral([3],framevis.frame_a.x(t),framevis.frame_a.y(t),framevis.z_position)framevis.y_shape.R(t)=arrayliteral([33],cos(framevis.phi(t)),sin(framevis.phi(t)),0,sin(framevis.phi(t)),cos(framevis.phi(t)),0,0,0,1)framevis.y_shape.r_shape(t)=[000]framevis.y_shape.length_direction(t)=[010]framevis.y_shape.width_direction(t)=[001]framevis.y_shape.length(t)=framevis.axis_lengthframevis.y_shape.width(t)=2framevis.axis_radiusframevis.y_shape.height(t)=2framevis.axis_radiusframevis.z_shape.r(t)=arrayliteral([3],framevis.frame_a.x(t),framevis.frame_a.y(t),framevis.z_position)framevis.z_shape.R(t)=arrayliteral([33],cos(framevis.phi(t)),sin(framevis.phi(t)),0,sin(framevis.phi(t)),cos(framevis.phi(t)),0,0,0,1)framevis.z_shape.r_shape(t)=[000]framevis.z_shape.length_direction(t)=[001]framevis.z_shape.width_direction(t)=[100]framevis.z_shape.length(t)=framevis.axis_lengthframevis.z_shape.width(t)=2framevis.axis_radiusframevis.z_shape.height(t)=2framevis.axis_radius]

Source

dyad
"""
The root component for all 2D planar mechanics models.

Every planar model must include exactly one PlanarMechanics.World component.
The `frame_b` is fixed at the origin with zero orientation.

Global gravity parameters (`n`, `g`) are set here and referenced by
Body components via `gravity_acceleration_2d`.
"""
external component World
  frame_b = Frame2D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 950, "y1": 450, "x2": 1050, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  parameter render::Boolean = true
  "gravity direction (unit vector in 2D plane)"
  parameter n::Real[2] = [0, -1]
  "gravitational acceleration magnitude"
  parameter g::Acceleration = 9.80665
relations
metadata {
  "Dyad": {
    "experiments": {},
    "tests": {},
    "labels": [
      {
        "label": "g = $(g)",
        "x": 70,
        "y": 970,
        "rot": 0,
        "layer": "all",
        "attrs": {
          "fill": "black",
          "font-size": "12",
          "dominant-baseline": "central",
          "text-anchor": "left"
        }
      },
      {
        "label": "n = $(n)",
        "x": 930,
        "y": 970,
        "rot": 0,
        "layer": "all",
        "attrs": {
          "fill": "black",
          "font-size": "12",
          "dominant-baseline": "central",
          "text-anchor": "left"
        }
      }
    ],
    "icons": {"default": "dyad://MultibodyComponents/World.svg"},
    "path": {},
    "doc": {"behavior": true}
  }
}
end
Flattened Source
dyad
"""
The root component for all 2D planar mechanics models.

Every planar model must include exactly one PlanarMechanics.World component.
The `frame_b` is fixed at the origin with zero orientation.

Global gravity parameters (`n`, `g`) are set here and referenced by
Body components via `gravity_acceleration_2d`.
"""
external component World
  frame_b = Frame2D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 950, "y1": 450, "x2": 1050, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  parameter render::Boolean = true
  "gravity direction (unit vector in 2D plane)"
  parameter n::Real[2] = [0, -1]
  "gravitational acceleration magnitude"
  parameter g::Acceleration = 9.80665
relations
metadata {
  "Dyad": {
    "experiments": {},
    "tests": {},
    "labels": [
      {
        "label": "g = $(g)",
        "x": 70,
        "y": 970,
        "rot": 0,
        "layer": "all",
        "attrs": {
          "fill": "black",
          "font-size": "12",
          "dominant-baseline": "central",
          "text-anchor": "left"
        }
      },
      {
        "label": "n = $(n)",
        "x": 930,
        "y": 970,
        "rot": 0,
        "layer": "all",
        "attrs": {
          "fill": "black",
          "font-size": "12",
          "dominant-baseline": "central",
          "text-anchor": "left"
        }
      }
    ],
    "icons": {"default": "dyad://MultibodyComponents/World.svg"},
    "path": {},
    "doc": {"behavior": true}
  }
}
end


Test Cases

No test cases defined.