Question: How to obtain accurate rotation matrices?

Hey guys,

I'm trying to build up some program to manage my composites data. But I am struggling with my compliance/stiffness in the global coordinates:

-Basically, I have the lamina's properties in local coordinates.

-When I make walls out of them with 30degress fibers orientation, I need to rotate the local stiffness several times to get the the stiffness of that particular wall.

-While I do understand the concept and manage to get the final rotation matrix correctly, I often find myself making mistakes regarding the sense of rotation of my local axis relatively to the global one.

I try to stick with one direction of rotation but if Maple has a smart way whereas I can plug in the initial configuration of the local coords relatively to the global one, show the final configuration (local aligned to the global), and get the rotation matrix that made it happen, it would be more helpful.

Thank you

Update:

I enclosed an example of the kind of operations I do:

And here is the kind of code I'm using:

PB2_W1.mw
 

NULL

restart:

with(LinearAlgebra):

Stiffness:=Matrix(6,6): Stiffness:=Matrix(6, 6, {(1, 1) = 20.4, (1, 2) = .537, (1, 3) = 1.01, (1, 4) = 0., (1, 5) = 0., (1, 6) = -0., (2, 1) = .537, (2, 2) = 1.59, (2, 3) = .73, (2, 4) = 0., (2, 5) = 0., (2, 6) = -0., (3, 1) = 1.01, (3, 2) = .73, (3, 3) = 2.86, (3, 4) = 0., (3, 5) = 0., (3, 6) = -0., (4, 1) = 0., (4, 2) = 0., (4, 3) = 0., (4, 4) = 1.5, (4, 5) = 0., (4, 6) = -0., (5, 1) = 0., (5, 2) = 0., (5, 3) = 0., (5, 4) = 0., (5, 5) = 2., (5, 6) = -0., (6, 1) = 0., (6, 2) = 0., (6, 3) = 0., (6, 4) = 0., (6, 5) = 0., (6, 6) = .8});

Stiffness := Matrix(6, 6, {(1, 1) = 20.4, (1, 2) = .537, (1, 3) = 1.01, (1, 4) = 0., (1, 5) = 0., (1, 6) = -0., (2, 1) = .537, (2, 2) = 1.59, (2, 3) = .73, (2, 4) = 0., (2, 5) = 0., (2, 6) = -0., (3, 1) = 1.01, (3, 2) = .73, (3, 3) = 2.86, (3, 4) = 0., (3, 5) = 0., (3, 6) = -0., (4, 1) = 0., (4, 2) = 0., (4, 3) = 0., (4, 4) = 1.5, (4, 5) = 0., (4, 6) = -0., (5, 1) = 0., (5, 2) = 0., (5, 3) = 0., (5, 4) = 0., (5, 5) = 2., (5, 6) = -0., (6, 1) = 0., (6, 2) = 0., (6, 3) = 0., (6, 4) = 0., (6, 5) = 0., (6, 6) = .8})

(1)

Q1:=Matrix(3,3): Q1[1,1]:=sin(Pi/4); Q1[1,2]:=0; Q1[1,3]:=cos(Pi/4); Q1[2,1]:=cos(Pi/4); Q1[2,2]:=0; Q1[2,3]:=-sin(Pi/4); Q1[3,1]:=0; Q1[3,2]:=1; Q1[3,3]:=0;

(1/2)*2^(1/2)

 

0

 

(1/2)*2^(1/2)

 

(1/2)*2^(1/2)

 

0

 

-(1/2)*2^(1/2)

 

0

 

1

 

0

(2)

Q1;

Matrix(3, 3, {(1, 1) = (1/2)*sqrt(2), (1, 2) = 0, (1, 3) = (1/2)*sqrt(2), (2, 1) = (1/2)*sqrt(2), (2, 2) = 0, (2, 3) = -(1/2)*sqrt(2), (3, 1) = 0, (3, 2) = 1, (3, 3) = 0})

(3)

Q2:=Matrix(3,3): Q2[1,1]:=0; Q2[1,2]:=0; Q2[1,3]:=1; Q2[2,1]:=1; Q2[2,2]:=0; Q2[2,3]:=0; Q2[3,1]:=0; Q2[3,2]:=1; Q2[3,3]:=0;

0

 

0

 

1

 

1

 

0

 

0

 

0

 

1

 

0

(4)

Q2;

Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 1, (2, 1) = 1, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 1, (3, 3) = 0})

(5)

Q3:=Matrix(3,3): Q3[1,1]:=0; Q3[1,2]:=-1; Q3[1,3]:=0; Q3[2,1]:=1; Q3[2,2]:=0; Q3[2,3]:=0; Q3[3,1]:=0; Q3[3,2]:=0; Q3[3,3]:=1;

0

 

-1

 

0

 

1

 

0

 

0

 

0

 

0

 

1

(6)

