NodeRigidBodyRxyz

A 3D rigid body node based on Euler / Tait-Bryan angles for rigid bodies or beams. All coordinates lead to second order differential equations; NOTE: this node has a singularity if the second rotation parameter reaches \(\psi_1 = (2k-1) \pi/2\), with \(k \in \Ncal\) or \(-k \in \Ncal\).

Interface

Parameters

The parameters of the item; in a dictionary, its type is ‘RigidBodyRxyz’:

name

type

size

default

description

name

String

‘’

node’s unique name

referenceCoordinates

Vector6D

6

[0.,0.,0., 0.,0.,0.]

(symbol: \(\qv\cRef = [q_0,\,q_1,\,q_2,\,\psi_0,\,\psi_1,\,\psi_2]\tp\cRef = [\pv\tp\cRef,\,\tpsi\tp\cRef]\tp\)) reference coordinates (3 position and 3 xyz Euler angles) of node ==> e.g. ref. coordinates for finite elements or reference position of rigid body (e.g. for definition of joints)

initialCoordinates

Vector6D

6

[0.,0.,0., 0.,0.,0.]

(symbol: \(\qv\cIni = [q_0,\,q_1,\,q_2,\,\psi_0,\,\psi_1,\,\psi_2]\tp\cIni = [\uv\tp\cIni,\,\tpsi\tp\cIni]\tp\)) initial displacement coordinates: ux,uy,uz and 3 Euler angles (xyz) relative to reference coordinates

initialVelocities

Vector6D

6

[0.,0.,0., 0.,0.,0.]

(symbol: \(\dot \qv\cIni = [\dot q_0,\,\dot q_1,\,\dot q_2,\,\dot \psi_0,\,\dot \psi_1,\,\dot \psi_2]\tp\cIni = [\dot \uv\tp\cIni,\,\dot \tpsi\tp\cIni]\tp\)) initial velocity coordinate: time derivatives of ux,uy,uz and of 3 Euler angles (xyz)

visualization

VNodeRigidBodyRxyz

parameters for visualization of item

Visualization parameters

The parameters of VNodeRigidBodyRxyz, given as visualization:

name

type

size

default

description

show

Bool

True

set true, if item is shown in visualization and false if it is not shown

drawSize

float

-1.

drawing size (diameter, dimensions of underlying cube, etc.) for item; size == -1.f means that default size is used

color

Float4

4

[-1.,-1.,-1.,-1.]

Default RGBA color for nodes; 4th value is alpha-transparency; R=-1.f means, that default color is used

Drawing

Drawn as all nodes; with nodes.showBasis, also its frame, of length nodes.basisSize.

Settings beyond those of all nodes: general.axesTiling, nodes.basisSize, nodes.showBasis.

Output variables

Available as OutputVariableType in sensors, Get...Output() and other functions:

output variable

symbol

description

Position

\(\LU{0}{\pv}\cConfig = \LU{0}{[p_0,\,p_1,\,p_2]}\cConfig\tp= \LU{0}{\uv}\cConfig + \LU{0}{\pv}\cRef\)

global 3D position vector of node; \(\uv\cRef=0\)

Displacement

\(\LU{0}{\uv}\cConfig = [q_0,\,q_1,\,q_2]\cConfig\tp\)

global 3D displacement vector of node

Velocity

\(\LU{0}{\vv}\cConfig = [\dot q_0,\,\dot q_1,\,\dot q_2]\cConfig\tp\)

global 3D velocity vector of node

Acceleration

\(\LU{0}{\av}\cConfig = [\ddot q_0,\,\ddot q_1,\,\ddot q_2]\cConfig\tp\)

global 3D acceleration vector of node

CoordinatesTotal

displacement/rotation coordinates of node including reference configuration

Coordinates

\(\cv\cConfig = [q_0,\,q_1,\,q_2, \,\psi_0,\,\psi_1,\,\psi_2]\tp\cConfig\)

coordinate vector of node, having 3 displacement coordinates and 3 Euler angles

Coordinates_t

\(\dot\cv\cConfig = [\dot q_0,\,\dot q_1,\,\dot q_2, \,\dot \psi_0,\,\dot \psi_1,\,\dot \psi_2]\tp\cConfig\)

velocity coordinates vector of node

Coordinates_tt

\(\ddot\cv\cConfig = [\ddot q_0,\,\ddot q_1,\,\ddot q_2, \,\ddot \psi_0,\,\ddot \psi_1,\,\ddot \psi_2]\tp\cConfig\)

acceleration coordinates vector of node

RotationMatrix

\([A_{00},\,A_{01},\,A_{02},\,A_{10},\,\ldots,\,A_{21},\,A_{22}]\cConfig\tp\)

