Total angular velocity of multiple bodies

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 1K views
faiface
Messages
15
Reaction score
1
Hello,

this is a question regarding planar physics. Suppose we have multiple bodies. We can ignore their individual shape and angular speed. So every body is represented by it's position, mass and moment of inertia about it's center of mass.
Now my question is, how to calculate the moment of inertia, angular momentum and angular velocity of all of these bodies together about their common center of mass?
I've got something going, but it's not working as expected.

Thanks for your help!
 
Last edited:
Physics news on Phys.org
Find the center of mass, calculate the contribution of each object, sum all together (this won't give an angular velocity as different objects have a different one), but a total angular momentum).
faiface said:
I've got something going, but it's not working as expected.
Then it would help if you show that.
 
Ok, here's the pseudocode of what I've got (I can calculate the center of mass no problem):

totalInertia = 0;
totalAngMomentum = 0;
for (body: bodies) {
distance = dst(body.getPosition(), centerOfMass);
inertia = body.getInertia() + body.getMass() * distance^2;
ang_vel = body.getLinearVelocity().dot(normalize(body.getPosition() - centerOfMass).rotate(PI/2)) / distance;
totalInertia += inertia;
totalAngMomentum += inertia * ang_vel;
}
angVelocity = totalAngMomentum / totalInertia;
 
faiface said:
We can ignore their individual shape and angular speed.
Your code assumes that they are rotating with the angular velocity you calculate for the net motion. Is that intended?

And what is going wrong?
 
Oh, the whole problem was, that I was calculating with the absolute linear velocity of a body instead of relative to the velocity of the center of mass. So yeah, it was not intended :). Thank you very much for your help and patience!