Each particle is followed with its own integration step - an essential feature when the dynamical times of different particles vary a lot. A complete description is given in: S.J. Aarseth, "Multiple Time Scales", ed. U.J. Brackhill & B.I. Cohen, pp377. Orlando: Academic Press. (1985).
An important input parameter to the program is the accuracy parameter eta (see also eta= below). The timestep, dt, chosen for a given particle is related to the force, F, and its time derivatives by dt = sqrt(eta * F / (d2Fdt2)), which is a slight modification of the criterion given by Aarseth in the above mentioned reference (but see also BUGS below on academic cases like the figure8 orbit).
A typical value of eta = 0.02 usually conserves the energy better than one part in 10000 over one crossing time, in the absence of close encounters.
nbody00 is the C version of nbody0, based on the f2c translated code (and hence will look odd and ugly in places). It has more debug output (debug=1 and higher) and also fixes problems with orbits like the Figure8 orbit (see BUGS below).
Close encounters are not treated in any special way. See any of the modified versions of the Aarseth code (nbody2(1NEMO) ) or in case regularization is needed (see also newton0_reg in: newton0(1NEMO) ).
Timesteps are not recomputed until the current timestep has expired.
A side-effect of the variable and particle-unique timesteps is that the final snapshot will not be exactly identical for two runs with different choices of deltat.
In order to save time, all calculations in the fortran code (nbody0.f) can be done in single precision. A different version of nbody0.f is needed in this case. See code comments labeled ‘‘SED’’.
A C version is also available, as nbody0.c, though the Makefile needs the target nbody00 to install it. The user interface is as that of nbody0, except the keyword f3dot= was added.
nbody0 has a simple version of the time step criterion, which can fail in "academic" situations. For example, for the nice symmetric "figure8 orbit" (see $NEMODAT/figure8.dat), the integration will fail since the timestep for the 3rd particle blows up. Interestingly enough, some compilers (e.g. gnu) will happily work around this if optimization is turned on, but fail with pure debugging (OPT=-g) since only in this case the expression will compute as exactly 0.
The FORTRAN I/O code uses 10.NMAX double precision and 20.NMAX real storage units for a maximum compiled number of NMAX particles. On most machines this adds up to 160.NMAX bytes.
The C I/O code allocates space dynamically; and through limitations of the fortran code, a maximum of 100.NMAX double’s are needed, which means 400.NMAX bytes.
nbody0 Binney & Tremaine’s toy version, with NEMO interface nbody1 variable timestep; runbody1 nbody2 with Ahmad-Cohen scheme - (see also Benz et al, 1997); runbody2 nbody3 XXX nbody4 ... for HARP nbody5 with regularization handling triples & binaries nbody6 ... for new parallel machine nbody7 ... secret
NEMO/src/nbody/evolve/aarseth/nbody0 official source code within NEMO NEMO/usr/aarseth/ SJA’s other nbodyX versions (not all exported)
Binney, J. & Tremaine, S. Galactic Dynamics. Princeton Unversity Press (1987), pp678.
S.J.Aarseth, 1972, p.373 in: "Gravitational N-Body Problem", IAU Colloquium #10, M.Lecar (Ed.), Reidel, Dordrecht.
S.J.Aarseth, 1985, p.377 in: "Multiple Time Scales", U.J. Brackbill & B.I. Cohen (Eds.), Academic Press, Orlando.
S.J. Aarseth, 2003, "Gravitational N-Body Simulations : Tools and Algorithms" (Cambridge Univ. Press).
30-jun-89 V1.0 created + NEMO interfaces to fortran source PJT 3-jul-89 V1.1 mods to f2c interface, name of keywords PJT 24-jan-90 V1.2 all in double precision PJT 15-nov-91 fixed up pure nbody0_ff version PJT 20-may-92 -- also made the C (f2c) version available PJT 2-apr-97 documentation updated for NEMO 2.4 PJT 6-aug-97 V1.3 added options= PJT 11-feb-98 V1.3a fixed array index bug for higher order term PJT 21-jan-00 V1.4 added reset= to fix small deltat problem/bug PJT 24-feb-04 V1.5 documented the academic figure8 orbit problem, fixed in nbody00 PJT
Table of Contents