0% found this document useful (0 votes)
62 views6 pages

ME 482/582 Chapter 2 HW Solution: U A B C T T T U

This document contains solutions to homework problems from a chapter in a mechanics course. It includes derivations and explanations of rotation matrices relating to rotating reference frames. Several rotation matrices are presented and the properties of orthonormal matrices are discussed. Steps are shown for relating points in Cartesian and spherical coordinate systems using rotation operations. Euler angles corresponding to a given rotation matrix are also determined. The document concludes by explaining that the angle between two fixed vectors in a body is constant, and that a rotation matrix must be orthonormal to preserve vector dot products under transformation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views6 pages

ME 482/582 Chapter 2 HW Solution: U A B C T T T U

This document contains solutions to homework problems from a chapter in a mechanics course. It includes derivations and explanations of rotation matrices relating to rotating reference frames. Several rotation matrices are presented and the properties of orthonormal matrices are discussed. Steps are shown for relating points in Cartesian and spherical coordinate systems using rotation operations. Euler angles corresponding to a given rotation matrix are also determined. The document concludes by explaining that the angle between two fixed vectors in a body is constant, and that a rotation matrix must be orthonormal to preserve vector dot products under transformation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

ME 482/582 Chapter 2 HW September 7, 2011

ME 482/582 Chapter 2 HW Solution

2.1 These are both rotations relative to the “reference” frame, so we premultiply:
 
cθ −sθ 0
R = RX (φ)RZ (θ)I = cφsθ cφcθ −sφ (1)
sφsθ sφcθ cφ

The I (identity) matrix in (1) represents the original orientation of frame {B}; I inserted that just to clarify the fact
that we’re premultiplying here.
Note that when you operate on a vector you have to premultiply—the dimensions are incompatible if you try to
postmultiply. And that makes sense—postmultiplication represents operations along/around the moving frame axes,
and with just a vector there’s no frame. So the only option is to transform the vector along/around the reference
frame axes, which implies premultiplication.

2.3 The mapping matrix that changes the relativity is the same as the descriptor matrix, which can be also thought
of as the operator matrix that “produces” the new frame. Here the rotations are “body” or “moving” frame rotations,
hence we should postmultiply:
 
cθ −sθcφ sθsφ
R = IRZ (θ)RX (φ) = sθ cθcφ −cθsφ (2)
0 sφ cφ

Again, I inserted the I matrix to represent the initial orientation of frame {B} to clearly show the postmultiplication.
Note that since the two frames are initially coincident, the first multiplication could be pre- or post-, it wouldn’t
matter.

2.5 The eigenvalue problem with matrix A, eigenvector x, and eigenvalue λ can then be stated as: Ax = λx. Here
we have
A
B RV = λV (3)

For the eigenvector λ = 1 the vector V is unchanged by the rotation. The only vector that is always unchanged by a
rotation is the axis of rotation. Hence if you have an arbitrary R matrix—find the eigenvector corresponding to the
eigenvalue λ = 1 and you will have the axis of rotation!

2.12 Velocity vectors are free vectors, and must never be operated on by a 4 × 4 T transformation matrix—only by a
3 × 3 R matrix. Extract the A A
B R partition from the given B T matrix and use that. My result—which I obtained using
MATLAB—is:
 
−1.3400
A
V= A B
BR V =
 22.3200  (4)
30.0000

2.13 The graphical transform diagram for this problem is

U A B C U

U B B C
AT AT CT UT

1
ME 482/582 Chapter 2 HW September 7, 2011

From this transform diagram, going from B to C the “long” way yields the desired result is
 
0.5000 0.7500 0.4330 −6.5754
B B U −1 C −1
−0.7500 0.6250 −0.2165 19.7877 
C T = AT AT UT = (5)

−0.4330 −0.2165 0.8750 −28.3185
0 0 0 1.0000

2.18 Consider a frame {B} initially coincident with frame {A}. To describe a point using spherical coordinates one
must perform the following three operations (remember that a descriptor is the same as the operator sequence that
produces the result):

1. Rotate {B} around ZA by angle α


2. Rotate {B} around YB by angle −β (actually rotate around -YB by β)
3. Translate along XB by displacement r

Since all operations are performed around/along the rotated frame, we postmultiply, and the operator sequence that
will accomplish the description of this point in spherical coordinates is
Psph = RZ (α)RY (−β)DX (r) (6)
     
