Skip to content

Correction to Rotational Kinetic Energy Calculation

Carlos Andrés del Valle requested to merge Kin_Rot_Energy into master

Hi, I just fixed a small error in the calculation of rotational kinetic energy in non-spherical bodies. I noticed the problem while trying to measure energy conservation. I did this simulation that does not have any friction or damping. Thus, the energy should be conserved. But, when I plotted the energy I got this jiggly line:

Screenshot_from_2023-05-17_21-32-02

Luckily, the fix was very easy. We were using the wrong reference frame transformation for the inertia tensor. After I changed that, I got a perfect energy-conserving simulation:

Screenshot_from_2023-05-17_21-35-36

I know that there's another function that calculates the rotational kinetic energy in utils. Havent checked that one. I'll do it and make an update soon.

Best regards.

Merge request reports