Modelica.Mechanics.MultiBody.Frames

Functions to transform rotational frame quantities

Information

Package Frames contains type definitions and functions to transform rotational frame quantities. The basic idea is to hide the actual definition of an orientation in this package by providing essentially type Orientation together with functions operating on instances of this type.

Content

In the table below an example is given for every function definition. The used variables have the following declaration:

   Frames.Orientation R, R1, R2, R_rel, R_inv;
   Real[3,3]   T, T_inv;
   Real[3]     v1, v2, w1, w2, n_x, n_y, n_z, e, e_x, res_ori, phi;
   Real[6]     res_equal;
   Real        L, angle;
Function/typeDescription
Orientation R; New type defining an orientation object that describes
the rotation of frame 1 into frame 2.
res_ori = orientationConstraint(R); Return the constraints between the variables of an orientation object
(shall be zero).
w1 = angularVelocity1(R); Return angular velocity resolved in frame 1 from orientation object R.
w2 = angularVelocity2(R); Return angular velocity resolved in frame 2 from orientation object R.
v1 = resolve1(R,v2); Transform vector v2 from frame 2 to frame 1.
v2 = resolve2(R,v1); Transform vector v1 from frame 1 to frame 2.
v2 = resolveRelative(v1,R1,R2); Transform vector v1 from frame 1 to frame 2 using absolute orientation objects R1 of frame 1 and R2 of frame 2.
D1 = resolveDyade1(R,D2); Transform second order tensor D2 from frame 2 to frame 1.
D2 = resolveDyade2(R,D1); Transform second order tensor D1 from frame 1 to frame 2.
R = nullRotation() Return orientation object R that does not rotate a frame.
R_inv = inverseRotation(R); Return inverse orientation object.
R_rel = relativeRotation(R1,R2); Return relative orientation object from two absolute orientation objects.
R2 = absoluteRotation(R1,R_rel); Return absolute orientation object from another absolute
and a relative orientation object.
R = planarRotation(e, angle, der_angle); Return orientation object of a planar rotation.
angle = planarRotationAngle(e, v1, v2); Return angle of a planar rotation, given the rotation axis
and the representations of a vector in frame 1 and frame 2.
R = axisRotation(axis, angle, der_angle); Return orientation object R to rotate around angle along axis of frame 1.
R = axesRotations(sequence, angles, der_angles); Return rotation object to rotate in sequence around 3 axes. Example:
R = axesRotations({1,2,3},{pi/2,pi/4,-pi}, zeros(3));
angles = axesRotationsAngles(R, sequence); Return the 3 angles to rotate in sequence around 3 axes to
construct the given orientation object.
phi = smallRotation(R); Return rotation angles phi valid for a small rotation R.
R = from_nxy(n_x, n_y); Return orientation object from n_x and n_y vectors.
R = from_nxz(n_x, n_z); Return orientation object from n_x and n_z vectors.
R = from_T(T,w); Return orientation object R from transformation matrix T and its angular velocity w.
R = from_T2(T,der(T)); Return orientation object R from transformation matrix T and its derivative der(T).
R = from_T_inv(T_inv,w); Return orientation object R from inverse transformation matrix T_inv and its angular velocity w.
R = from_Q(Q,w); Return orientation object R from quaternion orientation object Q and its angular velocity w.
T = to_T(R); Return transformation matrix T from orientation object R.
T_inv = to_T_inv(R); Return inverse transformation matrix T_inv from orientation object R.
Q = to_Q(R); Return quaternion orientation object Q from orientation object R.
exy = to_exy(R); Return [e_x, e_y] matrix of an orientation object R,
with e_x and e_y vectors of frame 2, resolved in frame 1.
L = length(n_x); Return length L of a vector n_x.
e_x = normalize(n_x); Return normalized vector e_x of n_x such that length of e_x is one.
e = axis(i); Return unit vector e directed along axis i
Quaternions Package with functions to transform rotational frame quantities based on quaternions (also called Euler parameters).
TransformationMatrices Package with functions to transform rotational frame quantities based on transformation matrices.

Extends from Modelica.Icons.Package (Icon for standard packages).

Package Content

