Modelica.Mechanics.MultiBody.Frames.TransformationMatrices

Functions for transformation matrices

Information

Package Frames.TransformationMatrices contains type definitions and functions to transform rotational frame quantities using transformation matrices.

Content

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

   Orientation T, T1, T2, T_rel, 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 T; New type defining an orientation object that describes
the rotation of frame 1 into frame 2.
der_Orientation der_T; New type defining the first time derivative of Frames.Orientation.
res_ori = orientationConstraint(T); Return the constraints between the variables of an orientation object
(shall be zero).
w1 = angularVelocity1(T, der_T); Return angular velocity resolved in frame 1 from orientation object T
and its derivative der_T.
w2 = angularVelocity2(T, der_T); Return angular velocity resolved in frame 2 from orientation object T
and its derivative der_T.
v1 = resolve1(T,v2); Transform vector v2 from frame 2 to frame 1.
v2 = resolve2(T,v1); Transform vector v1 from frame 1 to frame 2.
[v1,w1] = multipleResolve1(T, [v2,w2]); Transform several vectors from frame 2 to frame 1.
[v2,w2] = multipleResolve2(T, [v1,w1]); Transform several vectors from frame 1 to frame 2.
D1 = resolveDyade1(T,D2); Transform second order tensor D2 from frame 2 to frame 1.
D2 = resolveDyade2(T,D1); Transform second order tensor D1 from frame 1 to frame 2.
T= nullRotation() Return orientation object T that does not rotate a frame.
T_inv = inverseRotation(T); Return inverse orientation object.
T_rel = relativeRotation(T1,T2); Return relative orientation object from two absolute orientation objects.
T2 = absoluteRotation(T1,T_rel); Return absolute orientation object from another absolute
and a relative orientation object.
T = planarRotation(e, 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.
T = axisRotation(i, angle); Return orientation object T for rotation around axis i of frame 1.
T = axesRotations(sequence, angles); Return rotation object to rotate in sequence around 3 axes. Example:
T = axesRotations({1,2,3},{90,45,-90});
angles = axesRotationsAngles(T, sequence); Return the 3 angles to rotate in sequence around 3 axes to
construct the given orientation object.
phi = smallRotation(T); Return rotation angles phi valid for a small rotation.
T = from_nxy(n_x, n_y); Return orientation object from n_x and n_y vectors.
T = from_nxz(n_x, n_z); Return orientation object from n_x and n_z vectors.
R = from_T(T); Return orientation object R from transformation matrix T.
R = from_T_inv(T_inv); Return orientation object R from inverse transformation matrix T_inv.
T = from_Q(Q); Return orientation object T from quaternion orientation object Q.
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(T); Return quaternion orientation object Q from orientation object T.
exy = to_exy(T); Return [e_x, e_y] matrix of an orientation object T,
with e_x and e_y vectors of frame 2, resolved in frame 1.

Extends from Modelica.Icons.FunctionsPackage (Icon for packages containing functions).

Package Content

Name Description
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.Orientation Orientation Orientation type defining rotation from a frame 1 into a frame 2 with a transformation matrix
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.der_Orientation der_Orientation New type defining the first time derivative of Orientation
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.orientationConstraint orientationConstraint Return residues of orientation constraints (shall be zero)
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.angularVelocity1 angularVelocity1 Return angular velocity resolved in frame 1 from orientation object and its derivative
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.angularVelocity2 angularVelocity2 Return angular velocity resolved in frame 2 from orientation object and its derivative
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve1 resolve1 Transform vector from frame 2 to frame 1
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve2 resolve2 Transform vector from frame 1 to frame 2
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.multipleResolve1 multipleResolve1 Transform several vectors from frame 2 to frame 1
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.multipleResolve2 multipleResolve2 Transform several vectors from frame 1 to frame 2
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolveDyade1 resolveDyade1 Transform second order tensor from frame 2 to frame 1
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolveDyade2 resolveDyade2 Transform second order tensor from frame 1 to frame 2
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.nullRotation nullRotation Return orientation object that does not rotate a frame
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.inverseRotation inverseRotation Return inverse orientation object
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.relativeRotation relativeRotation Return relative orientation object
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.absoluteRotation absoluteRotation Return absolute orientation object from another absolute and a relative orientation object
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.planarRotation planarRotation Return orientation object of a planar rotation
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.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.TransformationMatrices.axisRotation axisRotation Return rotation object to rotate around one frame axis
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.axesRotations axesRotations Return rotation object to rotate in sequence around 3 axes
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.axesRotationsAngles axesRotationsAngles Return the 3 angles to rotate in sequence around 3 axes to construct the given orientation object
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.smallRotation smallRotation Return rotation angles valid for a small rotation and optionally residues that should be zero
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.from_nxy from_nxy Return orientation object from n_x and n_y vectors
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.from_nxz from_nxz Return orientation object from n_x and n_z vectors
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.from_T from_T Return orientation object R from transformation matrix T
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.from_T_inv from_T_inv Return orientation object R from inverse transformation matrix T_inv
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.from_Q from_Q Return orientation object T from quaternion orientation object Q
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.to_T to_T Return transformation matrix T from orientation object R
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.to_T_inv to_T_inv Return inverse transformation matrix T_inv from orientation object R
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.to_Q to_Q Return quaternion orientation object Q from orientation object T
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.to_vector to_vector Map rotation object into vector
Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.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.TransformationMatrices.Orientation

Orientation type defining rotation from a frame 1 into a frame 2 with a transformation matrix

Information

This type describes the rotation from a frame 1 into a frame 2. An instance R of type Orientation has the following interpretation:

   T = [ex, ey, ez];
       e.g., 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 = T * v1

The inverse orientation T_inv = 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 TransformationMatrices.orientationConstraint.

Note, that in the MultiBody library the rotation object is never directly accessed but only with the access functions provided in package TransformationMatrices. As a consequence, other implementations of Rotation can be defined by adapting this package correspondingly.

Extends from Internal.TransformationMatrix.

Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.der_Orientation

New type defining the first time derivative of Orientation

Parameters

NameValue
Custom Parameters
unit"1/s"

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

Return residues of orientation constraints (shall be zero)

Information

Syntax

residue = TransformationMatrices.orientationConstraint(T);

Description

This function returns the Real residue vector with 6 elements that describes the constraints between the 9 elements of the transformation matrix T.

See also

Frames.orientationConstraint, Quaternions.orientationConstraint.

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

Inputs

NameDescription
TOrientation 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.TransformationMatrices.angularVelocity1 Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.angularVelocity1

Return angular velocity resolved in frame 1 from orientation object and its derivative

Information

Syntax

w = TransformationMatrices.angularVelocity1(T, der_T);

Description

This function returns the angular velocity w of frame 2 with respect to frame 1, resolved in frame 1, from the transformation matrix T that describes the orientation to rotate frame 1 into frame 2 and from its first time derivative der_T:

w = vec( der(transpose(T)) * T ).

See also

Frames.angularVelocity1, Quaternions.angularVelocity1.

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

Inputs

NameDescription
TOrientation object to rotate frame 1 into frame 2
der_TDerivative of T [1/s]

Outputs

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

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

Return angular velocity resolved in frame 2 from orientation object and its derivative

Information

Syntax

w = TransformationMatrices.angularVelocity2(T, der_T);

Description

This function returns the angular velocity w of frame 2 with respect to frame 1, resolved in frame 2, from the transformation matrix T that describes the orientation to rotate frame 1 into frame 2 and from its first time derivative der_T:

w = vec( T * der(transpose(T)) ).

See also

Frames.angularVelocity2, Quaternions.angularVelocity2.

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

Inputs

NameDescription
TOrientation object to rotate frame 1 into frame 2
der_TDerivative of T [1/s]

Outputs

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

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

Transform vector from frame 2 to frame 1

Information

Syntax

v1 = TransformationMatrices.resolve1(T, v2);

Description

This function returns vector v resolved in frame 1 (=v1) from vector v resolved in frame 2 (=v2) using the transformation matrix T that describes the orientation to rotate frame 1 into frame 2.

See also

resolve2, Frames.resolve1, Quaternions.resolve1.

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

Inputs

NameDescription
TOrientation 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.TransformationMatrices.resolve2 Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolve2

Transform vector from frame 1 to frame 2

Information

Syntax

v2 = TransformationMatrices.resolve2(T, v1);

Description

This function returns vector v resolved in frame 2 (=v2) from vector v resolved in frame 1 (=v1) using the transformation matrix T that describes the orientation to rotate frame 1 into frame 2.

See also

resolve1, Frames.resolve2, Quaternions.resolve2.

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

Inputs

NameDescription
TOrientation 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.TransformationMatrices.multipleResolve1 Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.multipleResolve1

Transform several vectors from frame 2 to frame 1

Information

Syntax

v1 = TransformationMatrices.multipleResolve1(T, v2);

Description

This function returns vectors v resolved in frame 1 (=v1) from vectors v resolved in frame 2 (=v2) using the transformation matrix T that describes the orientation to rotate frame 1 into frame 2.

See also

Quaternions.multipleResolve1.

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

Inputs

NameDescription
TOrientation object to rotate frame 1 into frame 2
v2[3, :]Vectors in frame 2

Outputs

NameDescription
v1[3, size(v2, 2)]Vectors in frame 1

Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.multipleResolve2 Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.multipleResolve2

Transform several vectors from frame 1 to frame 2

Information

Syntax

v2 = TransformationMatrices.multipleResolve2(T, v1);

Description

This function returns vectors v resolved in frame 2 (=v2) from vectors v resolved in frame 1 (=v1) using the transformation matrix T that describes the orientation to rotate frame 1 into frame 2.

See also

Quaternions.multipleResolve2.

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

Inputs

NameDescription
TOrientation object to rotate frame 1 into frame 2
v1[3, :]Vectors in frame 1

Outputs

NameDescription
v2[3, size(v1, 2)]Vectors in frame 2

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

Transform second order tensor from frame 2 to frame 1

Information

Syntax

D1 = TransformationMatrices.resolveDyade1(T, D2);

Description

This function returns the second order tensor D resolved in frame 1 (= D1) from its representation in frame 2 (= D2) using the transformation matrix T that describes the orientation to rotate frame 1 into frame 2.

See also

Frames.resolveDyade1.

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

Inputs

NameDescription
TOrientation 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.TransformationMatrices.resolveDyade2 Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.resolveDyade2

Transform second order tensor from frame 1 to frame 2

Information

Syntax

D2 = TransformationMatrices.resolveDyade2(T, D1);

Description

This function returns the second order tensor D resolved in frame 2 (= D2) from its representation in frame 1 (= D1) using the transformation matrix T that describes the orientation to rotate frame 1 into frame 2.

See also

Frames.resolveDyade2.

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

Inputs

NameDescription
TOrientation 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.TransformationMatrices.nullRotation Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.nullRotation

Return orientation object that does not rotate a frame

Information

Syntax

T = TransformationMatrices.nullRotation();

Description

This function returns a transformation matrix T 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

Frames.nullRotation, Quaternions.nullRotation.

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

Outputs

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

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

Return inverse orientation object

Information

Syntax

T_inv = TransformationMatrices.inverseRotation(T);

Description

This function returns transformation matrix T_inv that describes the orientation to rotate from frame 2 to frame 1 from the transformation matrix T that describes the orientation to rotate from frame 1 into frame 2.

See also

Frames.inverseRotation, Quaternions.inverseRotation.

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

Inputs

NameDescription
TOrientation object to rotate frame 1 into frame 2

Outputs

NameDescription
T_invOrientation object to rotate frame 2 into frame 1

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

Return relative orientation object

Information

Syntax

T_rel = TransformationMatrices.relativeRotation(T1, T2);

Description

This function returns transformation matrix T_rel that describes the orientation to rotate frame 1 to frame 2 from the transformation matrix T1 that describes the orientation to rotate from frame 0 to frame 1 and from the transformation matrix T2 that describes the orientation to rotate from frame 0 to frame 2.

See also

Frames.relativeRotation, Quaternions.relativeRotation.

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

Inputs

NameDescription
T1Orientation object to rotate frame 0 into frame 1
T2Orientation object to rotate frame 0 into frame 2

Outputs

NameDescription
T_relOrientation object to rotate frame 1 into frame 2

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

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

Information

Syntax

T2 = TransformationMatrices.absoluteRotation(T1, T_rel);

Description

This function returns transformation matrix T2 that describes the orientation frame 0 to frame 2 from the transformation matrix T1 that describes the orientation to rotate from frame 0 to frame 1 and from the relative transformation matrix T2_rel that describes the orientation to rotate from frame 1 to frame 2.

See also

Frames.absoluteRotation, Quaternions.absoluteRotation.

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

Inputs

NameDescription
T1Orientation object to rotate frame 0 into frame 1
T_relOrientation object to rotate frame 1 into frame 2

Outputs

NameDescription
T2Orientation object to rotate frame 0 into frame 2

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

Return orientation object of a planar rotation

Information

Syntax

T = TransformationMatrices.planarRotation(e, angle);

Description

This function returns transformation matrix T that describes the orientation to rotate in the plane along unit axis e from frame 1 into frame 2 with angle 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, Frames.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]