vector with 9 components of the rotation matrix \(\LU{0b}{\Rot}\cConfig\) in row-major format, in any configuration; the rotation matrix transforms local (\(b\)) to global (0) coordinates

Rotation

\([\varphi_0,\,\varphi_1,\,\varphi_2]\tp\cConfig = [\psi_0,\,\psi_1,\,\psi_2]\tp\cRef + [\psi_0,\,\psi_1,\,\psi_2]\tp\cConfig\)

vector with 3 components of the Euler / Tait-Bryan angles in xyz-sequence (\(\LU{0b}{\Rot}\cConfig=:\Rot_0(\varphi_0) \cdot \Rot_1(\varphi_1) \cdot \Rot_2(\varphi_2)\))

AngularVelocity

\(\LU{0}{\tomega}\cConfig = \LU{0}{[\omega_0,\,\omega_1,\,\omega_2]}\cConfig\tp\)

global 3D angular velocity vector of node

AngularVelocityLocal

\(\LU{b}{\tomega}\cConfig = \LU{b}{[\omega_0,\,\omega_1,\,\omega_2]}\cConfig\tp\)

local (body-fixed) 3D angular velocity vector of node

AngularAcceleration

\(\LU{0}{\talpha}\cConfig = \LU{0}{[\alpha_0,\,\alpha_1,\,\alpha_2]}\cConfig\tp\)

global 3D angular acceleration vector of node

Detailed description

Coordinates

index

symbol

kind

meaning

frame

0, 1, 2

\(q_0,\,q_1,\,q_2\)

ODE2

displacement of the reference point of the body

global

3, 4, 5

\(\psi_0,\,\psi_1,\,\psi_2\)

ODE2

change of the Tait-Bryan angles against their reference values: consecutive rotations about the \(x\)-, \(y\)- and \(z\)-axis

-

Configuration

The position of the reference point and the angles \(\ttheta\) are the sums of reference and current coordinates,

\[ \pv\cConfig = \pv\cRef + \uv\cConfig, \quad \ttheta\cConfig = \tpsi\cRef + \tpsi\cConfig , \]

and the rotation matrix, which transforms a local (body-fixed) position \(\pLocB\) into the global frame, \(\LU{0}{\pLoc}\cConfig = \LU{0b}{\Rot}\cConfig \LU{b}{\pLoc}\), is

\[ \LU{0b}{\Rot} = \LU{01}{\Rot_0}(\theta_0) \LU{12}{\Rot_1}(\theta_1) \LU{2b}{\Rot_2}(\theta_2) , \]

see Symbols in item equations for the elementary rotation matrices \(\Rot_0\), \(\Rot_1\) and \(\Rot_2\).

Frame and interpretation

The displacement is given in the global frame, and the angles describe the rotation of the body frame \(b\) against the global frame.

Action on the equations of motion

The velocity transformation relates the time derivatives of the angles to the angular velocity,

\[\begin{split} \begin{aligned} \LU{0}{\tomega} &= \LU{0}{\Gm} \dot \ttheta, \\ \LU{b}{\tomega} &= \LU{b}{\Gm} \dot \ttheta. \end{aligned} \end{split}\]

All six coordinates lead to ODE2 equations: the first three are the residuals of the forces in the global frame, the last three the torque equations projected with \(\LU{b}{\Gm\tp}\) (body frame) or \(\LU{0}{\Gm\tp}\) (global frame), see the equations of motion of ObjectRigidBody. There is no constraint.

Singularity

\(\Gm\) is singular for \(\theta_1 = \pm \pi/2\) (and every multiple of \(\pi\) added): there the rotations about the first and the third axis coincide, and the equations cannot be solved. Use the node only for motions that stay away from it, or NodeRigidBodyEP or NodeRigidBodyRotVecLG.

For creating a NodeRigidBodyRxyz together with a rigid body, use CreateRigidBody, see Function: CreateRigidBody.

Mini example

#a rigid body spinning about its z-axis; the rotation coordinates are Tait-Bryan angles
node = mbs.AddNode(NodeRigidBodyRxyz(referenceCoordinates=[0.5,0.2,0.1, 0,0,0],
                                     initialVelocities=[0,0,0, 0,0,0.5*np.pi])) #angle rates
inertia = InertiaCuboid(density=1000, sideLengths=[0.4,0.2,0.1])
mbs.AddObject(ObjectRigidBody(nodeNumber=node, mass=inertia.Mass(),
                              inertia=inertia.GetInertia6D()))

mbs.Assemble()
mbs.SolveDynamic()

#the third rotation coordinate after 1 second:
exu.sys['testResult'] = mbs.GetNodeOutput(node, exu.OutputVariableType.Coordinates)[5] #pi/2

Examples (Ex) and TestModels (TM) that show this item, with weblink to github: connectorRigidBodySpringDamperTest.py (TM), heavyTop.py (TM)