N-body problem simulation and relativity

  • Thread starter alyx_vance
  • Start date
  • #1
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:

Answers and Replies

  • #3
1,254
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.
 
  • #5
D H
Staff Emeritus
Science Advisor
Insights Author
15,393
686
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
1,254
3
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
PAllen
Science Advisor
8,280
1,542
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
1,254
3
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
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?


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
D H
Staff Emeritus
Science Advisor
Insights Author
15,393
686
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 [Broken]
    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
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
D H
Staff Emeritus
Science Advisor
Insights Author
15,393
686
Also note that I gave you a whole bunch of specific terms that you can google or conduct a literature search on.
 
  • #13
23
0
Can you send me this asimulator as PM or attachment pleasse.

Thank.
 
  • #14
Jil
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
3
0
Thank you,
I already forgot about this post.
Hello.
 

Related Threads on N-body problem simulation and relativity

Replies
17
Views
1K
Replies
12
Views
3K
  • Last Post
Replies
5
Views
3K
  • Last Post
Replies
11
Views
2K
  • Last Post
Replies
9
Views
3K
  • Last Post
Replies
17
Views
2K
  • Last Post
Replies
6
Views
2K
  • Last Post
Replies
10
Views
1K
  • Last Post
Replies
21
Views
4K
Replies
3
Views
1K
Top