inertia tensor units

293 views
Skip to first unread message

MALocascio

unread,
Nov 24, 2009, 11:34:08 AM11/24/09
to ode-users
I'm getting some odd results in my simulation, so I'm going to post a
question here despite the fact that it seems straightforward enough.

What are the units of the values in a mass's inertia tensor in ODE,
assuming that I have a simulation world in which all other values are
given in meters, kilograms, and seconds?

As an example, I have an object with specs given from a CAD
simulation. The values provided are in units of 10^-3 kg*m^2:
I11 = 120
I22 = 124
I33 = 50.1
I12 = -0.62
I13 = 2.02
I23 = 1.24

I also have a value for the mass in kg and the center of mass position
in meters. So, given this data, what would you provide to ODE? The
values above don't match the real-world dynamics, and dividing them
each by 1000 (so that the units are kg*m^2) makes the parts explode in
the simulation.

Any ideas? Thanks!

Jon Watte

unread,
Nov 24, 2009, 11:54:52 AM11/24/09
to ode-...@googlegroups.com
An inertia tensor is always symmetric. Thus, you have to assign I21
the same as I12, I31 the same as I13 and I32 the same as I23.

Sincerely,

jw


--
Americans might object: there is no way we would sacrifice our living
standards for the benefit of people in the rest of the world.
Nevertheless, whether we get there willingly or not, we shall soon
have lower consumption rates, because our present rates are
unsustainable.
> --
>
> You received this message because you are subscribed to the Google Groups "ode-users" group.
> To post to this group, send email to ode-...@googlegroups.com.
> To unsubscribe from this group, send email to ode-users+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ode-users?hl=en.
>
>
>

MALocascio

unread,
Nov 24, 2009, 11:59:52 AM11/24/09
to ode-users
The dMassSetParameters function does that itself, though, I assume. It
asks for I11, I22, I33, I12, I13, and I23 and then fills in the matrix
appropriately (i.e., symmetrically).

On Nov 24, 10:54 am, Jon Watte <jwa...@gmail.com> wrote:
> An inertia tensor is always symmetric. Thus, you have to assign I21
> the same as I12, I31 the same as I13 and I32 the same as I23.
>
> Sincerely,
>
> jw
>
> --
> Americans might object: there is no way we would sacrifice our living
> standards for the benefit of people in the rest of the world.
> Nevertheless, whether we get there willingly or not, we shall soon
> have lower consumption rates, because our present rates are
> unsustainable.
>

MALocascio

unread,
Nov 24, 2009, 2:29:02 PM11/24/09
to ode-users
So I did a little experiment with a box body and poked around in the
code a little. Left to its own devices, ODE will make an inertia
matrix for a box with units of kg*m^2. Given a box with side lengths
(2a, 2b, 2c) and mass m, the inertia matrix has three nonzero
elements:

I11 = m(b^2+c^2)/3
I22 = m(a^2+c^2)/3
I33 = m(a^2+b^2)/3

which matches the calculations I did by hand to compare. So everything
makes perfect sense when ODE calculates it itself, and in fact, the
dynamics compared to a real-world experiment are a very close match.

However, when specifying the parameters using dMassSetParameters as I
described in my first post, this is not the case. Any ideas would be
appreciated.

Thanks

Daniel K. O.

unread,
Nov 24, 2009, 2:42:13 PM11/24/09
to ode-...@googlegroups.com
2009/11/24 MALocascio <mal...@gmail.com>:
> However, when specifying the parameters using dMassSetParameters as I
> described in my first post, this is not the case. Any ideas would be
> appreciated.

If you supply the box mass params through dMassSetParameters, does it
still behaves correctly? If so, the problem is not with
dMassSetParameters. There are many ways to make a simulation unstable.
Try experimenting with smaller/larger timesteps/masses/lengths, and
double precision. Bring things closer to 1. If that makes a
difference, you might have to change your units to avoid extremely
small or large values.


--
Daniel K. O.
"The only way to succeed is to build success yourself"

MALocascio

unread,
Nov 24, 2009, 4:10:00 PM11/24/09
to ode-users
I can set the box params directly and the results come out the same.
The box demo works fine but the actual simulation rotates slowly.

Some of the inertia values for the parts ARE extremely small (e.g.,
0.0000249 10^-3 kg*m^2), but the diagonal values are all on the order
of 1. That is, the only very small values are off-diagonal and could
probably just be set to zero anyway. The smallest diagonal values are
about 0.09 10^-3 kg*m^2. In kg/m^2 that comes to 0.00009... do you
think that's too small?

Thanks

Nguyen Binh

unread,
Nov 24, 2009, 4:19:24 PM11/24/09
to ode-...@googlegroups.com
It seems like you have numerical problem.

The easy way around maybe 1st try recompile ODE with double. If it
still not work then you may have to change your scale so that the
numbers are close to [1,10].

Note that there is no rigid unit in ODE, all the number you send in
ODE can be in any unit you like, just that you have to be consistent.
For your case, I suggest you may try to use cm/kg/s instead of m/kg/s
. Just remember to change all other values accordingly (for example,
gravity would be ~ 1000 not 10 in m/kg/s)

Hope it helps,
--------------------------------------------------
Binh Nguyen
Computer Science Department
Rensselaer Polytechnic Institute
Troy, NY, 12180
--------------------------------------------------

MALocascio

unread,
Nov 24, 2009, 5:54:27 PM11/24/09
to ode-users
OK, I fixed it. It actually was ok to just divide all of the inertia
values by 1000 so that the units are kg*m^2. The problem was that I
also applied several torques to the parts which also needed to get
scaled down by 1000. There was one of them buried in the code in a
place I forgot about, so it just tore the thing apart. Once I fixed
that one, everything worked as expected.

Thanks for all of the help everyone!
Reply all
Reply to author
Forward
0 new messages