[ODE] Damping without adding forces
Anton Savin
anton at targem.ru
Tue Oct 26 19:24:52 MST 2004
Hello Joe,
JA> This code is not timestep independent.
JA> This is very important because when you either want to change the fixed
JA> timestep or are using dynamic timestepping the simulation will behave
JA> differently.
JA> You can make it timestep independent using pow (1.0 - dampingScale, h).
JA> The other instability is that your damping code doesn't handle the case
where b->>damping.linearDamping * h is larger than 1.0.
Is I said in previous post, this damping has a limit when timestep
tends to 0. And in my simulation timestep is never greater than 0.05.
Also the damping is not intented to be greater than, say, 10, so it's
OK.
JA> Now using pow to do damping is quite expensive and that makes using forces
JA> to simulate damping faster. Plus they could in some situations be more
JA> stable since the solver can disregard any damping applied based on the
JA> constraints it applies. It can't do that if you just set the velocity.
When I scale the velocity, I cannot break any constraint, I can just
slow down the processs of it's satisfaction, I think (such as pushing
away interpenetrating objects).
JA> Lastly i believe adding linearDrag to ode core is not a good idea since you
JA> almost always want something custom eg. In a lot of cases you want sqred
JA> drag. Sometimes you want constant drag.
Thank you for this observation! Actually I'm thinking about sqred
damping in my simulation, it's more correct afaik. When I need another
drag, I'll implement it :)
JA> For a complete solution you need the same for angular drag.
Actually I have :)
JA> Thus i think you should either do it right (supply constant, linear, sqr
JA> drag for both velocity and angular velocity) or leave it out of the ode
JA> core.
I don't intend to contrib this, as it's very application-specific, and
the damping itself is very simple. But maybe it's useful to have some
sort of internal damping in ODE to increase its stability. I don't
insist on my implementation of course ;)
**************************
So, to my question: Is this implementation more stable than applying
equivalent forces each timestep?
**************************
Cheers,
Anton Savin
More information about the ODE
mailing list