Live data from Hacker News

Gravity Simulator

nowykurier.com

41–50 of 135 posts

Re: Gravity Simulator

#41

Hey.. TBH its real fun to play with it. Question.. How big is the frame? I create two objects and they went out of frame. Then I create 2 more but a bit bigger ones and after 2-3 minutes I see those two objects coming back and it looks good too :D .. check it out http://imgur.com/IBYeysm

I don't think there is a "frame". It solves for all particles all the time.

After all, if a particle leaves the viewport, it doesn't affect the particle count readout at all.

I assume if things move far enough, there would probably be interesting floating-point precision errors, but I'd imagine that would take quite a while.

Re: Gravity Simulator

#44

Very cool! I was able to get 2 masses to oscillate around each other in a funny way[1]. Seems they keep going like that forever. What is this kind of equilibrium called? [1] http://imgur.com/FQYpo9V

Looks like a binary star, similar to the two suns of Tatooine.

http://en.wikipedia.org/wiki/Binary_star#mediaviewer/File:Or...

OP: This is an amazing tool to learn the sensitivity of dynamical systems to initial conditions. Well done!

Re: Gravity Simulator

#46
post #10

Very cool! I was able to get 2 masses to oscillate around each other in a funny way[1]. Seems they keep going like that forever. What is this kind of equilibrium called? [1] http://imgur.com/FQYpo9V

Isn't that a normal orbit around a common centre of mass? As the objects have a similar size the centre of mass appears to wobble as it moves along. In the frame of the centre of mass, the objects would just go round in standard orbits.

Yeah

That's the thing with those kind of simulators (or, actually, with reality), your reference has no relation to the center of mass of the system.

Of course, if you "were there" the reference would be the center of mass, like the reference of the solar system is "The Sun" (or a point inside it)

Re: Gravity Simulator

#47
post #43

At first I thought it was a 2D simulation but my attempt showed otherwise. http://i.imgur.com/roHx3wi.png Really nice tool.

I think what you see there is not necessarily an indication of the simulation happening in 3-d space[1]. It is however evidence of [precession](http://en.wikipedia.org/wiki/Precession), which should not happen in a 2-body problem. If no other heavy body was close to the ones shown in your screenshot, this should actually not happen. Since the simulation does, however, only have a finite precision, this could very well be an artifact of the simulation (happens often if you have near-collisions, since the change of velocity there happens rapidly and is hard to describe correctly with a fixed-length time step).

[1] In fact if all initial positions and velocities lie in the same 2d plane, all trajectories would also lie in this plane. Since the interface only allows one to set such initial conditions, I am fairly confident that the simulation is 2d only.

Re: Gravity Simulator

#48

I did something similar, but with combat - ships, lasers and missiles. There are a couple of variations, and some tweaks like the ships accelerating perpendicular to the planets so they don't crash land. http://codepen.io/simonswain/full/ftEjD/ http://codepen.io/simonswain/full/CeHmh/

That is really cool.

Re: Gravity Simulator

#49
I did something similar in Javascript. My implementation uses the Runge-Kutta algorithm, that is more stable. My GUI does not allow planet creation, but it shows several stable configurations, including the 13 recently found three body planar orbit configurations.

http://jbochi.github.io/planets/ http://suki.ipb.ac.rs/3body/

Re: Gravity Simulator

#50

Very cool! I was able to get 2 masses to oscillate around each other in a funny way[1]. Seems they keep going like that forever. What is this kind of equilibrium called? [1] http://imgur.com/FQYpo9V

If they were truly rotating around each other in a repeatable way, it would be a harmonic oscillator.
Post reply on HN