I was playing with simulation of Euler's equations of rotation in MATLAB,
I1˙ω1+(I3−I2)ω2ω3=M1,
I2˙ω2+(I1−I3)ω3ω1=M2,
I3˙ω3+(I2−I1)ω1ω2=M3,
where I1, I2 and I3 are the principal moments of inertia of the rigid body, ω1, ω2 and ω3 are the angular velocities around the axes of these moments of inertia, ˙ωi denotes the time derivative of the angular velocity ωi and Mi denotes the external torque applied along the axis of ωi.
I would also like to find the rotation of the body, but the equations above have a rotating reference frame, so finding the rotation does not seem to have a simple answer. In order to express the rotation of the body I would think that a rotation matrix as a function of time, R(t), would be a good option, such that a point →x0 on the rigid body can be relocated in a inertial frame of reference with,
→x(t)=R(t)→x.
This rotation matrix should change over time as the body rotates, but any two rotations can be combined into one effective rotation by multiplying the two rotation matrices. Thus the rotation matrix after a discrete time step should be,
Rn+1=DRn,
where D is the rotation during that time step.
Any rotation matrix (I believe with the exception of reflections) can be written as,
R=[cosθ+n2x(1−cosθ)nxny(1−cosθ)−nzsinθnxnz(1−cosθ)+nysinθnxny(1−cosθ)+nzsinθcosθ+n2y(1−cosθ)nynz(1−cosθ)−nxsinθnxnz(1−cosθ)−nysinθnynz(1−cosθ)+nxsinθcosθ+n2z(1−cosθ)],
where →n=[nxnynz]T is the axis of rotation and θ the angle of rotation.
For an infinitesimal time step the rotation, D, has the axis of rotation equal to the normalized angular velocity vector and the angle of rotation equal to the magnitude of the angular velocity vector times the times step. Do I need to use the angular velocity vector in the rotating or inertial reference frame for this?
I was not completely sure if I understood the notation of the answer of David Hammen, so I performed a simple test. The test involves applying two rotations. Initially the two reference frames are lined up, where x, y and z axes in the figures for the inertial reference frame always point to the left, right and up respectively, while for the rotating reference frame the x, y and z axes are represented by →e1, →e2 and →e3 respectively. The first rotation is 90° around the x axis:
Because in both reference frames the rotation is around the x axis, thus the rotation matrices of this rotation are,
RI:0→1=RR:0→1=[10000−1010],
where the subscripts I and R stand for the inertial and rotational reference frames respectively.
The next rotation is 90° around the z axis or →e2:
The two reference frames now differ, thus the rotation matrices of this rotation are,
RI:1→2=[0−10100001]RR:1→2=[001010−100].
The final orientation should look like this:
The corresponding total rotation matrix is,
R0→2=[001100010].
When combining the two rotations in both reference frames, then the total rotation matrix can be obtained with the following order of multiplications,
R0→2=RR:0→1RR:1→2=RI:1→2RI:0→1,
thus it appears that the following is true,
Rn+1=RnDR=DIRn.
Since Euler's equations use the rotational reference frame, thus DR will be used. The rotation, DR, using the general equation for a rotation matrix, can be simplified, by using linear approximation since dt is assumed to be small, to,
R(t+dt)=R(t)[1−ω3dtω2dtω3dt1−ω1dt−ω2dtω1dt1]=R(t)([100010001]+[0−ω3ω2ω30−ω1−ω2ω10]dt)
Or in terms of the time derivative,
˙R(t)=R(t+dt)−R(t)dt=R(t)[0−ω3ω2ω30−ω1−ω2ω10].
Question: When numerically integrating this, together with Euler's equation of rotation, is there a way to ensure that the determinant of R remains equal to one (otherwise →x(t) will also be scaled)?
No comments:
Post a Comment