energy conservation and elastic collision
Posted: Wed Feb 13, 2013 8:10 pm
Hi,
First: congratulations on a great package!
I am a physicist, and would like to use Chipmunk Physics for research simulations. One of the main cases of interest, however, is that of elastic collisions, where energy should be conserved. I notice that setting elasticity=1.0 is not advised in the documentation, "... due to inaccuracies in the simulation ...".
Practically speaking, if I set a couple balls to bounce around randomly in a complex environment (bounded by segments), I don't see too many problems if the time step is kept low, and if I don't simulate for too long. However, if I monitor total energy for 3 million time steps (with dt=0.01, velocities typically magnitude 10), I see it creep up to 6% increase (see graph below).
My questions are:
- anything more precise to be said on use of elastic collisions, when they may be expected to work, when they shouldn't be expected to work? Rummaging around a bit indicated there was some discussion on this on a google code page that no longer exists...
- will current work on collisions (that I have seen referred to on the bugs forum) make elastic collisions any more stable?
First: congratulations on a great package!
I am a physicist, and would like to use Chipmunk Physics for research simulations. One of the main cases of interest, however, is that of elastic collisions, where energy should be conserved. I notice that setting elasticity=1.0 is not advised in the documentation, "... due to inaccuracies in the simulation ...".
Practically speaking, if I set a couple balls to bounce around randomly in a complex environment (bounded by segments), I don't see too many problems if the time step is kept low, and if I don't simulate for too long. However, if I monitor total energy for 3 million time steps (with dt=0.01, velocities typically magnitude 10), I see it creep up to 6% increase (see graph below).
My questions are:
- anything more precise to be said on use of elastic collisions, when they may be expected to work, when they shouldn't be expected to work? Rummaging around a bit indicated there was some discussion on this on a google code page that no longer exists...
- will current work on collisions (that I have seen referred to on the bugs forum) make elastic collisions any more stable?