Q3;

Matrix(3, 3, {(1, 1) = 0, (1, 2) = -1, (1, 3) = 0, (2, 1) = 1, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1})

(7)

S1:=Transpose(Q1); S2:=Transpose(Q2); S3:=Transpose(Q3);

S1 := Matrix(3, 3, {(1, 1) = (1/2)*sqrt(2), (1, 2) = (1/2)*sqrt(2), (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 1, (3, 1) = (1/2)*sqrt(2), (3, 2) = -(1/2)*sqrt(2), (3, 3) = 0})

 

S2 := Matrix(3, 3, {(1, 1) = 0, (1, 2) = 1, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 1, (3, 1) = 1, (3, 2) = 0, (3, 3) = 0})

 

S3 := Matrix(3, 3, {(1, 1) = 0, (1, 2) = 1, (1, 3) = 0, (2, 1) = -1, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1})

(8)

S4:=Multiply(S3,S2);

S4 := Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 1, (2, 1) = 0, (2, 2) = -1, (2, 3) = 0, (3, 1) = 1, (3, 2) = 0, (3, 3) = 0})

(9)

S5:=Multiply(S4,S1);

S5 := Matrix(3, 3, {(1, 1) = (1/2)*sqrt(2), (1, 2) = -(1/2)*sqrt(2), (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = -1, (3, 1) = (1/2)*sqrt(2), (3, 2) = (1/2)*sqrt(2), (3, 3) = 0})

(10)

R:=Matrix(6,6): R[1,1]:=S5[1,1]^2; R[1,2]:=S5[1,2]^2; R[1,3]:=S5[1,3]^2; R[2,1]:=S5[2,1]*S5[1,1]; R[2,2]:=S5[2,2]*S5[1,2]; R[2,3]:=S5[2,3]*S5[1,3]; R[3,1]:=S5[2,1]^2; R[3,2]:=S5[2,2]^2; R[3,3]:=S5[2,3]^2; R[1,4]:=2*S5[1,2]*S5[1,3]; R[1,5]:=2*S5[1,1]*S5[1,3]; R[1,6]:=2*S5[1,1]*S5[1,2]; R[2,4]:=S5[2,2]*S5[1,3]+S5[2,3]*S5[1,2]; R[2,5]:=S5[2,1]*S5[1,3]+S5[2,3]*S5[1,1]; R[2,6]:=S5[2,1]*S5[1,2]+S5[2,2]*S5[1,1]; R[3,4]:=2*S5[2,2]*S5[2,3]; R[3,5]:=2*S5[2,1]*S5[2,3]; R[3,6]:=2*S5[2,1]*S5[2,2];

R[4,1]:=S5[3,1]*S5[1,1]; R[4,2]:=S5[3,2]*S5[1,2]; R[4,3]:=S5[3,3]*S5[1,3]; R[4,4]:=S5[3,2]*S5[1,3]+S5[3,3]*S5[1,2]; R[4,5]:=S5[3,1]*S5[1,3]+S5[3,3]*S5[1,1]; R[4,6]:=S5[3,1]*S5[1,2]+S5[3,2]*S5[1,1]; R[5,1]:=S5[3,1]*S5[2,1]; R[5,2]:=S5[3,2]*S5[2,2]; R[5,3]:=S5[3,3]*S5[2,3]; R[5,4]:=S5[3,2]*S5[2,3]+S5[3,3]*S5[2,2]; R[5,5]:=S5[3,1]*S5[2,3]+S5[3,3]*S5[2,1]; R[5,6]:=S5[3,1]*S5[2,2]+S5[3,2]*S5[2,1];R[6,1]:=S5[3,1]^2; R[6,2]:=S5[3,2]^2; R[6,3]:=S5[3,3]^2; R[6,4]:=2*S5[3,3]*S5[3,2]; R[6,5]:=2*S5[3,1]*S5[3,3]; R[6,6]:=2*S5[3,1]*S5[3,2];

1/2

 

1/2

 

0

 

0

 

0

 

0

 

0

 

0

 

1

 

0

 

0

 

-1

 

(1/2)*2^(1/2)

 

-(1/2)*2^(1/2)

 

0

 

0

 

0

 

0

 

1/2

 

-1/2

 

0

 

0

 

0

 

0

 

0

 

0

 

0

 

-(1/2)*2^(1/2)

 

-(1/2)*2^(1/2)

 

0

 

1/2

 

1/2

 

0

 

0

 

0

 

1

(11)

print(R);

Matrix(6, 6, {(1, 1) = 1/2, (1, 2) = 1/2, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = -1, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = (1/2)*sqrt(2), (2, 5) = -(1/2)*sqrt(2), (2, 6) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (4, 1) = 1/2, (4, 2) = -1/2, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = -(1/2)*sqrt(2), (5, 5) = -(1/2)*sqrt(2), (5, 6) = 0, (6, 1) = 1/2, (6, 2) = 1/2, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 1})

(12)

RTrans:=Transpose(R);

RTrans := Matrix(6, 6, {(1, 1) = 1/2, (1, 2) = 0, (1, 3) = 0, (1, 4) = 1/2, (1, 5) = 0, (1, 6) = 1/2, (2, 1) = 1/2, (2, 2) = 0, (2, 3) = 0, (2, 4) = -1/2, (2, 5) = 0, (2, 6) = 1/2, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (4, 1) = 0, (4, 2) = (1/2)*sqrt(2), (4, 3) = 0, (4, 4) = 0, (4, 5) = -(1/2)*sqrt(2), (4, 6) = 0, (5, 1) = 0, (5, 2) = -(1/2)*sqrt(2), (5, 3) = 0, (5, 4) = 0, (5, 5) = -(1/2)*sqrt(2), (5, 6) = 0, (6, 1) = -1, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 1})

(13)

Stiff1:=Matrix(6,6): Stiff1:=Multiply(Stiffness, RTrans);

Stiff1 := Matrix(6, 6, {(1, 1) = 10.46850000, (1, 2) = 0., (1, 3) = 1.01, (1, 4) = 9.931500000, (1, 5) = 0., (1, 6) = 10.46850000, (2, 1) = 1.063500000, (2, 2) = 0., (2, 3) = .73, (2, 4) = -.5265000000, (2, 5) = 0., (2, 6) = 1.063500000, (3, 1) = .8700000000, (3, 2) = 0., (3, 3) = 2.86, (3, 4) = .1400000000, (3, 5) = 0., (3, 6) = .8700000000, (4, 1) = 0., (4, 2) = .7500000000*sqrt(2), (4, 3) = 0., (4, 4) = 0., (4, 5) = -.7500000000*sqrt(2), (4, 6) = 0., (5, 1) = 0., (5, 2) = -1.000000000*sqrt(2), (5, 3) = 0., (5, 4) = 0., (5, 5) = -1.000000000*sqrt(2), (5, 6) = 0., (6, 1) = -.8, (6, 2) = 0., (6, 3) = 0., (6, 4) = 0., (6, 5) = 0., (6, 6) = .8})

(14)

StiffnessW1:=Matrix(6,6): StiffnessW1:=Multiply(R,Stiff1); evalf(StiffnessW1,3);

StiffnessW1 := Matrix(6, 6, {(1, 1) = 6.566000000, (1, 2) = 0., (1, 3) = .8700000000, (1, 4) = 4.702500000, (1, 5) = 0., (1, 6) = 4.966000000, (2, 1) = 0., (2, 2) = 1.750000000, (2, 3) = 0., (2, 4) = 0., (2, 5) = .2500000000, (2, 6) = 0., (3, 1) = .8700000000, (3, 2) = 0., (3, 3) = 2.86, (3, 4) = .1400000000, (3, 5) = 0., (3, 6) = .8700000000, (4, 1) = 4.702500000, (4, 2) = 0., (4, 3) = .1400000000, (4, 4) = 5.229000000, (4, 5) = 0., (4, 6) = 4.702500000, (5, 1) = 0., (5, 2) = .2500000000, (5, 3) = 0., (5, 4) = 0., (5, 5) = 1.750000000, (5, 6) = 0., (6, 1) = 4.966000000, (6, 2) = 0., (6, 3) = .8700000000, (6, 4) = 4.702500000, (6, 5) = 0., (6, 6) = 6.566000000})

 

Matrix(6, 6, {(1, 1) = 6.57, (1, 2) = 0., (1, 3) = .870, (1, 4) = 4.70, (1, 5) = 0., (1, 6) = 4.97, (2, 1) = 0., (2, 2) = 1.75, (2, 3) = 0., (2, 4) = 0., (2, 5) = .250, (2, 6) = 0., (3, 1) = .870, (3, 2) = 0., (3, 3) = 2.86, (3, 4) = .140, (3, 5) = 0., (3, 6) = .870, (4, 1) = 4.70, (4, 2) = 0., (4, 3) = .140, (4, 4) = 5.23, (4, 5) = 0., (4, 6) = 4.70, (5, 1) = 0., (5, 2) = .250, (5, 3) = 0., (5, 4) = 0., (5, 5) = 1.75, (5, 6) = 0., (6, 1) = 4.97, (6, 2) = 0., (6, 3) = .870, (6, 4) = 4.70, (6, 5) = 0., (6, 6) = 6.57})

(15)

 

 

NULL


 

Download PB2_W1.mw

It is decent enough to get results if human mistakes don't happen when it comes to rotation orientation (which tends to happen more often than not). 

I am aware though that it is not written with wits or in an efficient format. If you have a suggestion, Im all ears.

 

Thanks again

 

 

Please Wait...