Skip to content
LIBRARY
WorldForce.md

WorldForce

External force acting at frame_b, defined by 3 input signals.

Resolved in the world frame (default) or frame_b. No torque is applied.

This component extends from Renderable

Usage

MultibodyComponents.WorldForce(render=true, color=world_default_force_color(), specular_coefficient=1.5, scale=0.1, radius=world_default_arrow_diameter())

Parameters:

NameDescriptionUnitsDefault value
resolve_in_frameResolveInFrame.World()
rendertrue
colorworld_defau...rce_color()
specular_coefficient1.5
scaleScale factor for visualization0.1
radiusRadius of force arrowworld_defau..._diameter()

Connectors

  • 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)

  • force_x - This connector represents a real signal as an input to a component (RealInput)

  • force_y - This connector represents a real signal as an input to a component (RealInput)

  • force_z - This connector represents a real signal as an input to a component (RealInput)

Variables

NameDescriptionUnits
f_worldApplied force in world frame (for visualization)N

Behavior

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

Source

dyad
"""
External force acting at `frame_b`, defined by 3 input signals.

Resolved in the world frame (default) or `frame_b`.
No torque is applied.
"""
component WorldForce
  extends Renderable(color = world_default_force_color())
  frame_b = Frame3D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 700, "y1": 450, "x2": 800, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  force_x = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 90, "y1": -50, "x2": 190, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  force_y = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": -50, "x2": 550, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  force_z = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 810, "y1": -50, "x2": 910, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  # Visualization shape
  force_arrow = ArrowShape(render = render, color = color, head_at_origin = false, diameter = 2 * radius, r = frame_b.r_0, length_direction = f_world, length = scale * norm_(f_world), width = 2 * radius, height = 2 * radius)
  structural parameter resolve_in_frame::ResolveInFrame = ResolveInFrame.World()
  "Scale factor for visualization"
  parameter scale::Real = 0.1
  "Radius of force arrow"
  parameter radius::Real = world_default_arrow_diameter()
  "Applied force in world frame (for visualization)"
  variable f_world::Dyad.Force[3]
relations
  frame_b.tau = [0, 0, 0]
  switch resolve_in_frame
    case World
      f_world = [force_x, force_y, force_z]
      frame_b.f = -resolve2(frame_b.R, [force_x, force_y, force_z])
    case FrameB
      f_world = resolve1(frame_b.R, [force_x, force_y, force_z])
      frame_b.f = -[force_x, force_y, force_z]
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/WorldForce.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 150,
        "rot": 0,
        "attrs": {"font-size": "140"}
      }
    ]
  }
}
end
Flattened Source
dyad
"""
External force acting at `frame_b`, defined by 3 input signals.

Resolved in the world frame (default) or `frame_b`.
No torque is applied.
"""
component WorldForce
  parameter render::Boolean = true
  parameter color::Real[4] = [0.5, 0.5, 0.5, 1.0]
  parameter specular_coefficient::Real = 1.5
  frame_b = Frame3D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 700, "y1": 450, "x2": 800, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  force_x = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 90, "y1": -50, "x2": 190, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  force_y = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": -50, "x2": 550, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  force_z = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 810, "y1": -50, "x2": 910, "y2": 50, "rot": 0}
      },
      "tags": []
    }
  }
  # Visualization shape
  force_arrow = ArrowShape(render = render, color = color, head_at_origin = false, diameter = 2 * radius, r = frame_b.r_0, length_direction = f_world, length = scale * norm_(f_world), width = 2 * radius, height = 2 * radius)
  structural parameter resolve_in_frame::ResolveInFrame = ResolveInFrame.World()
  "Scale factor for visualization"
  parameter scale::Real = 0.1
  "Radius of force arrow"
  parameter radius::Real = world_default_arrow_diameter()
  "Applied force in world frame (for visualization)"
  variable f_world::Dyad.Force[3]
relations
  frame_b.tau = [0, 0, 0]
  switch resolve_in_frame
    case World
      f_world = [force_x, force_y, force_z]
      frame_b.f = -resolve2(frame_b.R, [force_x, force_y, force_z])
    case FrameB
      f_world = resolve1(frame_b.R, [force_x, force_y, force_z])
      frame_b.f = -[force_x, force_y, force_z]
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/WorldForce.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 150,
        "rot": 0,
        "attrs": {"font-size": "140"}
      }
    ]
  }
}
end


Test Cases

No test cases defined.

  • Examples

  • Experiments

  • Analyses