Hi, Iam currently implementing some softbodies to my engine. I connect some masspoints with constraints (springs). I hoped to improve the stability of larger softbodies by using a different integration sheme. Currently Iam using this:
1) IntegrateForcesToGetVelocities (here "forces" are gravity for example, NOT any constraint forces, they are solved by velocity)
v'=v+a*h
2) SatisfyConstraints (this changes velocities again)
3) IntegrateVelocityToGetPositions
x'=x+v'*h
As far as I understand I can't use verlet integration for example because my acceleration is unknown? (my constraints work on the velocity level and not by using forces). Is there any way to calculate a acceleration applied by the constraints? I tried this by dividing the velocity change in step (2) by the timestep and use
x'=x+v*h+0.5*(velDifferent)*timestep in (3) but that was unstable.
Or am I completely wrong an there is a simple way to add rk4 or anything else to the constraint-based engine?
Thanks!
Alternative to symplectic euler?
-
- Posts: 231
- Joined: Tue Feb 20, 2007 4:56 pm
Re: Alternative to symplectic euler?
I could be wrong, but I think you have to solve the constraints at the acceleration level rather than the velocity level if you want to use a generic integration scheme. Presumably, it's because solving constraints at the velocity level interferes with the normal generic integration of velocity, which is acceleration * time.
I have done this (solved constraints at the acceleration level with different RK schemes), it works, but my experience would probably tell you that you don't want to do this. While the different types of integration all have different properties, the only ones that are consistently more stable than symplectic are the implicit ones. And that adds a whole new complication, not to mention the expense of calculating them. But, as always, it depends on your actual project what your requirements are.
I have done this (solved constraints at the acceleration level with different RK schemes), it works, but my experience would probably tell you that you don't want to do this. While the different types of integration all have different properties, the only ones that are consistently more stable than symplectic are the implicit ones. And that adds a whole new complication, not to mention the expense of calculating them. But, as always, it depends on your actual project what your requirements are.