I spent a long time playing with the sim. Nice work. Most of the random data sets that I ran ended up with a two body system, where the third body was flung far into space never to return. However, some of these were misleading. I had one running for 15 minutes at 5x, and the third body did eventually return.
> However, some of these were misleading. I had one running for 15 minutes at 5x, and the third body did eventually return. That's not misleading. Real three-body orbital systems show this same behavior. Consider that such a system must obey energy conservation, so only a few extreme edge cases lose one of its members permanently (not impossible, just unlikely). Ironically, because computer simulators are based on nu…
Show HN: Browser-based interactive 3D Three-Body problem simulator
31–40 of 119 posts
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#32Tried writing an electrostatic particle simulator in Turbo Pascal 7 with BGI as a teen, a handful of particles before it crawled. Then saw a galaxy collision sim on a CD-ROM magazine disc handling thousands of bodies smoothly. Thought it was assembly tricks.. now I'm sure it's algorithmic (avoiding N**2 runtime) but never dug into the specifics. Are charges vs gravity sims essentially the same n-body problem?
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#33This is amazing! Nicely done! I did something similar, mostly 2D here: https://www.nhatcher.com/three-body-periodic/ (Mine is just unfinished)
Thank you! Your 2D version is great, I love seeing how different people approach this stuff. As for integrators, I currently only have Velocity Verlet and RK4 (can change in the advanced settings). I started with just Verlet, but to get some of the presets to behave properly I ended up needing RK4 as well. I’ve been thinking about adding adaptive methods next, but I'll take a look at the methods you've got listed too…
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#34Earlier quoted context omitted.
The link points to one of the stable solutions, and there are actually quite a few of those. The problem is that there’s no general closed form that tells us exactly where the bodies will be in the future, so we rely on numerical methods to approximate the motion. If you hit Reset All a few times or add more bodies, you’ll start to see the chaos
There actually is an analytical solution using a power series that actually converges (Karl Sundman's work). Unfortunately, the universe still mocks our attempts. Though the series converges, it does so incredibly slowly. From Wikipedia: The corresponding series converges extremely slowly. That is, obtaining a value of meaningful precision requires so many terms that this solution is of little practical use. Indeed,…
Well we could speed up that simulation pretty easily, just arrange the actual masses and velocities somewhere...
Then I thought, is there a way to scale the distances, masses and velocities to create a system with the same, but proportionally faster behavior?
One guess as to perhaps why not: As distances get small, normal matter bodies will get close enough to actually collide. Perhaps some tiny primordial black holes would be useful.
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#35How about a perturb button so those special stable orbits can be nudged just enough to destabilize them.
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#36I've been working on some n-body code too, currently native only though: https://www.youtube.com/watch?v=rmyA9AE3hzM
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#37Earlier quoted context omitted.
Nightfall by Asimov was a 7 bodies problem - https://en.wikipedia.org/wiki/Nightfall_(Asimov_novelette_an...
And to be fair, Liu Cixin's book is a 4 bodies problem :)
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#38Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#39I recently thought that if life supposedly happened by chance then it should be same for the three-body problem: naturally occurred solutions floating here and there somewhere.
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#40No physics expert but isn't this unpredictable (based on what I saw in series) ? Amd this does seem predictable, I saw this for almost a minute
N-body problems for N>3 do not have exact, closed form solutions. For N=2 the solution is an ellipse. For N=3+ there is no equation you can write down that you can just plug in t and get any future value for the state of the system.
But that is NOT the same as saying it is unpredictable. It is perfectly predictable. You just have to use one of the many numerical solutions for integrating ODEs.