PlanarMechanics.Prismatic
Prismatic (sliding) joint allowing translation along a fixed direction.
The sliding direction is given by parameter r, rotated by frame_a's orientation. Without axisflange support, the joint slides freely (f = 0).
This component extends from PartialTwoFrames This component extends from MultibodyComponents.Renderable
Usage
MultibodyComponents.PlanarMechanics.Prismatic(render=true, color=MultibodyComponents.world_default_prismatic_color(), specular_coefficient=1.5, r=[1, 0], box_width=MultibodyComponents.world_default_joint_width(), box_height=MultibodyComponents.world_default_joint_width(), z_position=0)
Parameters:
| Name | Description | Units | Default value |
|---|---|---|---|
statePriority | – | 2 | |
render | – | true | |
color | – | MultibodyCo...tic_color() | |
specular_coefficient | – | 1.5 | |
r | Direction of the rod wrt. body system at phi=0 | m | [1, 0] |
box_width | Half-width of the box in animations | – | MultibodyCo...int_width() |
box_height | Half-height of the box in animations | – | MultibodyCo...int_width() |
z_position | z-position of the box in animations | – | 0 |
Connectors
frame_a- 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)
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)
Variables
| Name | Description | Units |
|---|---|---|
s | Joint coordinate | m |
v | m/s | |
a | m/s2 | |
f | N | |
e0 | – | |
r0 | Translation vector of the prismatic rod resolved w.r.t. inertial frame | m |
Behavior
Dict{MIME{Symbol("text/plain")}, String} with 1 entry: MIME type text/plain => "Error displaying result"
Source
"""
Prismatic (sliding) joint allowing translation along a fixed direction.
The sliding direction is given by parameter `r`, rotated by frame_a's orientation.
Without axisflange support, the joint slides freely (`f = 0`).
"""
component Prismatic
extends PartialTwoFrames
extends MultibodyComponents.Renderable(color = MultibodyComponents.world_default_prismatic_color())
"Visualization shape for the prismatic rod"
shape = MultibodyComponents.BoxShape(render = render, color = color, r_shape = [frame_a.x, frame_a.y, z_position], length_direction = [e0[1], e0[2], 0], width_direction = [0, 0, 1], length = s, width = box_width, height = box_height)
structural parameter statePriority::Integer = 2
"Direction of the rod wrt. body system at phi=0"
parameter r::Length[2] = [1, 0]
"Half-width of the box in animations"
parameter box_width::Real = MultibodyComponents.world_default_joint_width()
"Half-height of the box in animations"
parameter box_height::Real = MultibodyComponents.world_default_joint_width()
"z-position of the box in animations"
parameter z_position::Real = 0
"Joint coordinate"
variable s::Length(statePriority = statePriority)
variable v::Velocity(statePriority = statePriority)
variable a::Acceleration
variable f::Dyad.Force
variable e0::Real[2]
"Translation vector of the prismatic rod resolved w.r.t. inertial frame"
variable r0::Length[2]
relations
# Rotate the unit direction by frame_a angle
e0 = [[cos(frame_a.phi), -sin(frame_a.phi)], [sin(frame_a.phi), cos(frame_a.phi)]] * (r / norm(r))
r0 = e0 * s
v = der(s)
a = der(v)
# position constraint
frame_a.x + r0[1] = frame_b.x
frame_a.y + r0[2] = frame_b.y
# orientation rigidly transferred
frame_a.phi = frame_b.phi
# force balance
frame_a.fx + frame_b.fx = 0
frame_a.fy + frame_b.fy = 0
# torque balance with lever arm
frame_a.tau + frame_b.tau + r0[1] * frame_b.fy - r0[2] * frame_b.fx = 0
# joint force along sliding direction
e0[1] * frame_a.fx + e0[2] * frame_a.fy = f
# free sliding (no axisflange)
f = 0
metadata {"Dyad": {"icons": {"default": "dyad://MultibodyComponents/Prismatic.svg"}}}
endFlattened Source
"""
Prismatic (sliding) joint allowing translation along a fixed direction.
The sliding direction is given by parameter `r`, rotated by frame_a's orientation.
Without axisflange support, the joint slides freely (`f = 0`).
"""
component Prismatic
frame_a = Frame2D() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 50, "y1": 450, "x2": 150, "y2": 550, "rot": 0}
},
"tags": []
}
}
frame_b = Frame2D() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 850, "y1": 450, "x2": 950, "y2": 550, "rot": 0}
},
"tags": []
}
}
parameter render::Boolean = true
parameter color::Real[4] = [0.5, 0.5, 0.5, 1.0]
parameter specular_coefficient::Real = 1.5
"Visualization shape for the prismatic rod"
shape = MultibodyComponents.BoxShape(render = render, color = color, r_shape = [frame_a.x, frame_a.y, z_position], length_direction = [e0[1], e0[2], 0], width_direction = [0, 0, 1], length = s, width = box_width, height = box_height)
structural parameter statePriority::Integer = 2
"Direction of the rod wrt. body system at phi=0"
parameter r::Length[2] = [1, 0]
"Half-width of the box in animations"
parameter box_width::Real = MultibodyComponents.world_default_joint_width()
"Half-height of the box in animations"
parameter box_height::Real = MultibodyComponents.world_default_joint_width()
"z-position of the box in animations"
parameter z_position::Real = 0
"Joint coordinate"
variable s::Length(statePriority = statePriority)
variable v::Velocity(statePriority = statePriority)
variable a::Acceleration
variable f::Dyad.Force
variable e0::Real[2]
"Translation vector of the prismatic rod resolved w.r.t. inertial frame"
variable r0::Length[2]
relations
# Rotate the unit direction by frame_a angle
e0 = [[cos(frame_a.phi), -sin(frame_a.phi)], [sin(frame_a.phi), cos(frame_a.phi)]] * (r / norm(r))
r0 = e0 * s
v = der(s)
a = der(v)
# position constraint
frame_a.x + r0[1] = frame_b.x
frame_a.y + r0[2] = frame_b.y
# orientation rigidly transferred
frame_a.phi = frame_b.phi
# force balance
frame_a.fx + frame_b.fx = 0
frame_a.fy + frame_b.fy = 0
# torque balance with lever arm
frame_a.tau + frame_b.tau + r0[1] * frame_b.fy - r0[2] * frame_b.fx = 0
# joint force along sliding direction
e0[1] * frame_a.fx + e0[2] * frame_a.fy = f
# free sliding (no axisflange)
f = 0
metadata {"Dyad": {"icons": {"default": "dyad://MultibodyComponents/Prismatic.svg"}}}
endTest Cases
No test cases defined.
Related
Examples
Experiments
Analyses