Hi all,
I'm simulating a rope (softbody) as an spring in an engineering project.
However, I found out that soft body (not even ropes, but patches) behave strangely with time step and iteration!
Ok, I understand that the behaviour should change when iteration number is changed, but it must converge to an stable behaviour.
When I change the iteration number from 10, 50, 100, 200, 400, 1000, each case have a unique behaviour which I cannot find any clue of "Convergence" of soft body behaviour!
The larger the iteration number is, the stiffer the soft body become. Is there any bug through the mathematical sweeping process of softbody?
And its the case with time increment as well.
Have you faced the same thing?
RJ
SoftBody behaviour with time increment and iteration number
-
- Posts: 72
- Joined: Mon Dec 02, 2013 4:13 pm
-
- Posts: 84
- Joined: Sun Jan 07, 2007 4:29 pm
- Location: Oxford, England
Re: SoftBody behaviour with time increment and iteration num
Yes, I get this - my simulation timestep can vary a lot, and that causes problems because the accuracy of the rope simulation varies. I don't mind a bit of stretching (actually for me it's quite good), but I need to have some way to make it always the same, regardless of the timestep.Ehsanizadi wrote:Hi all,
However, I found out that soft body (not even ropes, but patches) behave strangely with time step and iteration!
The two uses I have are for model aircraft: aerotow (https://youtu.be/Rkr4QNzjezk) and control-line simulation (https://youtu.be/KXPQI2wK_BU)
My "solution" was to adjust the number of soft-body solver iterations based on the timestep:
Code: Select all
float subSteps = ClampToRange<float>((float) PicaSim::GetInstance().GetSettings().mOptions.mFrameworkSettings.mPhysicsSubsteps, 4.0f, 12.0f);
float p = (subSteps - 4.0f) / 4.0f;
float fiters = 16.0f / powf(2, p);
int iters = ClampToRange((int) (fiters + 0.5f), 4, 16);
iters = 2 * (iters / 2); // make it even
mTowRopeSoftBody->m_cfg.piterations = iters; // Needs to be even to avoid an offset?
I suspect this is more ad hoc than what you are looking for... if you want precise/accurate behaviour, the softbody implementation in Bullet is probably not good enough (correct me if I'm wrong). Having said that, it should converge onto a more "correct" solution by increasing iterations and/or decreasing the timestep. My experience is that reducing the timestep by X is more effective than increasing the number of iterations by X.
-
- Posts: 72
- Joined: Mon Dec 02, 2013 4:13 pm
Re: SoftBody behaviour with time increment and iteration num
With such annoying things of softbodies, perhaps it is best to use FEM for modelling of deformable bodies for engineering usages.
However, it is not yet implemented in Bullet...
However, it is not yet implemented in Bullet...
-
- Posts: 72
- Joined: Mon Dec 02, 2013 4:13 pm
Re: SoftBody behaviour with time increment and iteration num
See here: https://www.youtube.com/watch?v=rm26NF9f4aA
and this paper which solves the problem: http://mmacklin.com/xpbd.pdf
and this paper which solves the problem: http://mmacklin.com/xpbd.pdf