Outputs

NameDescription
TOrientation object to rotate frame 1 into frame 2

Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.planarRotationAngle Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.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 = TransformationMatrices.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, Frames.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.TransformationMatrices.axisRotation Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.axisRotation

Return rotation object to rotate around one frame axis

Information

Syntax

T = TransformationMatrices.axisRotation(axis, angle);

Description

This function returns transformation matrix T that describes the orientation to rotate along unit axis axis from frame 1 into frame 2 with angle angle. For example, TransformationMatrices.axisRotation(2, phi) returns the same orientation object as with the call TransformationMatrices.planarRotation({0,1,0}, phi)

See also

planarRotation, Frames.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]

Outputs

NameDescription
TOrientation object to rotate frame 1 into frame 2

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

Return rotation object to rotate in sequence around 3 axes

Information

Syntax

T = TransformationMatrices.axesRotations(sequence, angles);

Description

This function returns transformation matrix T that describes the orientation defined by three elementary rotations in a given sequence, each rotated by angles.

See also

Frames.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]

Outputs

NameDescription
TOrientation object to rotate frame 1 into frame 2

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

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

Information

Syntax

angles = TransformationMatrices.axesRotationsAngles(T, sequence, guessAngle1);

Description

A call to this function of the form

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

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

T = 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 T may be in a singular configuration, i.e., there is an infinite number of angle values leading to the same T. 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

