Rigid bodies and infinitely stiff springs ?

In summary, In order to get a good rigid body simulator, you need to use springs that are infinitely stiff. If the stiffness gets too high, the bodies will drift apart.
  • #1
stasb
4
0
Hi, guys!
I've managed to implement a decent enough rigid body simulator for my 2D game using my sketchy high-school physics knowledge.
Now I'm trying to pin some rigid bodies together. Connecting them with springs doesn't quite do the job. Too soft, the bodies drift apart. Too stiff, the simulation explodes. The smaller the integration timestep, the stiffer the springs I can have. What happens to linear\angular positions and velocities of two rigid bodies connected by a spring when stiffness approaches infinity and the timestep is infinitely small? Can't figure it out for the life of me, but something tells me it's a cheap solution to the problem. Any insight highly appreciated. :smile:
 
Physics news on Phys.org
  • #2
The stiffness is often expressed in terms of the ratio of the constant of proportionality between the force and the stretch of the spring, called k, and the inertia of the object m. The frequency of oscillations scales like the square root of k/m, so self-similar behavior should appear when the timestep is scaled with the square root of m/k. That might be considered the inverse square root of the stiffness. If k/m goes to infinity, then the timestep needs to be infinitely short. That might become computationally expensive! I would think you might want to set k/m at the smallest value that seems to keep the masses from drifting apart, then scale the timestep with the inverse square root of that to keep things from exploding. That should let you get the longest possible timestep. But I'm not sure why the masses drift apart-- springs are pretty good at keeping things together! So your answer might also depend on what it is that is making the pieces wander away-- it depends on whether they are given some characteristic speed by what you do to them, or some characteristic energy.
 
  • #3
Hmm... I'll try to explain what I'm asking for.
If we have two point masses connected by a spring with an infinite stiffness, we can intuitively tell the net effect of the spring without doing an infinite number of infinitely small timesteps. The point masses would simply stick together. What happens if we have rigid bodies instead?
 
  • #4
The rigid bodies "stick together" to form one larger rigid body.

The only difference from point masses is that if the bodies have a finite size, you will need to find the CG position of the combined body, and if your simulation includes rotation you will need the moments of inertia about the new CG.

When you know the motion of the CG of the combined body, you can find the position of the original parts by geometry. You don't need to know the forces between the parts of the combined body.

If finite sized bodies collide and stick together, you can model what happens in the collision in the same way as any other inelastic collision, using conservation of linear momentum and angular momentum. You don't need to find the forces explicitly.
 
  • #5
Yes, if you want rigid bodies, why mess with springs in the first place? Just apply the rigidity constraint manually by asserting the shape of the combined bodies, and use the extensive bulk of physics built up around rigid bodies. That generally separates the problem into what the COM is doing, which is just like a point mass, and what the internal rotation is doing, which requires the moment of inertia concept, as AlephZero said.
 
  • #6
I think there's a misunderstanding going on... I need the two rigid bodies to be pinned together at a single point, allowing them to change orientation relatively to each other, not just lump together two rigid bodies and have them act like one. By the way, Ken, congratulations post #1337. :)
 
  • #7
stasb said:
I think there's a misunderstanding going on... I need the two rigid bodies to be pinned together at a single point, allowing them to change orientation relatively to each other, not just lump together two rigid bodies and have them act like one. By the way, Ken, congratulations post #1337. :)

You don't want springs in that case. You want joints.
 
  • #8
Yes, I want joints. Simulated by infinitely stiff springs.
No, I don't want to be linked to articles explaining the "proper" way to do it. They're way over my head. The only one I can actually grasp (http://www.gamasutra.com/resource_guide/20030121/jacobson_02.shtml) talks about simulating jointed rigid bodies using particles and stick constraints.

A common model for cloth consists of a simple system of interconnected springs and particles. However, it is not always trivial to solve the corresponding system of differential equations. It suffers from some of the same problems as the penalty-based systems: Strong springs leads to stiff systems of equations that lead to instability if only simple integration techniques are used, or at least bad performance – which leads to pain. Conversely, weak springs lead to elastically looking cloth.

However, an interesting thing happens if we let the stiffness of the springs go to infinity: The system suddenly becomes solvable in a stable way with a very simple and fast approach.

It doesn't give a mathematical proof, but it's quite intuitive for particles.
I'm trying to derive an analogous solution for rigid bodies.
 
  • #9
stasb said:
Yes, I want joints. Simulated by infinitely stiff springs.
No, I don't want to be linked to articles explaining the "proper" way to do it. They're way over my head.

Apologies for misunderstanding the OP.

Unfortunately, from my own experience the only way that is likely to work correctly and efficiently IS the "proper way".

The basic cause of the problem is the relative rotation of the two parts that are pinned together. Unless you have a model that "knows" that the relative motion of the pinned parts in each time step is around the arc of a circle, not along a straight line, you will always get the problem that the spring is stretched or compressed to the wrong length at the end of the step, and therefore you will get unwanted oscillations of the structure or the simulation will "blow up" unless you take tiny steps

What you are trying to do is a hard problem. If it's any consolation, some of the world's "industry standard" finite element analysis packages also made a mess of trying to model this, back in the 1970s and 80s before the "proper way" was widely known.
 

1. What is a rigid body?

A rigid body is a theoretical object that does not deform or change shape when subjected to external forces. It is assumed to have an infinite stiffness and maintains its original shape and size under all circumstances.

2. What is an infinitely stiff spring?

An infinitely stiff spring is a hypothetical spring that has infinite stiffness and does not change in length when a force is applied. This means that it does not stretch or compress and is always in its equilibrium state.

3. How are rigid bodies and infinitely stiff springs related?

Rigid bodies and infinitely stiff springs are related in the sense that they both represent idealized objects that do not deform under the influence of external forces. In some cases, rigid bodies are used to model objects that behave like infinitely stiff springs.

4. What are some real-life examples of rigid bodies and infinitely stiff springs?

Examples of rigid bodies include solid objects like a brick, a metal rod, or a book. Infinitely stiff springs are often used to represent the behavior of objects like a wall or a floor that do not deform under normal circumstances.

5. What are the limitations of using rigid bodies and infinitely stiff springs in scientific models?

The main limitation of using rigid bodies and infinitely stiff springs in scientific models is that they are idealized objects that do not exist in the real world. In reality, all objects have some level of flexibility and deformability, and these idealizations may not accurately represent the behavior of certain systems.

Similar threads

  • Classical Physics
Replies
3
Views
770
  • Mechanical Engineering
Replies
3
Views
2K
Replies
9
Views
957
  • Introductory Physics Homework Help
Replies
1
Views
2K
  • Classical Physics
Replies
2
Views
1K
Replies
2
Views
2K
  • Sticky
  • Aerospace Engineering
2
Replies
48
Views
60K
Back
Top