Gaining Understanding Orbital Dynamics & N-Body Simulation

Click For Summary

Discussion Overview

The discussion revolves around understanding orbital dynamics and the n-body problem, particularly in the context of a high school project. Participants explore the feasibility of simulating orbital mechanics with limited prior knowledge in classical mechanics and programming.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant expresses uncertainty about the difficulty of simulating the solar system or a few bodies, questioning if their current knowledge is sufficient.
  • Another participant suggests that simulating a few bodies is feasible and that many source code examples are available online.
  • Concerns are raised about the complexity of n-body simulations with more than three bodies, with references to chaotic behavior and numerical integration errors.
  • Several participants discuss various numerical integration methods, including the leapfrog method and the Runge-Kutta Nyström algorithm, noting their respective advantages and challenges.
  • Direct summation is proposed as a straightforward approach for n-body simulations, with a discussion on its computational complexity and alternatives for larger simulations.

Areas of Agreement / Disagreement

Participants express differing views on the ease of implementing n-body simulations and the importance of learning numerical integration methods versus focusing on orbital mechanics. There is no consensus on the best approach or method for the project.

Contextual Notes

Participants mention limitations related to numerical integration techniques and the scaling challenges of direct summation for larger numbers of bodies. The discussion reflects varying levels of familiarity with programming and mathematical concepts.

Who May Find This Useful

This discussion may be useful for high school students or beginners interested in orbital dynamics, n-body simulations, and numerical methods in physics and programming.

Arcthor
Messages
34
Reaction score
1
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?
 
Physics news on Phys.org
Arcthor said:
Is is even possible to simulate the solar system or even 2 or 3 bodies orbiting each other with my knowledge?
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.
 
A.T. said:
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.

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?
 
Arcthor said:
Do you know if there is any truth to this or why people seem to think this is the case?
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.
 
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
 
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
 
Khashishi said:
I think the preferred integration method for gravitational systems is the leapfrog method https://en.wikipedia.org/wiki/Leapfrog_integration

I prefer the Runge-Kutta Nyström algorithm [e.g. http://theory.gsi.de/~vanhees/faq/gravitation/node62.html ]. It's not as easy to implement but much more accurate.
 
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
dipole said:
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.
Students do stuff to learn, not because there is a need.
 
  • #11
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
dipole said:
Yes, but he wants to learn about orbital mechanics

"... and the maths related to it and using this information to create a n-body simulation"
 
  • #13
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.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
2
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K