Name Description
Modelica.Mechanics.MultiBody.Frames.Orientation Orientation Orientation object defining rotation from a frame 1 into a frame 2
Modelica.Mechanics.MultiBody.Frames.orientationConstraint orientationConstraint Return residues of orientation constraints (shall be zero)
Modelica.Mechanics.MultiBody.Frames.angularVelocity1 angularVelocity1 Return angular velocity resolved in frame 1 from orientation object
Modelica.Mechanics.MultiBody.Frames.angularVelocity2 angularVelocity2 Return angular velocity resolved in frame 2 from orientation object
Modelica.Mechanics.MultiBody.Frames.resolve1 resolve1 Transform vector from frame 2 to frame 1
Modelica.Mechanics.MultiBody.Frames.resolve2 resolve2 Transform vector from frame 1 to frame 2
Modelica.Mechanics.MultiBody.Frames.resolveRelative resolveRelative Transform vector from frame 1 to frame 2 using absolute orientation objects of frame 1 and of frame 2
Modelica.Mechanics.MultiBody.Frames.resolveDyade1 resolveDyade1 Transform second order tensor from frame 2 to frame 1
Modelica.Mechanics.MultiBody.Frames.resolveDyade2 resolveDyade2 Transform second order tensor from frame 1 to frame 2
Modelica.Mechanics.MultiBody.Frames.nullRotation nullRotation Return orientation object that does not rotate a frame
Modelica.Mechanics.MultiBody.Frames.inverseRotation inverseRotation Return inverse orientation object
Modelica.Mechanics.MultiBody.Frames.relativeRotation relativeRotation Return relative orientation object
Modelica.Mechanics.MultiBody.Frames.absoluteRotation absoluteRotation Return absolute orientation object from another absolute and a relative orientation object
Modelica.Mechanics.MultiBody.Frames.planarRotation planarRotation Return orientation object of a planar rotation
Modelica.Mechanics.MultiBody.Frames.planarRotationAngle planarRotationAngle Return angle of a planar rotation, given the rotation axis and the representations of a vector in frame 1 and frame 2
Modelica.Mechanics.MultiBody.Frames.axisRotation axisRotation Return rotation object to rotate around an angle along one frame axis
Modelica.Mechanics.MultiBody.Frames.axesRotations axesRotations Return fixed rotation object to rotate in sequence around fixed angles along 3 axes
Modelica.Mechanics.MultiBody.Frames.axesRotationsAngles axesRotationsAngles Return the 3 angles to rotate in sequence around 3 axes to construct the given orientation object
Modelica.Mechanics.MultiBody.Frames.smallRotation smallRotation Return rotation angles valid for a small rotation and optionally residues that should be zero
Modelica.Mechanics.MultiBody.Frames.from_nxy from_nxy Return fixed orientation object from n_x and n_y vectors
Modelica.Mechanics.MultiBody.Frames.from_nxz from_nxz Return fixed orientation object from n_x and n_z vectors
Modelica.Mechanics.MultiBody.Frames.from_T from_T Return orientation object R from transformation matrix T
Modelica.Mechanics.MultiBody.Frames.from_T2 from_T2 Return orientation object R from transformation matrix T and its derivative der(T)
Modelica.Mechanics.MultiBody.Frames.from_T_inv from_T_inv Return orientation object R from inverse transformation matrix T_inv
Modelica.Mechanics.MultiBody.Frames.from_Q from_Q Return orientation object R from quaternion orientation object Q
Modelica.Mechanics.MultiBody.Frames.to_T to_T Return transformation matrix T from orientation object R
Modelica.Mechanics.MultiBody.Frames.to_T_inv to_T_inv Return inverse transformation matrix T_inv from orientation object R
Modelica.Mechanics.MultiBody.Frames.to_Q to_Q Return quaternion orientation object Q from orientation object R
Modelica.Mechanics.MultiBody.Frames.to_vector to_vector Map rotation object into vector
Modelica.Mechanics.MultiBody.Frames.to_exy to_exy Map rotation object into e_x and e_y vectors of frame 2, resolved in frame 1
Modelica.Mechanics.MultiBody.Frames.axis axis Return unit vector for x-, y-, or z-axis
Modelica.Mechanics.MultiBody.Frames.Quaternions Quaternions Functions to transform rotational frame quantities based on quaternions (also called Euler parameters)
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices TransformationMatrices Functions for transformation matrices
Modelica.Mechanics.MultiBody.Frames.Internal Internal Internal definitions that may be removed or changed (do not use)

Modelica.Mechanics.MultiBody.Frames.Orientation Modelica.Mechanics.MultiBody.Frames.Orientation

Orientation object defining rotation from a frame 1 into a frame 2

Information

This object describes the rotation from a frame 1 into a frame 2. An instance of this type should never be directly accessed but only with the access functions provided in package Modelica.Mechanics.MultiBody.Frames. As a consequence, it is not necessary to know the internal representation of this object as described in the next paragraphs.

