Damping of a distance joint

Hello.

For a project I'm testing the correctness of some Box2D features. One of my first tests was to create two objects connected them with a distance joint and let them oscillate. As I understood (and please correct me if I'm wrong) setting a damping ratio of 0.0 would cause the objects to oscillate forever. But the amplitude of the oscillation decreases constantly. Can anybody tell me why thats so?

And maybe you could give me some formulas to calculate the frequency and damping ration from a spring constant k and its damping d? I need that because I wanted to do 'real' physics with Box2D 😉

Best regards
The integration of the soft distance joint is equivalent to implicit Euler integration, which has built in damping but guaranteed stability. See this for more information: http://box2d.googlecode.com/files/GDC2011_Catto_Erin_Soft_Constraints.pdf
Hey.

First thanks for the answer but to be honest it was no help at all. I already found your presentation a while ago and it really helped me understanding the concept of effective mass and hoe this can be used to calculate a reaction force of a spring. But it won't become clear how I can initialize the frequency and damping ratio to get the analytical results which I calculated using the damping and spring coefficient.
The only idea I have to get things to work is to dynamicaly calculate the damping ratio and frequency, as described on slide 45 in your presentation, with every step of the world.
I feel if I'm missing the whole point of the idea to use frequency and damping ratio instead of damping and spring coefficient.
Could you or anybody else be so kind and enlighten me, please 😉
You won't get a match to the analytic results in Box2D. See this page: http://en.wikipedia.org/wiki/Numerical_ordinary_differential_equations

I argue in my presentation that setting the spring stiffness is not intuitive for tuning soft constraints, that is why I use desired frequency in Hertz.
Erin Catto wrote:I argue in my presentation that setting the spring stiffness is not intuitive for tuning soft constraints, that is why I use desired frequency in Hertz.

Ok got it. Game designers think in other ways than physicists. 😉

Erin Catto wrote:You won't get a match to the analytic results in Box2D. See this page: http://en.wikipedia.org/wiki/Numerical_ordinary_differential_equations

Well, I'm aware of the limitations of numerical solutions for ODE's. But should I intrepret your statement as 'Looks nice but the computations will never be physical!' ?

Thanks for your answers anyway.

Original thread: https://box2d.org/forum/viewtopic.php?t=7017