N-body problem simulation and relativity

Click For Summary

Discussion Overview

The discussion revolves around the gravitational N-body problem and the incorporation of general relativity (GR) into simulations. Participants explore various algorithms and methodologies for simulating N-body dynamics, particularly in the context of their application to systems like the Solar system.

Discussion Character

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

Main Points Raised

  • One participant seeks resources for implementing GR in an N-body simulator for their bachelor's thesis, expressing concerns about their math and physics background.
  • Another participant suggests reviewing specific chapters in a technical note related to GR and N-body simulations.
  • Some participants propose that the only GR consideration might be to replace instantaneous gravitational force with a force conveyed at the speed of light.
  • Others argue against this approach, suggesting that it could lead to worse results than using Newtonian gravity, advocating for a post-Newtonian methodology instead.
  • There are discussions about the need to incorporate velocity and acceleration dependent terms when adding light delay to gravitational interactions.
  • One participant shares their experience with implementing a post-Newtonian expansion that preserved energy and momentum conservation while generating accurate orbital precession.
  • Another participant critiques the use of the semi-implicit Euler method in the integration algorithm, noting its significant errors compared to the potential errors from ignoring relativistic effects.
  • Several alternative integration techniques are mentioned, including Cowell's method, Enke-style integrator, and the Kustaanheimo-Stiefel transform, with references provided for further exploration.
  • A participant expresses interest in how to implement relativistic corrections in their existing algorithm and requests pseudocode examples.
  • One participant mentions finding a program that considers relativistic correction terms, although it is noted to be slow.

Areas of Agreement / Disagreement

Participants express differing opinions on the best approach to incorporate GR into N-body simulations. While some advocate for specific methodologies, others challenge these suggestions, leading to an unresolved discussion regarding the optimal techniques and their implications.

Contextual Notes

Participants highlight the complexity of integrating relativistic effects and the potential for significant errors depending on the chosen numerical methods. There are also references to specific algorithms and their limitations, but no consensus on a singular approach is reached.

alyx_vance
Messages
7
Reaction score
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
Just a quick note for now. See http://www.iers.org/nn_11216/IERS/EN/Publications/TechnicalNotes/tn36.html,
particularly chapters 10 and 11.
 
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.
 
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.
 
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.
 
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
 
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!
 
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.
 

Similar threads

  • · Replies 62 ·
3
Replies
62
Views
7K
  • · Replies 19 ·
Replies
19
Views
4K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 10 ·
Replies
10
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K