# Order of rotations due to torque in 3DOF in simulations

• A
• zonexo

#### zonexo

TL;DR Summary
What is the orientation of a body rotating in 3 axes after t=1sec, using very small rotations to each time step
Hi,

I am running a computational fluid dynamics (CFD) simulation. Supposed I have a symmetrical rigid body in space experiencing torque in the global x,y,z axes. It is stationary at t = 0. I also constrain it to only allow rotations in 3DOFs, and no translation.

It will rotate and I need to know its orientation after t = 1s.

Each time step is 1e-5s. And I can get the torque at each time step. So 1st I need to obtain the angular accelerations (alpha) in the global x,y,z axes. I understand that torque folllows: torque_x/y/z = I_xx/yy/zz*alpha_x/y/z

So I can get alpha_x/y/z. Then I can then get the auglar vel and the angle rotated.

But how should I rotate the body to its new orientation at each time step? If I'm using rotational matrix R_x, R_y, R_z (or even quaterions), should the total rotation matrix by R_x*R_y*R_z or R_z*R_y*R_x? Because I thought matrices are not commutative, so would the body get a different orientation if I use different combinations? But there should only be a single correction orientation after the body experienced torque combination in the 3 axes.

At each time step (1e-5s), the angles rotated are small, so does it mean the rotation matrics can be commutative and so it doesn't matter?

Supposed at each time step, the angles at each axis are rotated 0.0001deg, what will be the final orientation of the body at t = 1s? Will it be the same as either using R_x*R_y*R_z or R_z*R_y*R_x and rotating by 10deg (since 0.0001*10000 time steps = 10deg)?

Lastly, if I also include forces acting at the body's CG, would it make any difference to the above rotation formulation (besides the body translating to a new position)?

Hope someone can clarify my doubts. Thanks!

1st I need to obtain the angular accelerations (alpha) in the global x,y,z axes. I understand that torque folllows: torque_x/y/z = I_xx/yy/zz*alpha_x/y/z
Careful here: I_xx/yy/zz is usually given in the local system of the body, where it is constant. Make sure you are not mixing global and local systems in this equation.

Then I can then get the auglar vel and the angle rotated.

But how should I rotate the body to its new orientation at each time step?
The angular velocity is a vector, which is along the instantaneous rotation axis. So you need something to convert from axis-angle to matrix or to quaternion:
https://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToMatrix/index.htm
https://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm

• berkeman