Show HN: Browser-based interactive 3D Three-Body problem simulator
81–90 of 119 posts
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#82Do these models of n-body gravity predict the perihelion in the orbit of Mercury?
Newton's does not predict perihelion, GR General Relativity does, Fedi's SQG Superfluid Quantum Gravity with Gross-Pitaevskii does, and this model of gravity fully-derived from the Standard Model also predicts perihelion in the orbit of planet Mercury.
Lagrange points like L1 and L2 are calculated without consideration for the mass of the moon.
Additional notes on n-body mechanics: https://westurner.github.io/hnlog/#comment-45928486 Ctrl-f n-body, perihelion
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#83My dumb question: I thought the whole thing with this is the instability/inability to predict. It starts off with the three bodies locked in to fixed motions? I guess it has to be for the user to start messing around with it?
There is no general closed-form solution to the three-body problem. There are certain specific initial conditions which give periodic, repeating orbits. But they are almost always highly "unstable", in the sense that any tiny perturbations will eventually get amplified and cause the periodic symmetry to break.
It's analogous to balancing an object on a sharp point. Mathematically, you can imagine that if the object's center of gravity was perfectly balanced over the point, then there would be zero net force and it would stay there forever. But the math will also tell you that any tiny deviation from perfect balance will cause the object to fall over. It's an equilibrium, but not a stable equilibrium.
The example at the link demonstrates this. The numerical integration can't be perfectly accurate, due to both the finite time steps and the effects of floating-point rounding. Initially the error is much too small to see, and the orbits seem to perfectly repeat. But if you wait a couple of minutes, the deviations get bigger and bigger until the system falls apart into chaos.
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#84My dumb question: I thought the whole thing with this is the instability/inability to predict. It starts off with the three bodies locked in to fixed motions? I guess it has to be for the user to start messing around with it?
Not a dumb question at all! There is no general closed-form solution to the three-body problem. There are certain specific initial conditions which give periodic, repeating orbits. But they are almost always highly "unstable", in the sense that any tiny perturbations will eventually get amplified and cause the periodic symmetry to break. It's analogous to balancing an object on a sharp point. Mathematically, you can…
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#85ThreeJS is awesome btw, I exported a GDB file I think from a CAD program and imported it into ThreeJS/able to animate each part pretty cool.
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#86Earlier quoted context omitted.
> Is this with Gemini 3? An LLM couldn't provide results for a sim like this, compared to a relatively simple numerical differential equation solver, which is how this sim works. Unless you're asking whether a sim like this could be vibe-coded, if so, the answer is yes, certainly, because the required code is relatively easy to create and test. Apart from a handful of specific solutions, there are no general closed-f…
Well I was wondering if it was vibe coded because Gemini 3 loves Three.js and that's a main selling point of the model.
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#87Oh one question I have, when I messed around with ThreeJS line width was a problem, these curves look pretty nice/thick on mac, maybe that was updated recently. (lines as in orbit path) ThreeJS is awesome btw, I exported a GDB file I think from a CAD program and imported it into ThreeJS/able to animate each part pretty cool.
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#88My dumb question: I thought the whole thing with this is the instability/inability to predict. It starts off with the three bodies locked in to fixed motions? I guess it has to be for the user to start messing around with it?
Not a dumb question at all! There is no general closed-form solution to the three-body problem. There are certain specific initial conditions which give periodic, repeating orbits. But they are almost always highly "unstable", in the sense that any tiny perturbations will eventually get amplified and cause the periodic symmetry to break. It's analogous to balancing an object on a sharp point. Mathematically, you can…
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#89Earlier quoted context omitted.
Some of the high speed ejections might be due to the approximations used. You can see this with a simple time-stepper when the forces get massive when 2 bodies get very close and that force is then applied for the whole timestep.
I don't doubt that the math allows for escape velocities in some interactions. But I am wondering if, realistically, tidal forces might instead shred the bodies before forces were adequate for a body to achieve escape velocity.
Re: Show HN: Browser-based interactive 3D Three-Body problem simulator
#90Excellent work. Is this based on simple Newtonian gravity applied over a uniform time-step, or something more sophisticated?
For accuracy, time step can get smaller when bodies are closer.