3 ms·
If anyone is interested in playing around with gravitational dynamics I highly recommend the REBOUND library [1]. It has a simple Python interface but under the
by antognini 3y ago
If anyone is interested in playing around with gravitational dynamics I highly recommend the REBOUND library [1]. It has a simple Python interface but under the hood it has a collection of research grade integrators. It came out around the time I was finishing up my PhD in gravitational dynamics, but if I were still in the field it's what I'd be using.
If you're curious what would happen to the Solar System if you made Jupiter 10 times more massive you can pip import the library and find out for yourself in about five minutes.
[1]: https://github.com/hannorein/rebound https://github.com/hannorein/rebound
- ricksunny 3y agoLooks awesome. I have a question that might be pedantic but I think you could speak to. Coming from an engineering mindset, I like the use of the term 'integrator' instead of 'solver'. In MATLAB, 'solvers' are used to iterate states of ODE models. But the term 'integrator' is more intuitive to me. Can you speak to the use of one term vs another in the ephemeris community?
- constantcrying 3y agoSolver is a general term, it is just an algorithm which solves a certain problem. You have solvers for linear systems, PDEs, optimization problems, graph problems, etc. An integrator is an algorithm which allows the numerical approximation of the solution to an ODE, given that the ODE is written in a specific form where it is equivalent to calculating the integral of multiple functions.
- dreamcompiler 3y agoYou can solve differential equations by integrating or by differentiating. Real-world integrators were easier to build back when DEs were solved with analog computers. Although "easier" is an understatement: Differentiators have a nasty habit of trying to blow up to infinity, which means you can't really build a good, general differentiator either with analog or digital electronics. Integrators are much better behaved pets and they don't shit on the carpet. So everybody uses integrators. Integrators have lots of issues too but those can be sufficiently mitigated for many classes of problems. Differentiators are mostly hopeless, feral beasts.
- mnw21cam 3y agoAre you sure you got these the right way round? It seems logical that something that integrates over time should veer off towards infinity eventually, but something that differentiates should be stable.
- dreamcompiler 3y agoIntegrals are summers so they can increase without bound over time. But if the input function varies around y=0 -- as many do -- they can remain stable. Now let's talk about infinities that can happen instantly: What's the derivative at the upward edge of a square wave?
- lucgommans 3y agoIt's a hundred times less polished than rebound (that readme looks seriously cool!), but in 2021 I also wanted to toy around with orbital mechanics / gravity and couldn't find a quick and easy simulator so I made this to run in a browser: https://lucgommans.nl/p/badgravity/ https://lucgommans.nl/p/badgravity/ Since it's so rough on the edges (especially on mobile, initially I was surprised it works at all), here's the steps for the mentioned example of making Jupiter 10x heavier: 1. Open the scenarios on the left and click play on the inner solar system to load that up 2. Click the plus on the outer planets to add them in (if it looks like nothing happened: zoom out. Space is big and this is to scale) 3. Fold out the "bodies" section and alter the mass for "J"upiter. The change is applied live. 4. Optionally press Restart to restart with the current settings but back at their initial positions and speeds Making Jupiter 1000× heavier (and fast-forwarding the time in the Simulator controls by 10×) makes it eject Mars from the solar system within one minute, but interestingly Mercury and Venus seem pretty stable around the sun in that configuration The help/about page (https://lucgommans.nl/p/badgravity/about.html https://lucgommans.nl/p/badgravity/about.html) contains links to all other orbit projects I could find. Seeing Rebound as well as the OP, I should probably add a "libraries" section! Or do you think that should just go with "Software to download" alongside Stellarium and such?