# Comparative analysis of methods for calculating the gravitational force of particles in numerical simulation of the N-body problem

### Abstract

One of the main problems of modern codes for solving the N-body problem is their great similarity. The immediate consequence of this is that the usual method of checking the simulation results by comparing independent approaches is hardly possible. The requirement for accurate calculation of gravitational force does not imply the need to use a unique approach. An approximate calculation of gravitational forces between N interacting particles can be used. For example, an approximate method with high accuracy is the fast multipole method (FMM) that requires only operations instead of to calculate the forces all N particles.FMM groups particles into spatially bounded cells and uses intercellular interactions to approximate forces at any position in the receiver cell using the Taylor extension obtained from the multipole extension of the original cell. Using the error estimate of this process it is possible to minimize the calculations while obtaining the relative errors N≳105. The article provides a brief analysis of N-body modeling methods and shows that the FMM approximates the calculation of mutual forces between particles and the problem under consideration is formulated much easier than, for example, in the case of softened gravity.

### References

1 J.J. Binney, and S. Tremaine, Galactic dynamics. 2nd ed. (Princeton University Press, Princeton, 2008), 920 p.

2 W. Dehnen, J.I. Read, Eur. Phys. J. Plus., 126, Article ID 55 (2011).

3 M. Trenti, and P. Hut, arXiv:0806.3950v1 [astro-ph], 13, 24 Jun (2008).

4 J. Barnes, and P. Hut, Nature, 324, 446–449 (1986).

5 J.E. Barnes, J of Computational Physics, 87 (l), 161-170 (1990).

6 V.A. Vshikov, V.E. Malyshkin, A.V. Snytnikov, V.N. Snytnikov, Sibirskiy zhurnal vychislitel'noy matematiki, 6, 144-157 (2003). (in Russ)

7 T. Sasaki, and N. Hosono, The Astrophysical Journal, 856 (2), 175 (2018).

8 T. Zhang, S. Liao, M. Li, and L. Gao, MNRAS, 487 (1), P.1227–1232 (2019).

9 W. Dehnen, Computational Astrophysics and Cosmology, 1, Article No 1 (2014).

10 L. Greengard, and V. Rokhlin, J. Comput. Phys., 73, 325–348 (1987).

11 H. Cheng, L. Greengard, and V. Rokhlin, J. Comput. Phys., 155, 468–498 (1999).

12 W. Dehnen, Astrophys. J., 536, L39-L42 (2000).

13 W. Dehnen, J. Comput. Phys., 179, 27-42 (2002).

14 E. Gaburov, S. Harfst, and S. Portegies Zwart, New Astron., 14 (7), 630–637 (2009).

15 N.A. Henden, E. Puchwein, S. Shen, and D. Sijacki, MNRAS, 479, 5385-5412 (2018).

16 L. Nyland, M. Harris, and J. Prins, N-body simulations on a GPU, In: ACM Workshop on General-Purpose Computing on Graphics Processors, C37 (2004).

17 J.A. Anderson, C.D. Lorenz, and A. Travesset, J of Computational Physics, 227 (10), 5342 –5359 (2008).

18 A. Gualandris, S. Portegies Zwart, and A. Tirado-Ramos, Parallel Computing, 33 (3), 159–173 (2007).

19 S. Harfst, A. Gualandris, D. Merritt, R. Spurzem, S. Portegies Zwart, and P. Berczik, New Astronomy, 12, 357–377 (2007).

20 S. Harfst, A. Gualandris, D. Merritt, and S. Mikkola, MNRAS, 389, 2-12 (2008).

2 W. Dehnen, J.I. Read, Eur. Phys. J. Plus., 126, Article ID 55 (2011).

3 M. Trenti, and P. Hut, arXiv:0806.3950v1 [astro-ph], 13, 24 Jun (2008).

4 J. Barnes, and P. Hut, Nature, 324, 446–449 (1986).

5 J.E. Barnes, J of Computational Physics, 87 (l), 161-170 (1990).

6 V.A. Vshikov, V.E. Malyshkin, A.V. Snytnikov, V.N. Snytnikov, Sibirskiy zhurnal vychislitel'noy matematiki, 6, 144-157 (2003). (in Russ)

7 T. Sasaki, and N. Hosono, The Astrophysical Journal, 856 (2), 175 (2018).

8 T. Zhang, S. Liao, M. Li, and L. Gao, MNRAS, 487 (1), P.1227–1232 (2019).

9 W. Dehnen, Computational Astrophysics and Cosmology, 1, Article No 1 (2014).

10 L. Greengard, and V. Rokhlin, J. Comput. Phys., 73, 325–348 (1987).

11 H. Cheng, L. Greengard, and V. Rokhlin, J. Comput. Phys., 155, 468–498 (1999).

12 W. Dehnen, Astrophys. J., 536, L39-L42 (2000).

13 W. Dehnen, J. Comput. Phys., 179, 27-42 (2002).

14 E. Gaburov, S. Harfst, and S. Portegies Zwart, New Astron., 14 (7), 630–637 (2009).

15 N.A. Henden, E. Puchwein, S. Shen, and D. Sijacki, MNRAS, 479, 5385-5412 (2018).

16 L. Nyland, M. Harris, and J. Prins, N-body simulations on a GPU, In: ACM Workshop on General-Purpose Computing on Graphics Processors, C37 (2004).

17 J.A. Anderson, C.D. Lorenz, and A. Travesset, J of Computational Physics, 227 (10), 5342 –5359 (2008).

18 A. Gualandris, S. Portegies Zwart, and A. Tirado-Ramos, Parallel Computing, 33 (3), 159–173 (2007).

19 S. Harfst, A. Gualandris, D. Merritt, R. Spurzem, S. Portegies Zwart, and P. Berczik, New Astronomy, 12, 357–377 (2007).

20 S. Harfst, A. Gualandris, D. Merritt, and S. Mikkola, MNRAS, 389, 2-12 (2008).

Published

2020-06-24

How to Cite

IMANBAYEVA, A.K.; TUREZHANOV, S.K.; SAPARBEKOVA, G.A..
Comparative analysis of methods for calculating the gravitational force of particles in numerical simulation of the N-body problem.

**Recent Contributions to Physics (Rec.Contr.Phys.)**, [S.l.], v. 73, n. 2, p. 14-21, june 2020. ISSN 2663-2276. Available at: <https://bph.kaznu.kz/index.php/zhuzhu/article/view/1272>. Date accessed: 26 oct. 2020. doi: https://doi.org/10.26577/RCPh.2020.v73.i2.02.
Section

Theoretical Physics. Nuclear and Elementary Particle Physics. Astrophysics