RoshanBBQ,
I am a bit troubled by this last post of yours. What exactly are you trying to do here? What problem are you trying to solve? You talked in the initial post about rigid bodies, but now you are talking about thousands (hundreds of thousands) of point masses! So which is it?
In a rigid body formalism, you have essentially twelve independent variables that describe each body. With hundreds of thousands of point masses, each with six degrees of freedom (position and velocity), you have on the order of a million independent variables! Whoa! A mesh of hundreds of thousands points would stress even the best finite element analysis package. You might want to rethink what you are doing.
Compared to your million or so degree of freedom system, a rigid body has but twelve degrees of freedom:
- Three for the position of some selected point on the rigid body,
- Three for the time derivative (velocity) of that point,
- Three for the orientation of the body or structure frame, and
- Three for the rotation rate (angular velocity) of the body frame.
There are reasons to use a finite elements approach. Real bodies are deformable rather than rigid. With a rigid body formalism you are forgoing looking at what happens inside the body. This is obviously a disadvantage, but the advantage of a rigid body formalism is that the number of independent variables shrinks by orders and orders of magnitude. There's no reason to use a finite elements approach if the object of interest is fairly rigid and you don't care about behaviors within the body.
The issues that need to be addressed in a rigid body formalism are
- How to physically describe the body,
- How to represent the body's dynamical state,
- How to formulate the equations of motion, and
- How to integrate those equations of motion with respect to time.
How to physically describe the body
A point mass has but one physical characteristic, its mass. A rigid body has mass plus an inertia tensor. The inertia tensor of a rigid body is constant in a frame fixed with respect to the body. Assuming the body truly is rigid, you need to calculate the inertia tensor but once.
Here's where you can make use of your hundreds of thousands of point masses. Calculate the inertia tensor for this system of masses. You'll need to transform to the body frame if the frame in which the locations of the point masses are represented is not the body frame. Suppose you calculate the inertia tensor in some frame A, but you want it in frame B. Let
T be the transformation matrix that transforms a vector as represented in frame A to the representation of that same vector in frame B. The inertia tensor transforms according to
\mathbf I_B = \mathbf T\, \mathbf I_A\,\mathbf T^T
How to represent state
Rigid bodies have a translational and rotational state. The translational and rotational equations of motion decouple if the translational state is represented as the position and velocity of the center of mass of the rigid body. There are reasons to a structure frame whose origin is not the center of mass, but I recommend that you start with a center of mass body frame. The equations of motion for the translational state such a frame are fairly simple: It's just F
ext=m
bodya. It is rotational state that is the tough nut to crack.
One way to represent rotational state is via the transformation matrix. This is in a sense the canonical form. After all, the mathematics of rotation in Euclidean three space is the group SO(3), where SO is short for special orthogonal (matrices). There is an issue with this representation scheme: Too many numbers. A 3x3 matrix has nine elements, but rotation has but three degrees of freedom. This will lead to challenges when it comes to integrating the equations of motion. There are ways around this. The problem is not intractable.
F=ma is a second order differential equation. The rotational equations of motion are also second order. Some rotational analog of velocity is needed here. The obvious choice is angular velocity. One advantage of using angular velocity is that it is not over-specified. Angular velocity comprises three parameters, and there are three degrees of freedom. For a number of reasons, angular velocity is typically represented as angular velocity of the rotating body with respect to inertial but represented in body frame coordinates.
How to formulate the equations of motion
The translational equations of motion are simply F=ma for a center of mass representation. The tricky issue is rotational state. The equations of motion for angular velocity is given in post #5. That leaves rotation itself. If you represent the orientation of your rigid body by the transformation matrix
T from inertial to body coordinates, the time derivative of this matrix is
\dot{\mathbf T} = -\mathbf X(\vec{\omega}) \mathbf T
where \vec{\omega} is the angular velocity as represented in body frame coordinates and \mathbf X(\vec{\omega}) is the cross product matrix generated from the vector \vec{\omega}. If you instead use the transformation from body to inertial, this becomes
\dot{\mathbf T} = \mathbf T \mathbf X(\vec{\omega})
How to integrate those equations of motion with respect to time
Position, velocity, and angular velocity are conceptually easy. Just use some numerical integration technique. Once again it is rotation that is tricky. Use a typical numerical integration technique on either of the above derivative equations and you will get some matrix that is not orthogonal. One way to get around this is to force the matrix to be orthogonal. Pick some row and normalize (make that row a unit vector). Next, remove the projection of that vector from some second row and normalize. Finally, remove the projections of both of these unit vectors from the third row and normalize. If you use this approach it is best to alternate your choices of this first, second, and third row with each integration step.
Another approach is to use a better integration technique. Google the term "geometric integration". Yet another approach is to use a better representation of orientation. There are many different ways to represent SO(3) that are better suited to numerical integration. Some of these alternative approaches are unit quaternions, Rogrigues parameters, and modified Rogrigues parameters.
With regard to some specific comments in your last post,
RoshanBBQ said:
That makes much more sense. Wikipedia calls J "moment of inertia about the center of mass." They should call it the inertia tensor if it is the inertia tensor. I was previously using an inertia tensor in my program when I was using a structure frame (But at the time, I didn't know that meant a coupling between the two types of motion. When I figured it out, I promptly switched to a body frame and threw away my tensor stuff because of this Wikipedia article). You should really edit this Wikipedia article's definition of J if you have the knowledge to do it confidently.
Thanks, but no thanks. Wikipedia is a good starting point (sometimes), but too often it is not that good. Too many cooks spoil the broth, and wikipedia has far too many cooks already.
In their defense, they did use a bold
J, which indicates a matrix or tensor, and even texts often use moment of inertia when it would be technically more correct to say moment of inertia tensor. Personally, I use a bold
J to indicate the moment of inertia tensor about something other than the center of mass and a bold
I to indicate the moment of inertia tensor about something the center of mass. What about the identity matrix, which is also denoted by a bold
I? I always use a blackboard bold 1 (the LaTeX here isn't up to snuff to show this).
As for your question, I do not think I need to know the angle with respect to the inertial observer. I am modeling a boat with 10 states in my state space: x y z (relative to starting point), their derivatives, roll and yaw, and their derivatives. I am assuming pitch is always zero to simplify the controls problem of directing the boat's motion.
You do need to know this if you want to avoid the million or so independent variables problem.
PS
Before I made this thread, I tried to do some serious self-studying on the topic. Take a look at that misleading image I uploaded from a book I was using. It seemed all sources agreed you could use only moments of inertia to analyze motion about the CM (wikipedia, books they cite, the book i quote, etc.), but failed to stress you would still need the principal axes for that frame of reference. The book I quote does, however, mention the idea about principal axes. I was left to assume one of two things: I could analyze that motion with that equation about the CM GIVEN I HAVE CHOSEN AXES THAT WERE PRINCIPAL or I could analyze motion about the CM BECAUSE THOSE AXES ARE ALWAYS PRINCIPAL AXES. That is just not a nice ambiguity. You cleared it up well though -- apparently it was the former. I am doing this for an engineering introduction to controls class. I am not well-versed even in 1-d physics, so I have had to do a lot of thinking and self-studying to formulate my 3-d model.
This is more of an issue of you trying to teach yourself -- especially from wikipedia. There's something to be said for taking a class, or set of classes. You essentially are trying to learn the field of mechanical engineering on your own. Lacking that, look to some texts. A good sophomore/junior level classical mechanics text is good start, as are texts from an intermediate mechanical engineering course.