Orbital Dynamics

1. Nov 17, 2014

Arcthor

Hello.

I have a project in school in which I will be attempting to gain an increased understanding of orbital dynamics and the maths related to it and using this information to create a n-body simulation. I have a like 3-4 months to finish it and I'm currently in high school so I am only familiar with classical mechanics and related math. I currently know some Java and have a basic understanding of how gravity works in newtonian physics. However, I am prepared to learn as much as possible, especially if it's about math.

Any tips or information regarding orbital dynamics and the n-body problem would be greatly appreciated.

I don't really know how hard this project will be. Am I in over my head? Is is even possible to simulate the solar system or even 2 or 3 bodies orbiting each other with my knowledge?

2. Nov 17, 2014

A.T.

Yes. You will find tons of source code examples for this on the net. It's more like 3-4 hours, than 3-4 months. So don't worry.

3. Nov 19, 2014

Arcthor

Oh, really? Nice. It seems easy on one hand, but I've also read that it is extremely hard to do a n-body simulation with more than 3 bodies due to the fact that the motions become so random, sort of like a double pendulum. https://math.uwaterloo.ca/applied-m...ed-mathematics/files/uploads/images/dpend.gif

Do you know if there is any truth to this or why people seem to think this is the case?

4. Nov 19, 2014

A.T.

Yes it's potentially a chaotic system. And numerical integration tends to accumulate errors over time, so you have to continuously correct them based on conservation laws, if your really want a long term prediction.

5. Nov 21, 2014

Lsos

You can play Kerbal Space Program to get an intuitive understanding of orbits. (Un?)fortunately it doesn't simulate n-body orbits, but once you get the general idea of 2-body orbits, n-body orbits are just details :D

6. Nov 21, 2014

Khashishi

Well, it's 3-4 hours if you know numerical programming. If you don't know programming and you don't know numerical integration techniques, then it will take much longer.

Don't just copy some open source program.. you won't learn much that way. I think the preferred integration method for gravitational systems is the leapfrog method https://en.wikipedia.org/wiki/Leapfrog_integration

7. Nov 21, 2014

DrStupid

8. Nov 21, 2014

A.T.

9. Nov 21, 2014

dipole

Runge-Kutta is easy to implement with standard libraries. There's no real need to write numerical integration methods from scratch, since people who are better than you at doing so have already spent a lot of time perfecting them.

10. Nov 21, 2014

A.T.

Students do stuff to learn, not because there is a need.

11. Nov 21, 2014

dipole

Yes, but he wants to learn about orbital mechanics, not the details of efficient numerical integration... Obviously I'm not saying he shouldn't try to learn it, but in practice no one writes their own numerical methods, because a lot of time and energy has already been spent making very good ones that are general.

12. Nov 22, 2014

DrStupid

"... and the maths related to it and using this information to create a n-body simulation"

13. Nov 22, 2014

Calion

A simple n-body simulation should be easy to write if you have high school physics and some programming experience! The simplest way is to do direct summation, where you calculate GMm/r^2 for all pairs of bodies at each time step and sum the forces on each particle. As others have pointed out, the leapfrog method is the most common method for updating the positions and the velocities. A few other things that you might want to consider:

• Direct summation scales as n^2, since each body interacts with n other bodies, and you need to calculate all interactions for each of n bodies. In computer algorithm lingo, it is O(n^2). This makes it less practical when n is very large (> 1000, say)
• There are more complicated schemes for n-body simulations such as oct-tree, particle-mesh, and particle-particle-particle mesh (PPPM, or P^3 M) methods. These are harder to implement but have O(n log(n)) scaling which makes them more efficient for large simulations.
• Leapfrog is not the most accurate numerical integration scheme, but it has nice energy/momentum conservation properties and is time reversible. This is why it is more common for n-body than RK4.