"Orientation" is defined to be a record consisting of two elements: "Real T[3,3]", the transformation matrix to rotate frame 1 into frame 2 and "Real w[3]", the angular velocity of frame 2 with respect to frame 1, resolved in frame 2. Element "T" has the following interpretation:

Orientation R;
R.T = [ex, ey, ez];
    e.g., R.T = [1,0,0; 0,1,0; 0,0,1]

where ex,ey,ez are unit vectors in the direction of the x-axis, y-axis, and z-axis of frame 1, resolved in frame 2, respectively. Therefore, if v1 is vector v resolved in frame 1 and v2 is vector v resolved in frame 2, the following relationship holds:

v2 = R.T * v1

The inverse orientation R_inv.T = R.TT describes the rotation from frame 2 into frame 1.

Since the orientation is described by 9 variables, there are 6 constraints between these variables. These constraints are defined in function Frames.orientationConstraint.

R.w is the angular velocity of frame 2 with respect to frame 1, resolved in frame 2. Formally, R.w is defined as:
skew(R.w) = R.T*der(transpose(R.T)) with

          |   0   -w[3]  w[2] |
skew(w) = |  w[3]   0   -w[1] |
          | -w[2]  w[1]     0 |

Extends from Modelica.Icons.Record (Icon for records).

Modelica.Mechanics.MultiBody.Frames.orientationConstraint Modelica.Mechanics.MultiBody.Frames.orientationConstraint

Return residues of orientation constraints (shall be zero)

Information

Syntax

residue = Frames.orientationConstraint(R);

Description

The function call Frames.orientationConstraint(R) returns the Real residue vector with 6 elements that describes the constraints between the 9 elements of the orientation matrix.

See also

TransformationMatrices.orientationConstraint, Quaternions.orientationConstraint.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
ROrientation object to rotate frame 1 into frame 2

Outputs

NameDescription
residue[6]Residues of constraints between elements of orientation object (shall be zero)

Modelica.Mechanics.MultiBody.Frames.angularVelocity1 Modelica.Mechanics.MultiBody.Frames.angularVelocity1

Return angular velocity resolved in frame 1 from orientation object

Information

Syntax

w = Frames.angularVelocity1(R);

Description

The function call Frames.angularVelocity1(R12) returns the angular velocity w of frame 2 with respect to frame 1, resolved in frame 1, from the orientation object R12 that describes the orientation to rotate frame 1 into frame 2.

See also

TransformationMatrices.angularVelocity1, Quaternions.angularVelocity1.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
ROrientation object to rotate frame 1 into frame 2

Outputs

NameDescription
w[3]Angular velocity of frame 2 with respect to frame 1 resolved in frame 1 [rad/s]

Modelica.Mechanics.MultiBody.Frames.angularVelocity2 Modelica.Mechanics.MultiBody.Frames.angularVelocity2

Return angular velocity resolved in frame 2 from orientation object

Information

Syntax

w = Frames.angularVelocity2(R);

Description

The function call Frames.angularVelocity1(R12) returns the angular velocity w of frame 2 with respect to frame 1, resolved in frame 2, from the orientation object R12 that describes the orientation to rotate frame 1 into frame 2.

See also

TransformationMatrices.angularVelocity2, Quaternions.angularVelocity2.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
ROrientation object to rotate frame 1 into frame 2

Outputs

NameDescription
w[3]Angular velocity of frame 2 with respect to frame 1 resolved in frame 2 [rad/s]

Modelica.Mechanics.MultiBody.Frames.resolve1 Modelica.Mechanics.MultiBody.Frames.resolve1

Transform vector from frame 2 to frame 1

Information

Syntax

v1 = Frames.resolve1(R, v2);

Description

The function call Frames.resolve1(R12, v2) returns vector v resolved in frame 1 (= v1) from vector v resolved in frame 2 (= v2) using the orientation object R12 that describes the orientation to rotate frame 1 into frame 2.

See also

resolve2, TransformationMatrices.resolve1, Quaternions.resolve1.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
ROrientation object to rotate frame 1 into frame 2
v2[3]Vector in frame 2

Outputs

NameDescription
v1[3]Vector in frame 1

Modelica.Mechanics.MultiBody.Frames.resolve2 Modelica.Mechanics.MultiBody.Frames.resolve2

Transform vector from frame 1 to frame 2

Information

Syntax

v2 = Frames.resolve2(R, v1);

Description

