Gravitational N-Body Simulation

Run simple direct gravitational N-body simulations. The package can access different external N-body simulators (e.g. GADGET-4 by Springel et al. (2021) ), but also has a simple built-in simulator. This default simulator uses a variable block time step and lets the user choose between a range of integrators, including 4th and 6th order integrators for high-accuracy simulations. Basic top-hat smoothing is available as an option. The code also allows the definition of background particles that are fixed or in uniform motion, not subject to acceleration by other particles.


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("nbody")

1.41 by Danail Obreschkow, 2 years ago


Browse source code at https://github.com/cran/nbody


Authors: Danail Obreschkow [aut, cre]


Documentation:   PDF Manual  


GPL-3 license


Imports magicaxis, Rcpp

Linking to Rcpp


See at CRAN