I’ve been rewriting a gravity simulator (see my earlier posts on ephemerides and relativity). This isn’t because I’ve thought of a better design or come upon a better technology for it. It’s because I lost the first version! I’ve recovered almost up to the point where I was before, writing essentially the same program (in C, with naive n-body and Barnes-Hut implementations).
The main difference between the two projects is that the first one aimed at simulating galaxies. By “galaxy” I mean a system with thousands of stars; billions is not computationally feasible with my program and hardware (yet). This time round, I’ve concentrated on a solar system simulation, with the actual planets of our own system and several of their major moons. I’ve tried re-exploring galaxies but it’s quite hard to find starting conditions that result in a pleasing shape. Perhaps the trick is to take data for a real galaxy and scale it down in a consistent manner.
The one artefact of the previous version is this animation of a galaxy. I do not know the scale, number of stars, or starting conditions. I recall that the colours are assigned by initial distance from centre, and are there to a) make it look more like a celestial object and less like abstract pixels; and b) indicate whether the initial distance of a star predicts distance once a steady state is reached. (And, when rerun with a steady state as the initial conditions, whether stars tend to maintain their distance.)