# Gravity Disc

Swarm · f(r) between bodies

`f(r) = 0.05/r²`

[Open in the app](https://www.wavelace.com/app#p=88) · [This page](https://www.wavelace.com/presets/gravity-disc)

### The setup

`0.05/r²` is Newton's law of gravitation with every mass set to 1 and `G = 0.05`. The value is positive at every distance, so every pair pulls together and nothing ever pushes. Forty of those unit masses start scattered over a disc, set turning as one at `Swirl` 0.3, so a mass at distance `d` from the centre starts out moving at `0.3·d`. Nothing ever leaves the floor plane: this is a flat problem.

### The force

If all forty masses sat at the centre, a body three units out would feel `0.05 · 40 / 3² ≈ 0.22`. A circular orbit there would want a turn rate of `√(0.22/3) ≈ 0.27`, so the disc opens turning a little faster than a circle.

But the pull is nothing like that smooth. A body's nearest neighbour starts about half a unit away and pulls with `0.05/0.5² = 0.2`, as hard as the whole cloud together.

### Why it comes apart

With forty point masses the graininess wins. Two bodies fall together, whip round each other and come out as a tight pair moving faster than either arrived. The rest of the swarm pays for it and sinks a little deeper. Repeat this and the cloud sheds its outer members: the mean distance from the centre grows from 2 at the start to 4.7 after twenty seconds, to 8 after forty and to 11 after a minute, by when most of the swarm has crossed the edge of the plot. This is evaporation, the reason real star clusters lose stars one by one.

### History

Erik Holmberg ran the first N-body experiment at Lund Observatory in 1941, without a computer. He stood light bulbs where the stars were and read the light with a photocell, because light falls off as `1/r²` just as gravity does. Between steps he moved each bulb by hand, and so watched two galaxies pass.

### Try

- `Top`: from above the swarm reads as the plane figure it is.
- Set `Swirl` to 0: with nothing holding the disc up it falls to a knot in about five seconds, and the pile-up throws most of it straight back out.
- Set `Swirl` to 0.6: twice the turn rate is far more than this much mass can hold, and the disc flies apart from the first second.
- Change the formula to `0.2/r²`: four times the pull, and the disc has fallen in by two seconds.
- Set `Bodies` to 8: few enough to follow one at a time, and a slingshot is easy to catch.

### Read more

- [N-body problem](https://en.wikipedia.org/wiki/N-body_problem)
- [N-body simulation](https://en.wikipedia.org/wiki/N-body_simulation)
- [Newton's law of universal gravitation](https://en.wikipedia.org/wiki/Newton%27s_law_of_universal_gravitation)
- [Star cluster](https://en.wikipedia.org/wiki/Star_cluster)