The function call Frames.resolve2(R12, v1) returns vector v resolved in frame 2 (= v2) from vector v resolved in frame 1 (= v1) using the orientation object R12 that describes the orientation to rotate frame 1 into frame 2.

See also

resolve1, TransformationMatrices.resolve2, Quaternions.resolve2.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
ROrientation object to rotate frame 1 into frame 2
v1[3]Vector in frame 1

Outputs

NameDescription
v2[3]Vector in frame 2

Modelica.Mechanics.MultiBody.Frames.resolveRelative Modelica.Mechanics.MultiBody.Frames.resolveRelative

Transform vector from frame 1 to frame 2 using absolute orientation objects of frame 1 and of frame 2

Information

Syntax

v2 = Frames.resolveRelative(v1, R1, R2);

Description

The function call Frames.resolveRelative(v1,R1,R2) returns vector v resolved in frame 2 (= v1) from vector v resolved in frame 1 (= v1) given the orientation object R1 that describes the orientation to rotate frame 0 into frame 1 and orientation object R2 that describes the orientation to rotate frame 0 into frame 2.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
v1[3]Vector in frame 1
R1Orientation object to rotate frame 0 into frame 1
R2Orientation object to rotate frame 0 into frame 2

Outputs

NameDescription
v2[3]Vector in frame 2

Modelica.Mechanics.MultiBody.Frames.resolveDyade1 Modelica.Mechanics.MultiBody.Frames.resolveDyade1

Transform second order tensor from frame 2 to frame 1

Information

Syntax

D1 = Frames.resolveDyade1(R, D2);

Description

The function call Frames.Dyade1(R12, D2) returns the second order tensor D resolved in frame 1 (= D1) from its representation in frame 2 (= D2) using the orientation object R12 that describes the orientation to rotate frame 1 into frame 2.

See also

TransformationMatrices.resolveDyade1.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
ROrientation object to rotate frame 1 into frame 2
D2[3, 3]Second order tensor resolved in frame 2

Outputs

NameDescription
D1[3, 3]Second order tensor resolved in frame 1

Modelica.Mechanics.MultiBody.Frames.resolveDyade2 Modelica.Mechanics.MultiBody.Frames.resolveDyade2

Transform second order tensor from frame 1 to frame 2

Information

Syntax

D2 = Frames.resolveDyade2(R, D1);

Description

The function call Frames.Dyade2(R12, D1) returns the second order tensor D resolved in frame 2 (= D2) from its representation in frame 1 (= D1) using the orientation object R12 that describes the orientation to rotate frame 1 into frame 2.

See also

TransformationMatrices.resolveDyade2.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
ROrientation object to rotate frame 1 into frame 2
D1[3, 3]Second order tensor resolved in frame 1

Outputs

NameDescription
D2[3, 3]Second order tensor resolved in frame 2

Modelica.Mechanics.MultiBody.Frames.nullRotation Modelica.Mechanics.MultiBody.Frames.nullRotation

Return orientation object that does not rotate a frame

Information

Syntax

R = Frames.nullRotation();

Description

The function call Frames.nullRotation() returns an orientation matrix R describing the orientation object to rotate frame 1 into frame 2, if frame 1 and frame 2 are identical. (= transformation matrix is identity matrix and angular velocity is zero).

See also

TransformationMatrices.nullRotation, Quaternions.nullRotation.

Extends from Modelica.Icons.Function (Icon for functions).

Outputs

NameDescription
ROrientation object such that frame 1 and frame 2 are identical

Modelica.Mechanics.MultiBody.Frames.inverseRotation Modelica.Mechanics.MultiBody.Frames.inverseRotation

Return inverse orientation object

Information

Syntax

R_inv = Frames.inverseRotation(R);

Description

The function call Frames.inverseRotation(R) returns orientation object R_inv that describes the orientation to rotate from frame 2 to frame 1 from the orientation object R that describes the orientation to rotate from frame 1 into frame 2.

See also

TransformationMatrices.inverseRotation, Quaternions.inverseRotation.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
ROrientation object to rotate frame 1 into frame 2

Outputs

NameDescription
R_invOrientation object to rotate frame 2 into frame 1

Modelica.Mechanics.MultiBody.Frames.relativeRotation Modelica.Mechanics.MultiBody.Frames.relativeRotation

Return relative orientation object

Information

Syntax

R_rel = Frames.relativeRotation(R1,R2);

Description

