- #1
RoshanBBQ
- 280
- 0
Rotation about CM -- Can I use Moment of Inertia?
I have a program I coded to simulate the movement of a some point masses connected to each other rigidly. Each mass is the same. I am trying to code in the correct equations for rotation, but I am having some difficulty with a nonzero product of inertia.
I have the x, y, and z coordinates to these masses where x y and z are n by 1 matrices (where I have n masses).
I calculated the center of mass as:
xcm = average(x)
ycm = average(y)
zcm = average(z)
Then I defined new coordinates, xx yy and zz:
xx = x - xcm
yy = y - ycm
zz = z- zcm
The following Wikipedia article then says, "With respect to a coordinate frame whose origin coincides with the body's center of mass, they can be expressed in matrix form as:"
and then it shows that the rotation depends only on the moments of inertia.
http://en.wikipedia.org/wiki/Newton–Euler_equations
However, I then compute the product of inertia:
sum(yy.*zz), which does not equal 0!
where .* means element-wise multiplication.
What is going on here? Am I computing something incorrectly, is Wikipedia wrong, or am I just misunderstanding something?
Homework Statement
I have a program I coded to simulate the movement of a some point masses connected to each other rigidly. Each mass is the same. I am trying to code in the correct equations for rotation, but I am having some difficulty with a nonzero product of inertia.
The Attempt at a Solution
I have the x, y, and z coordinates to these masses where x y and z are n by 1 matrices (where I have n masses).
I calculated the center of mass as:
xcm = average(x)
ycm = average(y)
zcm = average(z)
Then I defined new coordinates, xx yy and zz:
xx = x - xcm
yy = y - ycm
zz = z- zcm
The following Wikipedia article then says, "With respect to a coordinate frame whose origin coincides with the body's center of mass, they can be expressed in matrix form as:"
and then it shows that the rotation depends only on the moments of inertia.
http://en.wikipedia.org/wiki/Newton–Euler_equations
However, I then compute the product of inertia:
sum(yy.*zz), which does not equal 0!
where .* means element-wise multiplication.
What is going on here? Am I computing something incorrectly, is Wikipedia wrong, or am I just misunderstanding something?
Last edited: