Page 1 of 1

Energy inside the system

Posted: Thu Jun 18, 2015 9:13 am
by Ehsanizadi
Hi,

I have simulation set consisting of thousands of objects, densely packed, which are subjected to stress.
At different times during simulation, movements of rigid bodies are detected, and sometimes not.
How can I calculate the energy inside my system? Kinetic energy and potential energy?
Is there any parameter/function in bullet to calculate that?

Note: from potential energy I mean the energy exist between to rigid bodies when they are pressed towards eachother.

Thanks

Re: Energy inside the system

Posted: Fri Jun 19, 2015 9:01 pm
by drleviathan
No, I don't think there is functionality in Bullet to measure the potential energy of two objects that are being compressed. As far as I know the engine does not track internal stress forces at contact points during the simulation. Instead constraints are solved for new velocities and the internal forces involved are implicit in the solution -- they are never explicitly known in the simulation algorithm.

Re: Energy inside the system

Posted: Mon Jun 22, 2015 2:26 am
by Basroil
The only way to have potential energy in the way you state is to have deformations, but by definition rigid bodies don't deform. I guess you can try to estimate the potential energy using the penetration depth of collisions, but that will probably be very resource intensive and not exactly correct.

Kinetic energy is a bit easier, you simply need to use E=1/2 sum(m*V^2), and that can give you the total kinetic energy. Just remember that if you expect rotation to be important you'll need to use the full mass and velocity matrix rather than just linear mass and velocity magnitudes.