The function call Frames.relativeRotation(R1,R2) returns orientation object R_rel that describes the orientation to rotate frame 1 to frame 2 from the orientation object R1 that describes the orientation to rotate from frame 0 to frame 1 and from the orientation object R2 that describes the orientation to rotate from frame 0 to frame 2.

See also

TransformationMatrices.relativeRotation, Quaternions.relativeRotation.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
R1Orientation object to rotate frame 0 into frame 1
R2Orientation object to rotate frame 0 into frame 2

Outputs

NameDescription
R_relOrientation object to rotate frame 1 into frame 2

Modelica.Mechanics.MultiBody.Frames.absoluteRotation Modelica.Mechanics.MultiBody.Frames.absoluteRotation

Return absolute orientation object from another absolute and a relative orientation object

Information

Syntax

R2 = Frames.absoluteRotation(R1,R_rel);

Description

The function call Frames.absoluteRotation(R1,R_rel) returns orientation object R2 that describes the orientation frame 0 to frame 2 from the orientation object R1 that describes the orientation to rotate from frame 0 to frame 1 and from the relative orientation object R_rel that describes the orientation to rotate from frame 1 to frame 2.

See also

TransformationMatrices.absoluteRotation, Quaternions.absoluteRotation.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
R1Orientation object to rotate frame 0 into frame 1
R_relOrientation object to rotate frame 1 into frame 2

Outputs

NameDescription
R2Orientation object to rotate frame 0 into frame 2

Modelica.Mechanics.MultiBody.Frames.planarRotation Modelica.Mechanics.MultiBody.Frames.planarRotation

Return orientation object of a planar rotation

Information

Syntax

R = Frames.planarRotation(e, angle, der_angle);

Description

The function call Frames.planarRotation(e, angle, der_angle) returns orientation object R that describes the orientation to rotate in the plane along unit axis e from frame 1 into frame 2 with angle angle and derivative of angle der_angle. Note, "e" must be a unit vector. However, this is not checked in this function and the function will return a wrong result, if length(e) is not one.

See also

planarRotationAngle, TransformationMatrices.planarRotation, Quaternions.planarRotation.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
e[3]Normalized axis of rotation (must have length=1) [1]
angleRotation angle to rotate frame 1 into frame 2 along axis e [rad]
der_angle= der(angle) [rad/s]

Outputs

NameDescription
ROrientation object to rotate frame 1 into frame 2

Modelica.Mechanics.MultiBody.Frames.planarRotationAngle Modelica.Mechanics.MultiBody.Frames.planarRotationAngle

Return angle of a planar rotation, given the rotation axis and the representations of a vector in frame 1 and frame 2

Information

Syntax

angle = Frames.planarRotationAngle(e, v1, v2);

Description

A call to this function of the form

    Real[3]                e, v1, v2;
    Modelica.SIunits.Angle angle;
  equation
    angle = planarRotationAngle(e, v1, v2);

computes the rotation angle "angle" of a planar rotation along unit vector e, rotating frame 1 into frame 2, given the coordinate representations of a vector "v" in frame 1 (v1) and in frame 2 (v2). Therefore, the result of this function fulfills the following equation:

    v2 = resolve2(planarRotation(e,angle), v1)

The rotation angle is returned in the range

    -p <= angle <= p

This function makes the following assumptions on the input arguments

The function does not check the above assumptions. If these assumptions are violated, a wrong result will be returned and/or a division by zero will occur.

See also

planarRotation, TransformationMatrices.planarRotationAngle.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
e[3]Normalized axis of rotation to rotate frame 1 around e into frame 2 (must have length=1) [1]
v1[3]A vector v resolved in frame 1 (shall not be parallel to e)
v2[3]Vector v resolved in frame 2, i.e., v2 = resolve2(planarRotation(e,angle),v1)

Outputs

NameDescription
angleRotation angle to rotate frame 1 into frame 2 along axis e in the range: -pi <= angle <= pi [rad]

Modelica.Mechanics.MultiBody.Frames.axisRotation Modelica.Mechanics.MultiBody.Frames.axisRotation

Return rotation object to rotate around an angle along one frame axis

Information

Syntax

R = Frames.axisRotation(axis, angle, der_angle);

Description

The function call Frames.axisRotation(axis, angle, der_angle) returns orientation object R that describes the orientation to rotate along unit axis axis from frame 1 into frame 2 with angle angle and derivative of angle der_angle. For example, Frames.axisRotation(2, phi, der_phi) returns the same orientation object as with the call Frames.planarRotation({0,1,0}, phi, der_phi)

See also

