N-body problem simulation and relativity

In summary: For an easy next step in symplectic techniques you might want to look into the leapfrog algorithm or velocity verlet integration. Much greater accuracy is possible for solar system models by taking advantage of the fact that the planets and the central star more or less follow elliptical paths. Some approaches:Cowell's method. This is an old but well-used scheme. The equations of motion are specified and integrated in Cartesian space, but using an integrator a bit better than your semi-implicit Euler technique. Cowell's method uses a 12th order Gauss-Jackson integrator.Enke-style integrator. The idea is to model the path as a perturbation of a Keplerian orbit. Occasionally you will
  • #1
alyx_vance
7
0
Do you happen to know about any resources on the gravitational N-body problem and general relativity? Ideally some open-source implementations or pseudo code.
I'm doing a N-body simulator for my bachelor's thesis and my advisor was wondering if I could add some algorithms that take general relativity into consideration. I am not required to really understand the algorithm, just somehow implement it...

I try to understand and implement classical algorithms myself, but this seems
out of reach for me. My math and physics background is too weak.
 
Last edited:
Physics news on Phys.org
  • #2
Just a quick note for now. See http://www.iers.org/nn_11216/IERS/EN/Publications/TechnicalNotes/tn36.html,
particularly chapters 10 and 11.
 
  • #3
what type of N-body situations are you looking at?
Most likely the only GR you might want to consider is correcting your (presumably) instantaneous action of the gravitational force. I.e. replace it with a force conveyed at the speed of light.
 
  • #4
  • #5
