## Abstract

Cosmological N-body simulations are done on massively parallel computers. This necessitates the use of simple time integrators and, additionally, of mesh-grid approximations of the potentials. Recently, Adamek et al. (Nat Phys 12:346, 2016), Barrera-Hinojosa and Li (GRAMSES: a new route to general relativistic *N*-body simulations in cosmology—I. Methodology and code description, 2019) have developed general relativistic N-body simulations to capture relativistic effects mainly for cosmological purposes. We therefore ask whether, with the available technology, relativistic effects like perihelion advance can be detected numerically to a relevant precision. We first study the spurious perihelion shift in the Kepler problem, as a function of the integration method used and then as a function of an additional interpolation of forces on a two-dimensional lattice. This is done for several choices of eccentricities and semi-major axes. Using these results, we can predict which precisions and lattice constants allow for a detection of the relativistic perihelion advance in N-body simulation. We find that there are only small windows of parameters—such as eccentricity, distance from the central object and the Schwarzschild radius—for which the corrections can be detected in the numerics.

This is a preview of subscription content, log in to check access.

## Notes

- 1.
We use “perihelion” even if the central mass is not the Sun.

- 2.
All positions, velocities, and the like are in \({\mathbb R}^2\).

- 3.
In units \(\mathrm{{G m}^3} \cdot M_\text {earth}^{-1} \cdot \mathrm {M}s^{-2}\).

- 4.
Due to the discretization, the angular momentum vector might not be conserved and we might have 3D motion; here, we assume that the force perpendicular to the plane of motion vanishes.

- 5.
Finite elements are of course obtained more easily on triangular lattices, but, because of requirements of large parallel computations, we study the lattice \({\mathbb Z}^2\).

- 6.
We use the standard algorithm “zeroin” of Dekker.

- 7.
For example, after 3 turns, we divide the total angle by 3, and we do not take the difference between the angle for 3 and 2 turns. Of course, errors on these points will average out somewhat.

- 8.
In this section, \(\theta \) is not the angle of the major axis, but just one of the three Euler coordinates.

## References

Adamek, J., Daverio, D., Durrer, R., Kunz, M.: Gevolution: a cosmological n-body code based on general relativity. J. Cosmol. Astropart. Phys.

**2016053**(7), 1–43 (2016a)Adamek, J., Daverio, D., Durrer, R., Kunz, M.: General relativity and cosmic structure formation. Nat. Phys.

**12**, 346 (2016b)Arnold, D.N.: Differential complexes and numerical stability. In: Tatsien, L. (Ed.) Proceedings of the International Congress of Mathematicians, Vol. I, pp. 137–157. Higher Ed. Press, Beijing (2002)

Back, A.: Runge–Kutta Behavior in the Presence of a Jump Discontinuity. (Preprint) (2005)

Barrera-Hinojosa, C., Li, B.: GRAMSES: a new route to general relativistic

*N*-body simulations in cosmology—I. Methodology and code description. arXiv:1905.08890 [astro-ph.CO]Butcher, J.C.: Coefficients for the study of Runge-Kutta integration processes. J. Aust. Math. Soc.

**3**(2), 185–201 (1963)Hairer, E., Nørsett, S.P., Wanner, G.: Solving ordinary differential equations. I. Nonstiff problems, volume 8 of Springer Series in Computational Mathematics, 2nd edn. Springer, Berlin (1993)

Hairer, E., Lubich, C., Wanner, G.: Geometric numerical integration illustrated by the Störmer-Verlet method. Acta Numer.

**12**, 399–450 (2003)Hairer, E., Lubich, C., Wanner, G.: Geometric Numerical Integration, volume 31 of Springer Series in Computational Mathematics. Springer, Heidelberg (2010). Structure-Preserving Algorithms for Ordinary Differential Equations, Reprint of the second edition (2006)

Parsa, M., Eckart, A., Shahzamanian, B., Karas, V., Zajacek, M., Zensus, J., et al.: Investigating the relativistic motion of the stars near the supermassive black hole in the galactic center. Astrophys. J.

**419**(845), 22 (2017)Preto, M., Saha, P.: On post-Newtonian orbits and the Galactic-center stars. Astrophys. J.

**703**, 1743 (2009)Springel, V.: The cosmological simulation code gadget-2. Mon. Not. R. Astron. Soc.

**364**(4), 1105–1134 (2005)Stephani, H.: Relativity: An Introduction to Special and General Relativity. Cambridge University Press (Transl. from German By M. Pollock and J. Stewart) (1982)

Teyssier, R.: Cosmological hydrodynamics with adaptive mesh refinement: a new high resolution code called ramses. Astron. Astrophys.