planarRotation, TransformationMatrices.axisRotation.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
axisRotate around 'axis' of frame 1
angleRotation angle to rotate frame 1 into frame 2 along 'axis' of frame 1 [rad]
der_angle= der(angle) [rad/s]

Outputs

NameDescription
ROrientation object to rotate frame 1 into frame 2

Modelica.Mechanics.MultiBody.Frames.axesRotations Modelica.Mechanics.MultiBody.Frames.axesRotations

Return fixed rotation object to rotate in sequence around fixed angles along 3 axes

Information

Syntax

R = Frames.axesRotations(sequence, angles, der_angles);

Description

This function returns orientation object R that describes the orientation defined by three elementary rotations in a given sequence, each rotated by angles. The angular velocity vector R.w is calculated from the angle derivatives der_angles.

See also

TransformationMatrices.axesRotations.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
sequence[3]Sequence of rotations from frame 1 to frame 2 along axis sequence[i]
angles[3]Rotation angles around the axes defined in 'sequence' [rad]
der_angles[3]= der(angles) [rad/s]

Outputs

NameDescription
ROrientation object to rotate frame 1 into frame 2

Modelica.Mechanics.MultiBody.Frames.axesRotationsAngles Modelica.Mechanics.MultiBody.Frames.axesRotationsAngles

Return the 3 angles to rotate in sequence around 3 axes to construct the given orientation object

Information

Syntax

angles = Frames.axesRotationsAngles(R, sequence, guessAngle1);

Description

A call to this function of the form

  Frames.Orientation R;
  parameter Integer sequence[3] = {1,2,3};
  Modelica.SIunits.Angle angles[3];
equation
  angle = axesRotationAngles(R, sequence);

computes the rotation angles "angles[1:3]" to rotate frame 1 into frame 2 along axes sequence[1:3], given the orientation object R from frame 1 to frame 2. Therefore, the result of this function fulfills the following equation:

R = axesRotation(sequence, angles)

The rotation angles are returned in the range

-p <= angles[i] <= p

There are two solutions for "angles[1]" in this range. Via the third argument guessAngle1 (default = 0) the returned solution is selected such that |angles[1] - guessAngle1| is minimal. The orientation object R may be in a singular configuration, i.e., there is an infinite number of angle values leading to the same R. The returned solution is selected by setting angles[1] = guessAngle1. Then angles[2] and angles[3] can be uniquely determined in the above range.

Note, that input argument sequence has the restriction that only values 1,2,3 can be used and that sequence[1] ≠ sequence[2] and sequence[2] ≠ sequence[3]. Often used values are:

sequence = {1,2,3}  // Cardan angle sequence
         = {3,1,3}  // Euler angle sequence
         = {3,2,1}  // Tait-Bryan angle sequence

See also

TransformationMatrices.axesRotationsAngles.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
ROrientation object to rotate frame 1 into frame 2
sequence[3]Sequence of rotations from frame 1 to frame 2 along axis sequence[i]
guessAngle1Select angles[1] such that |angles[1] - guessAngle1| is a minimum [rad]

Outputs

NameDescription
angles[3]Rotation angles around the axes defined in 'sequence' such that R=Frames.axesRotation(sequence,angles); -pi < angles[i] <= pi [rad]

Modelica.Mechanics.MultiBody.Frames.smallRotation Modelica.Mechanics.MultiBody.Frames.smallRotation

Return rotation angles valid for a small rotation and optionally residues that should be zero

Information

Syntax

phi = Frames.smallRotation(R, withResidues);

Description

This function returns rotation angles valid for a small rotation of x-y-z sequence (i.e. {1,2,3}). Optionally, residues are returned as well if withResidues=true.

See also

TransformationMatrices.smallRotation, Quaternions.smallRotation.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
ROrientation object to rotate frame 1 into frame 2
withResidues= false/true, if 'angles'/'angles and residues' are returned in phi

Outputs

NameDescription
phi[if withResidues then 6 else 3]The rotation angles around x-, y-, and z-axis of frame 1 to rotate frame 1 into frame 2 for a small rotation + optionally 3 residues that should be zero [rad]

Modelica.Mechanics.MultiBody.Frames.from_nxy Modelica.Mechanics.MultiBody.Frames.from_nxy

Return fixed orientation object from n_x and n_y vectors

Information

Syntax

R = Frames.from_nxy(n_x, n_y);

Description

It is assumed that the two input vectors n_x and n_y are resolved in frame 1 and are directed along the x and y axis of frame 2 (i.e., n_x and n_y are orthogonal to each other). The function returns the orientation object R to rotate from frame 1 to frame 2.

