Yes they would. The stability of a force-based simulation does not depend on the number of interconnected masses or on which geometric shapes you create with them. It is purely a question of balancing timestep, spring stiffnes, and particle mass.bone wrote:I'd like to hear more about how h4tt3n avoids the unexpected displacements - do the ridiculously high K (spring rate) values still behave stably if you have a bunch of them in series, say a pendulum with a bunch of links and a heavy mass at the end?
Finite Elements Method: are there proble,s with stability?
-
- Posts: 25
- Joined: Wed Mar 12, 2008 9:08 am
Re: Finite Elements Method: are there proble,s with stability?
-
- Posts: 34
- Joined: Fri Nov 25, 2005 10:09 am
Re: Finite Elements Method: are there proble,s with stability?
h4tt3n
Could you explain the method in more details or show us some links on what you're calling iterative velocity verlet scheme?
bone
Have you tried some post-projection after the main solver steps, which affects only position of spring nodes (to correct solver inaccuracy)?
all
The thing about correction is that currently these methods used for absolutely stiff joints, which can be corrected even with Baumgarte, but for spring-like joints ERP/CFM is a part of its normal functionality. So it seems like you should apply ERP/CFM scheme for spring behaviour and post-stabilisation like pseudovelocities or more accurate for correcting that solver inncauracies and lower the ghost forces. But how shall we calculate error in spring joint position, since every position in world is valid for spring? (we can't say that for stiff joints like, say, ball-socket joint; we can always say if there is some position drift) We should somehow analyze new state of the spring according to the old one? For Gauss-Seidel solver residual vector b - A*x should help us a bit to determine the magnitude of ghost forces introduced by the solver.
Could you explain the method in more details or show us some links on what you're calling iterative velocity verlet scheme?
bone
Have you tried some post-projection after the main solver steps, which affects only position of spring nodes (to correct solver inaccuracy)?
all
The thing about correction is that currently these methods used for absolutely stiff joints, which can be corrected even with Baumgarte, but for spring-like joints ERP/CFM is a part of its normal functionality. So it seems like you should apply ERP/CFM scheme for spring behaviour and post-stabilisation like pseudovelocities or more accurate for correcting that solver inncauracies and lower the ghost forces. But how shall we calculate error in spring joint position, since every position in world is valid for spring? (we can't say that for stiff joints like, say, ball-socket joint; we can always say if there is some position drift) We should somehow analyze new state of the spring according to the old one? For Gauss-Seidel solver residual vector b - A*x should help us a bit to determine the magnitude of ghost forces introduced by the solver.
-
- Posts: 25
- Joined: Wed Mar 12, 2008 9:08 am
Re: Finite Elements Method: are there proble,s with stability?
Certainly, it's almost ridiculously simple. The idea is as follows. Let's say we want to model a chain of particles held together by stiff constraints. Normally you would do this by implementing some iterative impulse based solver which spends, let's say ten iterations per game loop. Now the idea is that it will cost more or less the same in terms of cpu-cycles if we dropped the impulse based constraints and instead implemented force based springs between the particles and ran the integrator 10 times per game loop with 1/10 of a timestep. I realise that this method is only conditionally stable, but it's still doing a really good job compared to poor constraint solvers.XperienS wrote:h4tt3n
Could you explain the method in more details or show us some links on what you're calling iterative velocity verlet scheme?
I start out with the velocity verlet scheme:
Code: Select all
dt = timestep
x += v * dt + 0.5 * a * dt * dt // update position
v += 0.5 * a * dt // update half velocity
a = f / m // call function that updates all forces based on new position and velocity
v += 0.5 * a * dt // update half velocity
Code: Select all
N = 10
dt = timestep / N
for i = 1 to N
x += v * dt + 0.5 * a * dt * dt // update position
v += 0.5 * a * dt // update half velocity
a = f / m // call function that updates all forces based on new position and velocity
v += 0.5 * a * dt // update half velocity
Next i
Here's a link for a little softbody toy application I made using this method. The .zip file includes a code::blocks project, full source, and a windows .exe (the actual integration algorithm is in softbody.cpp somewhere around lines 440 to 480). Enjoy

Cheers,
Mike
Last edited by h4tt3n on Sun Dec 13, 2009 1:52 pm, edited 2 times in total.
-
- Posts: 231
- Joined: Tue Feb 20, 2007 4:56 pm
Re: Finite Elements Method: are there proble,s with stability?
Yes, but the question is: what is the correct position? If I get rid of any position change that I didn't expect at the beginning of the timestep, I lose some valid effects.XperienS wrote: bone
Have you tried some post-projection after the main solver steps, which affects only position of spring nodes (to correct solver inaccuracy)?
Consider a mass swinging around a center point, attached by a spring. Say that the starting velocity is perpendicular to the spring, and that the spring is at its resting length. Initially, then, there should be no correction impulse. But at the end of the timestep, I see that there is an error, but not all of the error is necessarily invalid. If I correct all of it, then the mass will continue swinging around the center point at the spring's rest length, which is wrong.
Now I *did* try some fancier ideas here, for example looking at the error and saying "well, if this spring had known this would have happened, it would have reacted like this". But all of them just tended to increase stability problems in complex systems. My brain might not be big enough for this problem.
-
- Posts: 197
- Joined: Sat Aug 19, 2006 11:52 pm
Re: Finite Elements Method: are there proble,s with stability?
This reminded me of this paper: http://leri.univ-reims.fr/~nocent/papers/kacic03.pdfh4tt3n wrote:instead implemented force based springs between the particles and ran the integrator 10 times per game loop with 1/10 of a timestep.
Also I've spoken with the programmer who made Gish/Bridge Builder/etc. and they use a similar approach: force-based model with many substeps.
raigan
-
- Posts: 25
- Joined: Wed Mar 12, 2008 9:08 am
Re: Finite Elements Method: are there proble,s with stability?
Sorry, the link is broken, and google doesn't know of any "kacic03.pdf". Have you got another link?raigan2 wrote:This reminded me of this paper: http://leri.univ-reims.fr/~nocent/papers/kacic03.pdf
Cool, I've always liked Edmund McMillen's work. Didn't know he originally made bridge builder?Also I've spoken with the programmer who made Gish/Bridge Builder/etc. and they use a similar approach: force-based model with many substeps.
Cheers,
Mike
-
- Posts: 197
- Joined: Sat Aug 19, 2006 11:52 pm
Re: Finite Elements Method: are there proble,s with stability?
AFAIK Edmund only did the graphics for Gish; the programmer for all these games ( http://crypticsea.com/ ) is Alex Austin. I've been trying to get him to write up a presentation on his simulator for yearsh4tt3n wrote: Cool, I've always liked Edmund McMillen's work. Didn't know he originally made bridge builder?

-
- Posts: 34
- Joined: Fri Nov 25, 2005 10:09 am
Re: Finite Elements Method: are there proble,s with stability?
Well, as I wrote above - error in spring goes from solver (and a part of it from the integrator due to discretization), so basically if we know how wrong is our solver, we can determine what error contains the spring. The problem is what should we do with that error.bone wrote: Yes, but the question is: what is the correct position?
h4tt3n
I believe that mentioned paper is "A practical dynamics system", Zoran Kačić-Alesić
-
- Posts: 25
- Joined: Wed Mar 12, 2008 9:08 am
Re: Finite Elements Method: are there proble,s with stability?
@ExperienS
Thanks a ton for the link. The solver described is very similar to mine, except they seem to use the leap-frog method where I use velocity verlet. I found chapter 4.2 about stability and the size of the time step very interesting. For quite a while I've been looking for a method to theoretically determine the highest allowable timestep, and there it was, plane and simple. I'll be implementing it in my engine asap, which should make it de-facto unconditionally stable. Wohoo!
Cheers,
Mike
Thanks a ton for the link. The solver described is very similar to mine, except they seem to use the leap-frog method where I use velocity verlet. I found chapter 4.2 about stability and the size of the time step very interesting. For quite a while I've been looking for a method to theoretically determine the highest allowable timestep, and there it was, plane and simple. I'll be implementing it in my engine asap, which should make it de-facto unconditionally stable. Wohoo!

Cheers,
Mike
-
- Posts: 197
- Joined: Sat Aug 19, 2006 11:52 pm
Re: Finite Elements Method: are there proble,s with stability?
Thanks for correcting the link, sorry about that! It took a while just to find a link to the actual paper and not some stupid ACM page, I failed to test it 

-
- Posts: 26
- Joined: Thu May 18, 2006 9:25 pm
Re: Finite Elements Method: are there proble,s with stability?
I feel I must say that after we solved the system with Conjugate Gradients method, the stability turned out to be quite OK, so the method works perfectly if an appropriate solver is used. However, I know no way to combine CG with inequality constarints, so the main goal - integration of FEM into the system of contrainted particles and bodies - is not achieved since contact joints lead to LCP and a system with cointacts can't be therefore solved with CG.
-
- Posts: 861
- Joined: Sun Jul 03, 2005 4:06 pm
- Location: Kirkland, WA
Re: Finite Elements Method: are there proble,s with stability?
Did you look at the Pixelux presentation from the GDC? The use some kind of special element and still can solve using CG. Also if you use CG you might use some kind of constraint satisfaction technique as Baraff in his cloth paper (Large Steps in Cloth Simulation).
HTH,
-Dirk
HTH,
-Dirk
-
- Posts: 26
- Joined: Thu May 18, 2006 9:25 pm
Re: Finite Elements Method: are there proble,s with stability?
Hi Dirk!
Thx for the links.. The Baraff's approach looks like a dismal piece of crap, this is, however, an option. I'd prefer to know what Pixelux guys are doing, don't you know?
Thx for the links.. The Baraff's approach looks like a dismal piece of crap, this is, however, an option. I'd prefer to know what Pixelux guys are doing, don't you know?
-
- Posts: 861
- Joined: Sun Jul 03, 2005 4:06 pm
- Location: Kirkland, WA
Re: Finite Elements Method: are there proble,s with stability?
I visited their session, but cannot remember exactly. There is a Siggraph paper by O'Brian which talks about Pixelux. Maybe you can also find the GDC presentation on the GDC website.
Cheers,
-Dirk
Cheers,
-Dirk
-
- Posts: 1
- Joined: Mon Nov 02, 2009 8:03 pm
Re: Finite Elements Method: are there proble,s with stability?
Dirk Gregorius wrote:I visited their session, but cannot remember exactly. There is a Siggraph paper by O'Brian which talks about Pixelux. Maybe you can also find the GDC presentation on the GDC website.
Cheers,
-Dirk
SCA 09 paper on DMM:
http://www.cs.berkeley.edu/b-cam/Papers ... -2009-RTD/
SIGGRAPH 09 paper that discusses a similar problem and uses a Newmark integrator:
http://www.cs.berkeley.edu/b-cam/Papers ... -2009-ISN/
GDC does not really have official papers to go with the talks, but the details you're interested in should be in the SCA paper.
If you're having issues with not getting the expected stability improvements with an implicit integrator, it's probably a good idea to check the Jacobian matrix carefully and then double check it. An error computing the matrix will often still give you a working simulation, but you won't get the stability improvements you were expecting.