**385**, 337–364 (2002)Yu, H., Emberson, J., Inman, D., et al.: Differential neutrino condensation onto cosmic structure. Nature Astronomy

**1**(143), (2017)

## Acknowledgements

We thank Martin Kunz for asking questions leading to this paper, and for helpful discussions. We thank Ruth Durrer and Jacques Rougemont for helpful comments about our manuscript. We thank the referees for their very helpful comments on our paper. JPE acknowledges partial support by an ERC advanced grant “Bridges,” (Grant No. 290843_BRIDGES) and FH acknowledges financial support from the Swiss National Science Foundation (Grant No. 200020_182231).

## Author information

## Additional information

### Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Appendices

### A Newtonian and relativistic orbits

Here, first we review the equations of motion and properties of the orbits in the mechanics of Newtonian particles, and then we derive the equations for general relativistic motion. In two-dimensional polar coordinates \((r,\varphi )\), the Newton equations take the form

Writing the angular momentum per mass *l* in polar coordinates results in

Changing the variable to \(u (\varphi )= 1/ {r (\varphi )}\) gives

To obtain the relativistic perihelion advance, we repeat, for the convenience of the reader, some parts of Stephani (1982, p. 193). The Schwarzschild metric as a spherically symmetric vacuum solution reads,

where \(r_\mathrm{sch}\) is the Schwarzschild radius, defined by \(r_\mathrm{sch}= \frac{2 GM}{c^2}\), and *t* and \(r, \theta , \varphi \) are, respectively, time and spatial spherical coordinates.^{Footnote 8} To obtain geodesic equations, one starts from the classical action of massive test particle,

where \(m_o\) is the mass of the object. Applying Euler–Lagrange equation to the Lagrangian of the test particle gives four equations, in which one sees that the angular momentum is conserved. Therefore, the motion is in a plane. By simple algebra on the equations, one finds the equation of motion as

which is like Newton’s equation () plus a term which is coming from relativistic correction. We solve () to obtain the relativistic perihelion advance per period, which is well approximated by

where *a* is semi-major axis and *e* is the eccentricity of the orbit.

For Mercury, this leads to the well-known perihelion advance of 42.98 arc sec per century, or \(\sim 0.103\) arc sec per period.

### B The parameterization of orbits

To see the effect of discretization on different orbits in N-body simulations, we parameterize a general orbit with three parameters \((\Upsilon , \theta , e)\), where *e* is the eccentricity, \(\Upsilon \) is the relativistic parameter at perihelion, and \(\theta \) is the angle of semi-major axis with the lattice squares. It is important to note that these parameters are enough to explain any closed orbits in N-body simulations. Moreover, having the three parameters one could uniquely construct the mass of central object as well as the initial position and velocity of the particle.

*Relativistic parameter* The relativistic parameter \(\Upsilon = \frac{r_\mathrm{sch}}{r_\mathrm{per}}\), for a fixed mass of central object it shows the scale of the orbits and for a fixed size of the orbit it is an indicator of the mass of central object. If we assume that the mass of central object is fixed, by changing the relativistic parameter, different quantities of the orbit would scale as follows:

\(r_\mathrm{per}\) is the perihelion radius, T is the period of the orbit, and \( v_\mathrm{per} \) is the velocity of the object in the perihelion point. To rescale the orbit for the fixed central body mass and fixed eccentricity, one has to change the initial conditions as follows to obtain the new orbit:

We could of course change the central object mass instead of changing the size of the orbit while having the same relativistic parameter.

*Eccentricity* Another parameter which is important in characterizing an orbit is the eccentricity, to change the eccentricity we keep the semi-major axis length fixed and we change the positions and velocities in the perihelion point to recover the desired eccentricity for the orbits

where *e* is the new eccentricity and \(e_0\) is the reference eccentricity (in our case mercury). Note that changing eccentricity also results in changing the perihelion distance and relativistic parameter.

*Rotation* It appears that the angle between the semi-major axis and the lattice squares is an important parameter specially in the linear force interpolation. To rotate the orbit by angle \(\theta \), we can follow the coordinate transformations and start from the following initial condition to obtain the correct orbit,

In Fig. 8, we illustrate the orbits with different ellipticities, relativistic parameters, and angles obtained from numerical results.

## Rights and permissions

## About this article

### Cite this article

Eckmann, J., Hassani, F. The detection of relativistic corrections in cosmological N-body simulations.
*Celest Mech Dyn Astr* **132, **2 (2020). https://doi.org/10.1007/s10569-019-9943-z

Received:

Revised:

Accepted:

Published:

### Keywords

- Kepler orbits
- Numerical precision
- N-body simulation
- Relativistic corrections
- Cosmology