Inertia tensor of aspherical asymmetrical body

Asked by Jan Elias

I am sorry for bothering with such a question, but I do not understand meaning of inertia (of body.state class). According to documentation, it should be a vector of three components. However for asymmetrical body (such as tetrahedron or others) I need to input a tensor (i.e. six independent components).
Does it mean principal inertia? But how then I specify direction of this principal inertia? Should I input a body rotated so that principal inertia axis are aligned with global x-y-z?
Best regards Jan Elias

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Bruno Chareyre
Solved:
Last query:
Last reply:
Revision history for this message
Best Bruno Chareyre (bruno-chareyre) said :
#1

I'm not expert in that part but, looking at how
NewtonIntegrator::leapfrogAsphericalRotate() is computing things, it
seems the body must have principal axis aligned on X,Y,Z when its
rotation is null. Which means, yes, you must input the body with this
specific orientation.
You can of course rotate it after that by changing b.state.ori.

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#2

Dear Jan,
I'm sorry for bothering back with another question: ;)
What do you have in mind in terms of shape? I'm quite curious since, in fact, you don't have to worry about inertia unless you are trying to implement a new shape. Is it what you are doing?

Revision history for this message
Jan Elias (elias-j) said :
#3

Thanks Chareyre, that solved my question.

Revision history for this message
Jan Elias (elias-j) said :
#4

Dear Bruno,

yeas, I work on general polyhedral shape. I understand that there is maybe no usage of it, however, I got a project and I would like to fulfill it. Once I (hopefully) finish, I will submit the code to the community. So far, I am still in the developing process.

By the way, I have one more question. If I set some initial angular velocity to a body with aspherical shape (body.aspherical = True), the angular velocity is lost in the second step. But when I change the property to spherical ( body.aspherical = False), it works fine.
Normal velocity (translation) works fine in both cases. I do not see any reason why the angular velocity should disappear. Do you know what else is affected by this property.

Thanks for previous reply Jan Elias

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#5

You found a bug it seems. Angular velocity should not vanish, of course.
Could you please open a bug here, with a minimal list of commands to reproduce it?

General polyhedral shape is a quite interesting thing. I'm sure there will be usage of it as soon as it is available.

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#6

After a quick look at NewtonIntegrator.cpp:239, I have the impression that you need to also (or even "only") initialize the angular momentum consistently with angular velocity.

Aspherical rotation computation is giving angVel as result, not as an input value. I think Sergei Dorofeenko wrote this code, and could tell if everything is as he expected or if it should be modified.
It is not obvious for the user that initial state must be defined differently depending on the "aspherical" property. There is (at least) place for improvement in the documentation.