The function is robust in the sense that it returns always an orientation object R, even if n_y is not orthogonal to n_x. This is performed in the following way:
If n_x and n_y are not orthogonal to each other, first a unit vector e_y is determined that is orthogonal to n_x and is lying in the plane spanned by n_x and n_y. If n_x and n_y are parallel or nearly parallel to each other, a vector e_y is selected arbitrarily such that e_x and e_y are orthogonal to each other.

See also

TransformationMatrices.from_nxy.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
n_x[3]Vector in direction of x-axis of frame 2, resolved in frame 1 [1]
n_y[3]Vector in direction of y-axis of frame 2, resolved in frame 1 [1]

Outputs

NameDescription
ROrientation object to rotate frame 1 into frame 2

Modelica.Mechanics.MultiBody.Frames.from_nxz Modelica.Mechanics.MultiBody.Frames.from_nxz

Return fixed orientation object from n_x and n_z vectors

Information

Syntax

R = Frames.from_nxz(n_x, n_z);

Description

It is assumed that the two input vectors n_x and n_z are resolved in frame 1 and are directed along the x and z axis of frame 2 (i.e., n_x and n_z are orthogonal to each other). The function returns the orientation object R to rotate from frame 1 to frame 2.

The function is robust in the sense that it always returns an orientation object R, even if n_z is not orthogonal to n_x. This is performed in the following way:
If n_x and n_z are not orthogonal to each other, first a unit vector e_z is determined that is orthogonal to n_x and is lying in the plane spanned by n_x and n_z. If n_x and n_z are parallel or nearly parallel to each other, a vector e_z is selected arbitrarily such that n_x and e_z are orthogonal to each other.

See also

TransformationMatrices.from_nxz.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
n_x[3]Vector in direction of x-axis of frame 2, resolved in frame 1 [1]
n_z[3]Vector in direction of z-axis of frame 2, resolved in frame 1 [1]

Outputs

NameDescription
ROrientation object to rotate frame 1 into frame 2

Modelica.Mechanics.MultiBody.Frames.from_T Modelica.Mechanics.MultiBody.Frames.from_T

Return orientation object R from transformation matrix T

Information

Syntax

R = Frames.from_T(T, w);

Description

This function returns an orientation object R assembled from a transformation matrix T and an angular velocity vector w. Generally, the transformation matrix T can be gained using a function from the TransformationMatrices package.

See also

to_T. from_T_inv, TransformationMatrices.from_T, Quaternions.from_T.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
T[3, 3]Transformation matrix to transform vector from frame 1 to frame 2 (v2=T*v1)
w[3]Angular velocity from frame 2 with respect to frame 1, resolved in frame 2 (skew(w)=T*der(transpose(T))) [rad/s]

Outputs

NameDescription
ROrientation object to rotate frame 1 into frame 2

Modelica.Mechanics.MultiBody.Frames.from_T2 Modelica.Mechanics.MultiBody.Frames.from_T2

Return orientation object R from transformation matrix T and its derivative der(T)

Information

Syntax

R = Frames.from_T2(T, der_T);

Description

Computes the orientation object from a transformation matrix T and the derivative der(T) of the transformation matrix. Usually, it is more efficient to use function "from_T" instead, where the angular velocity has to be given as input argument. Only if this is not possible or too difficult to compute, use function from_T2(..).

See also

from_T.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
T[3, 3]Transformation matrix to transform vector from frame 1 to frame 2 (v2=T*v1)
der_T[3, 3]= der(T)

Outputs

NameDescription
ROrientation object to rotate frame 1 into frame 2

Modelica.Mechanics.MultiBody.Frames.from_T_inv Modelica.Mechanics.MultiBody.Frames.from_T_inv

Return orientation object R from inverse transformation matrix T_inv

Information

Syntax

R = Frames.from_T_inv(T_inv, w);

Description

This function returns an orientation object R assembled from an inverse transformation matrix T_inv and a correspondent angular velocity vector w. Generally, the transformation matrix T_inv can be gained using a function from the TransformationMatrices package, e.g. using T_inv = inverseRotation(T). Note that the velocity vector w has to be calculated accordingly.

See also

from_T, TransformationMatrices.from_T_inv, Quaternions.from_T_inv.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
T_inv[3, 3]Inverse transformation matrix to transform vector from frame 2 to frame 1 (v1=T_inv*v2)
w[3]Angular velocity from frame 1 with respect to frame 2, resolved in frame 1 (skew(w)=T_inv*der(transpose(T_inv))) [rad/s]

