Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Develop a MathCAD file that analytically rotates a 3D state of stress from its i

ID: 3144652 • Letter: D

Question

Develop a MathCAD file that analytically rotates a 3D state of stress from its initial Cartesian reference frame (xyz) to another frame (x’y’z’). Use rotation matrices. (a) In the first case, the input will be the 3D state of stress and the angle of rotation (assume about the z-axis). (b) In the second case assume two sequentially applied rotations (one about z and another x’). (c) In the last case, assume three sequential rotations (first z, then x’, and about z’). These angles of rotation are known as Euler Angles (http://mathworld.wolfram.com/EulerAngles.html). Provide sample cases to demonstrate the performance of the code.

I realize this is a coding problem, but how to setup the coding is my difficulty with this problem. Any help is greatly appreciated.

Explanation / Answer

Matlab code:

clc; clear all;
% Input Tensors (Matrices) in MATLAB Format
A11= input('first row first element of the stress matrix:');
A12= input('first row second element of the stress matrix:');
A13= input('first row third element of the stress matrix:');
A21= input('second row first element of the stress matrix:');
A22= input('second row second element of the stress matrix:');
A23= input('second row third element of the stress matrix:');
A31= input('third row first element of the stress matrix:');
A32= input('third row second element of the stress matrix:');
A33= input('third row third element of the stress matrix:');
% input for the first rotation is by an angle theat1 about the z-axis using
theta1= input('first rotation is by an angle theta1 about the z-axis using in degress');
Q1=[cosd(theta1),sind(theta1),0;-sind(theta1),cosd(theta1),0;0,0,1];
% input for the second rotation is by an angle theat1 about the x-axis using
theta2= input('second rotation is by an angle theta2 about the x-axis using in degress');
Q2=[1,0,0;0,cosd(theta2),sind(theta2);0,-sind(theta2),cosd(theta2)];
% input for the third rotation is by an angle theat1 about the z prime-axis using
theta3= input('third rotation is by an angle theta2 about the z prime-axis using in degress');
Q3=[cosd(theta3),sind(theta3),0;-sind(theta3),cosd(theta3),0;0,0,1];
parta= input('the transformation reuired, 1 for only about z axis, 2 one about z and another x’, 3 for first z, then x’, and about z’ ')
% claculting the net rotaion matrix
if parta ==1
  
Q=Q1*Q2;
end
if parta == 2
Q=Q1*Q2;
end
if parta == 3
Q=Q1*Q2*Q3;
end
% Q=[1,0,0,;0,1,0;0,0,1];
A=[A11,A12,A13;A21,A22,A23;A31,A32,A33];
% Apply Transformation Law
AP=Q*A*Q';
% Display Segement of net roation matrix and trnsformed stress matrix
disp('Original Matrix')
disp(A)
disp('NET rotation Matrix')
disp(Q)
disp('Transformed Matrix')
disp(AP)

Input:

first row first element of the stress matrix:1

first row second element of the stress matrix:2

first row third element of the stress matrix:3

second row first element of the stress matrix:4

second row second element of the stress matrix:5

second row third element of the stress matrix:6

third row first element of the stress matrix:7

third row second element of the stress matrix:8

third row third element of the stress matrix:9

first rotation is by an angle theta1 about the z-axis using in degress0

second rotation is by an angle theta2 about the x-axis using in degress30

third rotation is by an angle theta2 about the z prime-axis using in degress90

the transformation reuired, 1 for only about z axis, 2 one about z and another x’, 3 for first z, then x’, and about z’ 3 =3;

Out put

Original Matrix

     1     2     3

     4     5     6

     7     8     9

NET rotation Matrix

         0    1.0000         0

   -0.8660         0    0.5000

    0.5000         0    0.8660

Transformed Matrix

    5.0000   -0.4641    7.1962

    2.2679   -1.3301    2.9641

    7.9282   -1.0359   11.3301