I have a soft spot for gravity simulators, my first BASIC program that wasn't a variation on INPUT "Your Age";A :PRINT "You are ", A*52, " weeks old." was a gravity simulator with a rocket in orbit and your capsule needed to dock with it by apply forward or reverse thrust (2D only!) What made mine a bit different was that you launched from the planet so you had to take into account where the other rocket was before launching or you wouldn't have enough fuel to dock.
What this example in Elm and all reasonably implemented simulators provoke is a sense of awe in just how hard it is to "drive" in orbit.
I always enjoy playing with these kinds of simulations, but this one seems to be pretty bad at respecting conservation of energy. The closer you are to the sun, the more rapidly your spacecraft mysteriously gains energy from nowhere, causing it to spiral outward instead of maintaining a stable orbit. I'm not sure yet whether it's a consequence of using naive Euler integration or some other bug.
I too wasted lots of time playing with these simulations. The feyman lecture on physics have a great chapter on this stuff. The orbit does tend to pick up energy due to errors coming from euler's method. A relatively simple way to make your orbits a bit more stable is to normalize your velocity vectors using conservation of energy.
I wasn't familiar with Elm prior to seeing this submission. To save others a few minutes of web searching, it appears at first glance to be a marriage of Haskell and Dart... a functional programming language that transpiles into JavaScript. It's primary use cases seem to include browser-based games, and reactive widgets.
Some time ago I played a bit with elm and made this: http://share-elm.com/sprout/5467ef7de4b00800031feadf, not a simulation of course but the effect it's nice.
It's cool to see an actual simulation, now. Well done.
The way the lines of force are illustrated (even the colors used) is very reminiscent of New Orbit, which is still one of the most innovative games I have seen for Android.
I've been keeping an eye on Elm for a while; it's a very intriguing idea, but I've yet to see much other than little demos like this done with it. This seems to be the chronic case of gaming in the FP and Lisp worlds. Lots of little demos and experiments, very few mature projects.
When making gravity simulations you need to "cheat" a little to make the planets and the stars keep a stable orbit.
It makes one amaze over how stable our own star system is.
What this example in Elm and all reasonably implemented simulators provoke is a sense of awe in just how hard it is to "drive" in orbit.