This is because each "atom" is of a considerable size to the larger clumps and imparts its excess momentum as angular momentum when it joins a clump. "Atoms" that are rotating around a clump in the opposite direction tend to skip off, and thus don't join and slow the rotation. I think.
If you restart the simulation a few times, you should eventually get something where everything forms into one clump with low initial angular momentum. If you keep watching from that point, you'll see the clump's rotation accelerate entirely on its own.
I'm not entirely sure on the cause, but it does seem to be a simulation flaw.
You're right. At a guess, as collisions appear to be perfectly elastic particles inside a clump are trying to move and instead of their shifting being dampened, it's causing the whole structure to begin to rotate which causes more in-clump collisions causing... until it spins apart. Sound reasonable?
small niggle. what is a verlet constraint? (rhetorical)
whilst its obvious that you have just discovered verlet integration and the relaxation method of applying constraints - because everyone goes off and writes a physics engine at this point - i only think i know what you mean because i have assumed this.
are these length constraints, angle constraints etc?
still... no matter how common and unexciting this is for me, its always cool to play with physics simulations for five minutes. thanks for sharing. :)
Some of the examples (the cloth and the tree) seem to be based off Sub Protocol's verlet-js demonstration [1], which were on Hacker News a while back (HN discussion [2]). There was a similar issue with angular momentum not being conserved on those examples too.
15 comments
[ 2.8 ms ] story [ 46.3 ms ] threadIgnoring that, it's pretty neat - and runs decently fast as well.
But I suppose the collisions are (too) elastic, also there's the issue with the spinning.
But still you can see several concepts in action, and sometimes you get a big planet with a moon orbiting it.
If you restart the simulation a few times, you should eventually get something where everything forms into one clump with low initial angular momentum. If you keep watching from that point, you'll see the clump's rotation accelerate entirely on its own.
I'm not entirely sure on the cause, but it does seem to be a simulation flaw.
I'd like a 3d version to combine with three.js.
whilst its obvious that you have just discovered verlet integration and the relaxation method of applying constraints - because everyone goes off and writes a physics engine at this point - i only think i know what you mean because i have assumed this.
are these length constraints, angle constraints etc?
still... no matter how common and unexciting this is for me, its always cool to play with physics simulations for five minutes. thanks for sharing. :)
[1] http://subprotocol.com/verlet-js/
[2] https://news.ycombinator.com/item?id=5580596
Been wondering about where I can get a physics engine to simulate wind. I want to create a wind turbine simulator.