After running my solar system simulation several times I was interested to see how robust the system was. By this I mean that despite the fact that the particles start off randomly distributed, the progress of the simulation is quite similar each time. The details weren't exactly the same each times, but in general, a star formed at the centre of the universe at about the same time and ended up with a few satellites, while several particles were sent flying off into space.
Below are three graphs showing the how the number of particles, the mass of the most massive particle, and the effective radius of the universe change over 2000 units of times. Each graph is based on 16 independent runs of the simulation. Each simulation started with 200 particles with a mass of 1, 2, 3 or 4 units, randomly distributed within a 480 x 360 space. The gravitational constant was 0.08.
This graph shows the number of particles in the universe, which reduces over time as multiple particles coalesce into fewer, larger particles. The line is a classic exponential decay as the probability of a collision (and therefore a reduction in particle number) is dependent on the number of particles (and also the size of the universe, but that changes less rapidly).
This graph shows the mass of the most massive particle in the solar system. In my simulation, when a particle reaches a mass of 125 units, it becomes a star. The graph shows that this event generally occurs just after 1000 units of time. The data is more variable than the number of particles, but in each case a star forms before 2000 time units pass.
This graph shows the effective radius of the universe over time. This value is calculated by taking the distance between the left most particle and the right most particle (the width of the universe) and multiplying this by the distance between the highest and lowest particles (the height of the universe) and taking the square root of the result.
The graph shows how the cloud of particles starts to collapse slowly, but accelerates. Just after 1000 time units (when stars tend to form), the minimum size is reached. At this point smaller particles are flung into space and the size of the universe increases pretty much linearly (and based on a brief look, this appears to be true for at least 5000 time units).
In the future, I would like to see how these patterns change under different the starting parameters (such as the number of particles and the distribution of particle mass).