Frames.axesRotationsAngles.

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

Inputs

NameDescription
TOrientation 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 T=TransformationMatrices.axesRotation(sequence,angles); -pi < angles[i] <= pi [rad]

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

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

Information

Syntax

phi = TransformationMatrices.smallRotation(T, 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

Frames.smallRotation, Quaternions.smallRotation.

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

Inputs

NameDescription
TOrientation 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.TransformationMatrices.from_nxy Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.from_nxy

Return orientation object from n_x and n_y vectors

Information

Syntax

T = TransformationMatrices.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 T to rotate from frame 1 to frame 2.

The function is robust in the sense that it returns always an orientation object T, 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

Frames.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
TOrientation object to rotate frame 1 into frame 2

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

Return orientation object from n_x and n_z vectors

Information

Syntax

T = TransformationMatrices.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 T to rotate from frame 1 to frame 2.

The function is robust in the sense that it returns always an orientation object T, 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

Frames.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
TOrientation object to rotate frame 1 into frame 2

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

Return orientation object R from transformation matrix T

Information

Syntax

R = TransformationMatrices.from_T(T);

Description

This function returns a transformation matrix R which is equal to a real input matrix T.

See also

from_T_inv, to_T, Frames.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)

Outputs

NameDescription
ROrientation object to rotate frame 1 into frame 2

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

