[ODE] box-box performance

Gary R. Van Sickle g.r.vansickle at worldnet.att.net
Wed Nov 27 01:54:02 2002


> Like Daniel says you might find that for example as a rolling box
> (dice maybe?) comes to a stop, it might teeter on one edge for
> a second before deciding which face it will eventually fall onto.
> At that point the kinetic energy would be near to zero.

Right, but the *potential* energy will not be zero.  It can still move to a
lower total energy state.

> Also
> consider if you threw a body straight up. At some point it will
> have near zero kinetic energy, then start coming down.

Again though, potential energy != 0.

> With an extremely small epsilon it might work out most of the
> time but I think it's safer to judge by distance travelled/over a
> few consecutive time steps.

But that's where the "lockups" tend to come from; whether it's every step or a
number of steps (and how do you chose that number?), you can get into a wildly
wrong physical situation.  E.g., the "body straight up" problem.  How long is
your rocket going to sit at its apogee, say over a low-gravity planet, with
velocity ~= 0, before starting to fall back?  Pick a just-too-long max time
before you lock it down, and the rocket stays up there forever.  If it's
possible to base the lockdown decision on potential energy, you will at least
never get into wildly wrong situations like that; they'd at worst be
"epsilon-total-energy-is-still-left wrong", which should always be less than any
velocity-only-based solution.

All that said, I can't offhand come up with an algorithm to do the
potential-energy measurement, which would be the key to have this work at all.
I would think it would involve some relation between the center of mass, any
contacts, and the total forces & torques applied at each timestep.  But as is
all too often the case, more thinking required....

--
Gary R. Van Sickle
Brewer.  Patriot.


> > > there are situation where for example a box can stay on an edge. To
> > > avoid this you have to take time in concideration.
> >
> > Instead of time, could this take "stability" into account instead?
> >
> > e.g. something like this:
> >
> > if(
> >       (body.KineticEnergy() < epsilon) // i.e. velocity ~= 0
> >       &&
> > (body.PotentialEnergyRelativeTo(body_it_is_contacting) < epsilon)
> >           // i.e. it isn't going to change on us on its own.
> >   )
> > {
> >   // "Freeze" body until something hits it etc.
> >   // ...
> > }
> >
> > Seems to me that this would be pretty much foolproof, and better yet
> > instantaneously-acting; there'd be no need to wait until you
> > were reasonably
> > sure the body had "really" stopped moving, you could lock the
> > body down as soon
> > as these conditions became true and know you were doing the
> > right thing.  Or is
> > there a conceptual or implementational issue here I'm missing?
> _______________________________________________
> ODE mailing list
> ODE@q12.org
> http://q12.org/mailman/listinfo/ode