[ODE] Weird Dynamics

Alexander Klyubin A.Kljubin at herts.ac.uk
Fri Mar 7 08:01:02 2003


Hello!

I've been playing around with ODE for a couple of weeks now. The 
simulations I've been running tend to produce weird dynamics and even 
"explosions", although I don't believe I'm using any special features or 
too large time steps. So far I've spotted and fixed a couple of bugs in 
my code. Nevertheless, I'm still struggling with weird behavior of 
simulated bodies.


I've created a rectangular arena consisting of four massive walls. Small 
spheres are placed into the arena. At each time step a small force is 
applied in random direction to each sphere. If two spheres collide, they 
stick to each other forever via a fixed joint.

The behavior I expect is that that eventually all spheres form a big 
fixed articulated body. Moreover, the more spheres form the body, the 
less it should move, since random forces applied to each sphere should 
on the average cancel each other.

What I observe when running the simulation is that aggregate articulated 
bodies indeed form. However, their behavior is really weird: they start 
rotating too fast, or gaining highly improbable impulses, or even 
exploding. You can take a look at a movie showing one such run of the 
simulation.
   http://homepages.feis.herts.ac.uk/~ka2by/tmp/aggregation.avi (1.9 MB, 
DivX 5).
   http://homepages.feis.herts.ac.uk/~ka2by/tmp/aggregation.mpg (3.7 MB, 
MPEG).


As I'm pretty new to ODE I believe that bugs in my code may be 
responsible for the weird behavior. However, the code is pretty simple 
and I can't spot any more bugs in it.

Any hints and suggestions appreciated.

Best Regards,
Alexander Klyubin