# yade-users team mailing list archive

## Re: clumps

```>> Currently the inertia matrix is a .... vector!
>>
>> This vector is just a diagonal of that matrix. Did the time come to fix that?
>
> No reason for that. If your local axes are aligned with principal
> inertia axes, the matrix is diagonal. And that is (as I take it)
> definition of the "right" orientation of body-local coordinate system.
>
> Clumps also recompute orientation, to be oriented in the principal
> directions.
>
> The problem would be that you have to create the matrix3, assign the
> principal values to the diagonal (from the principal inertia vector) and
> transform that matrix. But that is computatinally quite expensive and
> most bodies (spheres) don't need it since the transofmration is
> identity.
>
> See Clup::inertiaTensorRotate and also
> http://www.kwon3d.com/theory/moi/triten.html
>
> v.

Just for consistency...

1. At this moment we have:

I is the principal inertia tenzor of a body, I={I1,I2,I3}. For spheres
I1=I2=I3; for a clump of unintersected spheres it is calculated in
Clump::updateProperties and it is valid.

T is the torque. It is in global reference frame (r.f.).

w is the angular velocity. It is in global r.f.

Rotational equation is:

I dw/dt = T => dw/dt = T/I or dw_i/dt = T_i/I_i, i=1,2,3.

and this equation is integrated by leap-frog algorithm.

This is valid only if I1=I2=I3.

2. As it should be:

Rotational equation in global r.f. is:

d(J w)/dt = T,

when J is a inertia tenzor in global r.f. It is a matrix and it is a
function of time, J=J(t). So, we need transformation from global to
local r.f., when J=I. In local r.f. rotational eq. is a Euler dynamic eq:

I dw'/dt + w' cross Iw' = T'

when (.)' is value (.) in local r.f. This equation don't integrated by
simple leap-frog, because we will have w' on right.

So, problem is not only in a rotation of vectors. We need also other
integration algorithm for clumps.

Is this correct?

==
Best regards,
Sergei D.

```