Sympy.physics.mechancis: RigidBody // inertia

58 views
Skip to first unread message

Peter Stahlecker

unread,
Jun 23, 2022, 7:44:10 AM6/23/22
to sympy
I = me.inertia(A, iXX….) gives the inertia in the (normally) body  - fixed frame A
Body = Me.RigidBody( ‚Body‘, mass center, frame, mass, ( I, P))

My question: Does RigidBody ‚assume‘, that mass center = P ?

Reason behind my question:
 For regular homogenious bodies, iXX, IYY, etc are often known relative to the geometric center of the body.
If the mass center is not equal to the geometric center of the body, would RigidBody know, that the inertia is relative to the geometric center?

In my program, the kinetic energy comes out right, if I set mass center = geometric center, but incorrect if I do not.
Therefore, I wonder, whether there is a mistake in my program, or whether RigidBody assumes that P = mass center.

Thanks a lot for any help!


Jason Moore

unread,
Jun 25, 2022, 3:26:47 AM6/25/22
to sympy
Peter,

You should be able to provide the inertia (I, P) about a point P other than the mass center of the rigid body. So in your code "mass center" does not have to equal "P". But, I never really do that so it could be that the underlying code doesn't apply the parallel axis theorem correctly. It isn't a feature that is likely used much, if at all. If you have an example that shows it doesn't work, then providing that on the SymPy issue tracker would be helpful so we can find and fix the bug.

Jason

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/0d3101eb-1fe7-4c24-a125-bab8c8a58145n%40googlegroups.com.

Peter Stahlecker

unread,
Jun 25, 2022, 7:15:49 AM6/25/22
to sy...@googlegroups.com
Dear Jason,

Thanks a lot!
It seems to be my program, rather than kinetic energy.

The sample which did not work was my ‚Wackelstein‘, where there seem to be many other issues, the geometry is probably too difficult for me.

I tried it on my 2D rolling disc on an uneven street, where the geometry is much simpler. There the total energy is constant also if the center of mass != geometric center.
It seems to run into numeric difficulties ( a different issue), but outside those difficulties the total energy is constant.

Better my program is wrong than kinetic energy!  :-)

Thanks again!

Peter


--
Best regards,

Peter Stahlecker

Peter Stahlecker

unread,
Jun 25, 2022, 8:39:22 AM6/25/22
to sy...@googlegroups.com
Dear Jason,

There is nothing wrong with kinetic energy, at least I could not find anything!

I programmed a 3D ball rolling on a flat surface.
The total energy is constant, no matter where the center of mass is.

Sorry about the commotion I created!

NB:
I use solve_ivp to do the integration.
I have to set max_step = 0.01 to get a constant total energy. If I do not do this, it is not constant.

Peter
Reply all
Reply to author
Forward
0 new messages