zhermes said:
what type of N-body situations are you looking at?
Most likely the only GR you might want to consider is correcting your (presumably) instantaneous action of the gravitational force. I.e. replace it with a force conveyed at the speed of light.
Bad idea. That will inevitably lead to a much worse result than just using Newtonian gravity. What is needed is some kind of post-Newtonian methodology, preferably in a fairly simple form. IERS Technical Note 36 (see post #2) does just that.
 
  • #6
D H said:
Bad idea. That will inevitably lead to a much worse result than just using Newtonian gravity. What is needed is some kind of post-Newtonian methodology, preferably in a fairly simple form. IERS Technical Note 36 (see post #2) does just that.
Could you elaborate a little; I implemented the above many years ago in a solar system dynamics class---it preserved accuracy as measured by energy and momentum conservation while accurately generating the precession of orbits.
 
  • #7
zhermes said:
Could you elaborate a little; I implemented the above many years ago in a solar system dynamics class---it preserved accuracy as measured by energy and momentum conservation while accurately generating the precession of orbits.

The thing you need to watch for, which you may have done, is that if you want to add light delay to action at a distance, you also need to add velocity (similar to EM) and acceleration dependent terms (unique to gravity). If you don't, you will get worse results than instant action at a distance. See, for example:

http://arxiv.org/abs/gr-qc/9909087
 
  • #8
PAllen said:
if you want to add light delay to action at a distance, you also need to add velocity (similar to EM) and acceleration dependent terms (unique to gravity). If you don't, you will get worse results than instant action at a distance.
Hmmm, interesting. Thanks!
 
  • #9
zhermes said:
what type of N-body situations are you looking at?
Most likely the only GR you might want to consider is correcting your (presumably) instantaneous action of the gravitational force. I.e. replace it with a force conveyed at the speed of light.
I'm mostly considering smaller systems, like the Solar system. I was wondering how much different results would the added relativity produce in some cases, like in the orbit of Mercury and such. I could also try to simulate some star cluster, although I'm not really required to do that.
How would the algorithm look like? Now it's like this (a simple euler for example):
http://pastebin.com/dhxzKMBK"
Do you know about any resource with more info?


D H said:
Just a quick note for now. See http://www.iers.org/nn_11216/IERS/EN/Publications/TechnicalNotes/tn36.html,
particularly chapters 10 and 11.
Thanks, I'll look at it.
 
Last edited by a moderator:
  • #10
alyx_vance said:
How would the algorithm look like? Now it's like this (a simple euler for example):
http://pastebin.com/dhxzKMBK"
A post-Newtonian expansion such as the one in post #2 just adds some more terms to the acceleration equation. (Note: Your code is mistakenly calling that term a force; it is an acceleration, and you are using it as such.)

Your integration algorithm is the semi-implicit Euler method, aka symplectic Euler, a step above basic Euler. It conserves energy (kind of) but the errors are still immense. You could incorporate relativistic effects into your semi-implicit Euler scheme, but to what avail? The errors induced by using semi-implicit Euler are orders and orders of magnitude higher than the errors induced by ignoring relativistic effects.

For an easy next step in symplectic techniques you might want to look into the leapfrog algorithm or velocity verlet integration. Much greater accuracy is possible for solar system models by taking advantage of the fact that the planets and the central star more or less follow elliptical paths. Some approaches:
  • Cowell's method. This is an old but well-used scheme. The equations of motion are specified and integrated in Cartesian space, but using an integrator a bit better than your semi-implicit Euler technique. Cowell's method uses a 12th order Gauss-Jackson integrator.
  • Enke-style integrator. The idea is to model the path as a perturbation of a Keplerian orbit. Occasionally you will need to recompute the orbit because the deviation from the nominal path has become too large. An old paper: http://adsabs.harvard.edu/full/1966AJ...71..579K
  • Variation of parameters. The basic idea here is to represent state as some kind of orbital elements. With the standard Keplerian orbital elements one use the Lagrange Planetary Equations as the equations of motion. There are other choices for orbital elements, e.g. Delaunay elements leads to the Delaunay Planetary Equations. A few references:
    http://lightsey.ae.utexas.edu/publications/cm1project-gaylor.pdf
    http://books.google.com/books?id=-dXzdYHvPgMC&pg=PA109&lpg=PA109#v=onepage&q&f=false
  • Kustaanheimo-Stiefel transform. The KS transform turns a bound Keplerian orbit into a harmonic oscillator. A reference:
    http://arxiv.org/pdf/0803.4441

Since you are doing a senior-level project you may not need to use one of these more advanced techniques, but it certainly is worthwhile to know about them.
 
Last edited by a moderator:
  • #11
D H said:
Your integration algorithm is the semi-implicit Euler method, aka symplectic Euler, a step above basic Euler. It conserves energy (kind of) but the errors are still immense. You could incorporate relativistic effects into your semi-implicit Euler scheme, but to what avail? The errors induced by using semi-implicit Euler are orders and orders of magnitude higher than the errors induced by ignoring relativistic effects.

I know Euler is extremely inprecise, I'll definitely implement other algorithms. I mentioned it so you could maybe add som pseude code like "somehow_compute_gravity_force_with_lag()" into line 3, for example, so I would get the basic idea...

Thanks for the resources, I'll try to look at them. :smile:
 
  • #12
Also note that I gave you a whole bunch of specific terms that you can google or conduct a literature search on.
 
  • #13
Can you send me this asimulator as PM or attachment pleasse.

Thank.
 
  • #14
I found a program which does consider those relativistic correction terms at http://eod.github.com/JGravSim . It's very slow, but you can see the mercury doing nice moves around the sun.

EDIT: Oh, sorry. I realized too late that the thread is very very old :(
 
  • #15
Thank you,
I already forgot about this post.
Hello.
 

1. What is the N-body problem and why is it important in scientific research?

The N-body problem is a mathematical problem that involves predicting the motion of a system of N objects interacting with each other through gravitational forces. It is important in scientific research because it helps us understand and predict the behavior of celestial bodies such as planets, stars, and galaxies in our universe.

2. How is the N-body problem solved using simulation methods?

Simulation methods involve creating a computer program that models the motion of N objects based on their initial positions, velocities, and masses, as well as the laws of gravity and motion. The program then calculates the forces between the objects and updates their positions and velocities over time, allowing us to observe and analyze the behavior of the system.

3. Can the N-body problem simulation accurately account for the effects of relativity?

Yes, the N-body problem simulation can be modified to incorporate the effects of relativity, which is the theory that describes how gravity affects the motion of objects in space. This allows us to make more accurate predictions about the behavior of celestial bodies, especially when dealing with massive and fast-moving objects.

4. What are some challenges in simulating the N-body problem and relativity?

One major challenge is the computational power and speed required to accurately simulate a large system with many objects. Another challenge is the need for precise initial conditions, as even small errors can lead to significant discrepancies in the final outcome. Additionally, incorporating the effects of relativity can be complex and require advanced mathematical techniques.

5. How do scientists use N-body problem simulation and relativity to study the universe?

Scientists use N-body problem simulation and relativity to model and study various phenomena in the universe, such as the formation and evolution of galaxies, the orbits of planets and moons in our solar system, and the behavior of black holes. By analyzing these simulations, scientists can gain a deeper understanding of the fundamental laws of physics and how they shape our universe.

Similar threads

  • Programming and Computer Science
Replies
19
Views
2K
  • Classical Physics
Replies
2
Views
1K
  • Special and General Relativity
Replies
17
Views
2K
  • Special and General Relativity
2
Replies
35
Views
659
  • Special and General Relativity
Replies
22
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
1K
  • Special and General Relativity
Replies
8
Views
1K
  • Classical Physics
Replies
2
Views
962
  • Special and General Relativity
Replies
11
Views
1K
  • Programming and Computer Science
Replies
15
Views
2K
Back
Top