cα −sα 0 0 cβ 0 −sβ 0 1 0 0 r ∗ ∗ ∗ rcαcβ
sα cα 0 0  0 1 0 0 0 1 0 0 ∗ ∗ ∗ rsαcβ 
=   =  (7)
0 0 1 0 sβ 0 cβ 0 0 0 1 0 ∗ ∗ ∗ rsβ 
0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1

Since we really want the position of the transformed frame’s origin, extract the 4th column (first three components)
from (7), so we have
 
r cos α cos β
A
P =  r sin α cos β  (8)
r sin β

2.28 I think the geometry is simple enough to find the frame by inspection; you don’t need to use any rota-
tion/translation operations (or involve frame {B}. The transform A
C T I found this way was
   
0 −0.5 0.866 3 r11 r12 r13 x
A
 0 0.866 0.5 0 r21 r22 r23 y 
C T = −1
 =  (9)
0 0 2 r31 r32 r33 z 
0 0 0 1 0 0 0 1

Using text equations (2.74), we find that the Z-Y-Z Euler angles which correspond to this rotation matrix are

β = 90◦ (−90◦ ) (10)


◦ ◦
α = 30 (−150 ) (11)
γ = 0◦ (−180◦ ) (12)

The angles in parentheses are the result if you use the “-” sign for the square root term in the expression for angle β.
The “parenthesized” results are correct but are not minimal rotations.

2.38 If two vectors V1 and V2 are fixed in the same body, the angle α between them is constant. This angle can be
found from the dot product, hence
V1 · V2 = V1T V2 = cos α (13)

2
ME 482/582 Chapter 2 HW September 7, 2011

Next operate on each of these vectors by a rotation operator R and compute their dot product, where the result must
be the same:
T
(RV1 ) (RV2 ) = V1T V2 (14)
T
Finally, use the property of the matrix transpose (AB) = BT AT :

V1T RT RV2 = V1T V2 =⇒ RT R = I (15)

which shows that rotation matrix R has transpose equal to inverse (since RT = R−1 .
Since the expression RT R represents the dot products of all the columns of R, this also shows that a rotation matrix
is orthonormal (the “normal” part means its columns have a norm of one) since RT R = I, the identity matrix.

Programming Exercises. When I write programs, I like to insert lots of comments and make everything as easy to
follow as possible. My two functions are:

% IFORM = utoi(UFORM). This function converts from USER form, given by


% vector UFORM = [x y theta]’ with x and y in meters, and theta in degrees.
% Result IFORM is a 3x3 matrix representing position and orientation.
%

function iform = utoi(uform)

RAD = pi/180; % Conversion factor from degrees -> radians

x = uform(1); % Get both x and


y = uform(2); % y position, and
theta = uform(3)*RAD; % angle in degrees.

iform = [cos(theta) -sin(theta) x; % Convert to transform matrix


sin(theta) cos(theta) y; % using rotation about z and
0 0 1]; % last column for position.

------------------------------------------------------------------------------------------

% UFORM = itou(IFORM). This function converts from INTERNAL form, given by


% a 3x3 matrix which represents position and orientation, to USER form,
% given by vector [x y theta]’. Position is in meters, with angle in
% degrees.
%
function uform = itou(iform)

DEG = 180/pi; % Conversion factor from radians -> degrees

c_theta = iform(1,1);
s_theta = iform(2,1);

theta = atan2(s_theta,c_theta); % Compute the angle using atan2, which


x = iform(1,3); % will return -pi<theta<pi, and get
y = iform(2,3); % the last column for position

uform = [x y theta*DEG]’; % Assemble the result vector, with angle in degrees.

3
ME 482/582 Chapter 2 HW September 7, 2011

When I used these functions (along with the MATLAB matrix inverse and multiply) in my “main program” chpt2.m,
I got the following results for the “internal” and “user” forms of B
C T:

>> chpt2
Final internal form:

T_CBi =

0.7071 -0.7071 -10.8840


0.7071 0.7071 9.3616
0 0 1.0000

Final user form:

T_CBu =

-10.8840
9.3616
45.0000

The MATLAB code for files utoi.m and itou.m will be on my website after the homework is due.

MATLAB EXERCISE 2A.


(a) My MATLAB function is:

function R = euler2R(e)
% R = euler2R(e)
%
% MATLAB function to satisy MATLAB Exercise 2A, part (a); convert Z-Y-Z
% Euler angles to the corresponding 3x3 rotation matrix R. Vector e should
% contain the three angles (deg) as either a row or column vector.

RAD = pi/180; % Conversion to radians

% Define the needed trig functions of the angles for clarity and efficienty

ca = cos(e(1)*RAD);
sa = sin(e(1)*RAD);

cb = cos(e(2)*RAD);
sb = sin(e(2)*RAD);

cg = cos(e(3)*RAD);
sg = sin(e(3)*RAD);

% Finally, compute the rotation matrix

R = [ca*cb*cg-sa*sg -ca*cb*sg-sa*cg ca*sb;


sa*cb*cg+ca*sg -sa*cb*sg+ca*cg sa*sb;
-sb*cg sb*sg cb];

4
ME 482/582 Chapter 2 HW September 7, 2011

(i) For the first example I got:

>> e = [10 20 30];


>> R = euler2R(e)

R = 0.7146 -0.6131 0.3368 % This is the resulting R matrix given


0.6337 0.7713 0.0594 % the three Z-Y-Z Euler angles.
-0.2962 0.1710 0.9397

>> X = R(:,1); Y = R(:,2); Z = R(:,3); % Define X Y Z as columns of R

>> norm(X), norm(Y), norm(Z) % Each column has a magnitude of 1, so 3 constraints

ans = 1, ans = 1, ans = 1

>> dot(X,Y), dot(X,Z), dot(Y,Z)

ans = -2.7756e-17, ans = 0, ans = 0 % All three dot products are 0, so 3 more constraints

Therefore given 9 elements in R, and 6 constraints, there are only 3 resulting independent quantities.
(ii) For the second example,

>> e = [30 90 -55];


>> R = euler2R(e)

R = 0.4096 -0.2868 0.8660


-0.7094 0.4967 0.5000
-0.5736 -0.8192 0.0000

The same tests can be carried on these results as in example (i)—they all work.

(b) My MATLAB function is:

function [e1,e2] = R2euler(R)


% [e1,e2] = R2euler(R)
%
% This function converts the 3x3 R matrix to corresponding Z-Y-Z Euler
% angles. Two sets of angles are generated and returned in e1 and e2.

DEG = 180/pi; % Conversion factor to degrees

% Find the first solution (use positive sign on square root)

b1 = atan2(sqrt(R(3,1)^2+R(3,2)^2),R(3,3)); % Find beta


sbsign = sign(sin(b1)); % Find sign of sin(beta)
a1 = atan2(R(2,3)*sbsign,R(1,3)*sbsign);
g1 = atan2(R(3,2)*sbsign,-R(3,1)*sbsign);

% Find the second solution (use negative sign on square root)

b2 = atan2(-sqrt(R(3,1)^2+R(3,2)^2),R(3,3)); % Find beta


sbsign = sign(sin(b2)); % Find sign of sin(beta)
a2 = atan2(R(2,3)*sbsign,R(1,3)*sbsign);
g2 = atan2(R(3,2)*sbsign,-R(3,1)*sbsign);

% Return Euler angles (deg) in vectors e1 and e2.

5
ME 482/582 Chapter 2 HW September 7, 2011

e1 = [a1 b1 g1]*DEG;
e2 = [a2 b2 g2]*DEG;

To demonstrate the function, I’ll show part (ii) only—part (i) works also.

>> e = [30 90 -55]; % Euler angles for part (ii)


>> R = euler2R(e)

R = 0.4096 -0.2868 0.8660 % Equivalent rotation matrix R


-0.7094 0.4967 0.5000
-0.5736 -0.8192 0.0000

>> [e1,e2] = R2euler(R) % Give R, find the corresponding Euler angles

e1 = 30.0000 90.0000 -55.0000 % This one agrees with original


e2 = -150.0000 -90.0000 125.0000 % This is the second solution

>> R = euler2R(e2) % Find R corresponding to second set of Euler angles

R = 0.4096 -0.2868 0.8660 % It agrees with original R, so both sets of


-0.7094 0.4967 0.5000 % Euler angles are equivalent.
-0.5736 -0.8192 0.0000

(c) Starting with coincident frames {A} and {B}, rotating frame {B} by β = 20◦ (Y axis only), we have for A
B R:

>> R = euler2R(e)

R = 0.9397 0 0.3420
0 1.0000 0
-0.3420 0 0.9397

B
 T
Given vector P= 1 0 1 , to express this vector in frame {A} we have

>> Pb = [1 0 1]’; % Define vector P relative to frame {B}


>> Pa = R*Pb % Change relativity to frame {A}

Pa = 1.2817
0
0.5977

A sketch is shown below. Note that axis Y is directed into the page.

ZA ZB

P
0.597

XA
1.28

XB

You might also like