Return orientation object R from inverse transformation matrix T_inv

Information

Syntax

R = TransformationMatrices.from_T_inv(T_inv);

Description

This function returns a transformation matrix R which is inverse to real input matrix T_inv.

See also

to_T_inv, from_T, Frames.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)

Outputs

NameDescription
ROrientation object to rotate frame 1 into frame 2

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

Return orientation object T from quaternion orientation object Q

Information

Syntax

T = TransformationMatrices.from_Q(Q);

Description

This function returns a transformation matrix T computed from a quaternion object Q

See also

to_Q. Frames.from_Q.

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

Inputs

NameDescription
QQuaternions orientation object to rotate frame 1 into frame 2

Outputs

NameDescription
TOrientation object to rotate frame 1 into frame 2

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

Return transformation matrix T from orientation object R

Information

Syntax

T = TransformationMatrices.to_T(R);

Description

This function returns a real matrix T which is equal to a transformation matrix R.

See also

from_T, to_T_inv, Frames.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.TransformationMatrices.to_T_inv Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.to_T_inv

Return inverse transformation matrix T_inv from orientation object R

Information

Syntax

T_inv = TransformationMatrices.to_T_inv(R);

Description

This function returns a real matrix T_inv which is inverse to a transformation matrix R.

See also

from_T_inv, to_T, Frames.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.TransformationMatrices.to_Q Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.to_Q

Return quaternion orientation object Q from orientation object T

Information

Syntax

Q = TransformationMatrices.to_Q(T, Q_guess);

Description

This function returns a quaternion object Q computed from a transformation matrix T and depending on the initial guess Q_guess.

See also

from_Q Frames.to_Q.

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

Inputs

NameDescription
TOrientation 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.TransformationMatrices.to_vector Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.to_vector

Map rotation object into vector

Information

Syntax

vec = TransformationMatrices.to_vector(T);

Description

This function returns a vector vec which contains elements of a transformation matrix T.

See also

to_T, Frames.to_vector.

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

Inputs

NameDescription
TOrientation object to rotate frame 1 into frame 2

Outputs

NameDescription
vec[9]Elements of T in one vector

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

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

Information

Syntax

exy = TransformationMatrices.to_exy(T);

Description

This function returns unit vectors e_x and e_y which define axes of frame 2 resolved in frame 1, provided T is a transformation matrix to rotate frame 1 into  2.

See also

from_nxy, from_nxz, Frames.to_exy.

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

Inputs

NameDescription
TOrientation 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
Automatically generated Thu Dec 19 17:20:06 2019.