Outputs

NameDescription
ROrientation object to rotate frame 1 into frame 2

Modelica.Mechanics.MultiBody.Frames.from_Q Modelica.Mechanics.MultiBody.Frames.from_Q

Return orientation object R from quaternion orientation object Q

Information

Syntax

R = Frames.from_Q(Q, w);

Description

This function returns an orientation object R computed from a quaternion object Q and an angular velocity vector w.

See also

to_Q. TransformationMatrices.from_Q.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
QQuaternions orientation object to rotate frame 1 into frame 2
w[3]Angular velocity from frame 2 with respect to frame 1, resolved in frame 2 [rad/s]

Outputs

NameDescription
ROrientation object to rotate frame 1 into frame 2

Modelica.Mechanics.MultiBody.Frames.to_T Modelica.Mechanics.MultiBody.Frames.to_T

Return transformation matrix T from orientation object R

Information

Syntax

T = Frames.to_T(R);

Description

This function returns a real matrix T computed from an orientation object R. The matrix T is considered to be an object transformation matrix.

See also

from_T, to_T_inv, TransformationMatrices.to_T, Quaternions.to_T.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
ROrientation object to rotate frame 1 into frame 2

Outputs

NameDescription
T[3, 3]Transformation matrix to transform vector from frame 1 to frame 2 (v2=T*v1)

Modelica.Mechanics.MultiBody.Frames.to_T_inv Modelica.Mechanics.MultiBody.Frames.to_T_inv

Return inverse transformation matrix T_inv from orientation object R

Information

Syntax

T_inv = Frames.to_T_inv(R);

Description

This function returns a real matrix T_inv computed from an orientation object R. The matrix T_inv is considered to be an inverse transformation matrix.

See also

from_T_inv, to_T, TransformationMatrices.to_T_inv, Quaternions.to_T_inv.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
ROrientation object to rotate frame 1 into frame 2

Outputs

NameDescription
T_inv[3, 3]Inverse transformation matrix to transform vector from frame 2 into frame 1 (v1=T_inv*v2)

Modelica.Mechanics.MultiBody.Frames.to_Q Modelica.Mechanics.MultiBody.Frames.to_Q

Return quaternion orientation object Q from orientation object R

Information

Syntax

Q = Frames.to_Q(R, Q_guess);

Description

This function returns a quaternion object Q computed from an orientation object R and depending on the initial guess Q_guess.

See also

from_Q, TransformationMatrices.to_Q.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
ROrientation object to rotate frame 1 into frame 2
Q_guessGuess value for output Q (there are 2 solutions; the one closer to Q_guess is used)

Outputs

NameDescription
QQuaternions orientation object to rotate frame 1 into frame 2

Modelica.Mechanics.MultiBody.Frames.to_vector Modelica.Mechanics.MultiBody.Frames.to_vector

Map rotation object into vector

Information

Syntax

vec = Frames.to_vector(R);

Description

This function returns a vector vec which contains elements of a transformation matrix T computed from an orientation object R.

See also

to_T, TransformationMatrices.to_vector.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
ROrientation object to rotate frame 1 into frame 2

Outputs

NameDescription
vec[9]Elements of R in one vector

Modelica.Mechanics.MultiBody.Frames.to_exy Modelica.Mechanics.MultiBody.Frames.to_exy

Map rotation object into e_x and e_y vectors of frame 2, resolved in frame 1

Information

Syntax

exy = Frames.to_exy(R);

Description

This function returns unit vectors e_x and e_y which define axes of frame 2 resolved in frame 1, provided R is an orientation object to rotate frame 1 into frame 2.

See also

from_nxy, from_nxz, TransformationMatrices.to_exy.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
ROrientation object to rotate frame 1 into frame 2

Outputs

NameDescription
exy[3, 2]= [e_x, e_y] where e_x and e_y are axes unit vectors of frame 2, resolved in frame 1

Modelica.Mechanics.MultiBody.Frames.axis Modelica.Mechanics.MultiBody.Frames.axis

Return unit vector for x-, y-, or z-axis

Information

Syntax

e = Frames.axis(axis);

Description

A unit vector e is returned depending on whether x-, y-, or z-axis is required.

 axis  |    e
-------+-----------
  1    |  {1,0,0}
  2    |  {1,0,0}
  3    |  {1,0,0}

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

NameDescription
axisAxis vector to be returned

Outputs

NameDescription
e[3]Unit axis vector [1]
Automatically generated Thu Dec 19 17:20:06 2019.