Table of Contents

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).

**in=***in_name*- Input file in
*snapshot(5NEMO)*format. Depending on how**nbody0**was compiled, other input formats are supported. [no default]. **out=***out_name*- Output file in snapshot format [no default].
**eta=***value*- Accurracy parameter, which automatically
determines the integration step. For small enough values of
**deltat**the Heisenberg principle applies and the accuracy is determined by the integration step itself! [0.02]. **deltat=***value*- Time interval of a major output. Although
the timestep is determined from
**eta**, the accurracy parameter, for small enough values of**deltat=**this parameter will determine the integration step, and hence accuracy. [Default: 0.25]. **tcrit=***value*- Final integration time [2.0].
**eps=***value*- Gravitational softening length [0.05].
**reset=t|f**- Selects if
the integration time of the next particle to be advanced be reset to the
requested output time if that preceded the integration time (see
**deltat=**). This is highly recommended, as for high output frequencies (small**deltat=**cf. the*eta*-derived timestep*dt*) [t]. **f3dot=t|f**- Use higher order terms to
determine the timestep from
*eta*. In the determination of the timestep a simplified formulae using just F and F2DOT is used, which is what the original BT87 code uses. By setting this keyword higher order terms F3DOT (and also FDOT) are used, which mimic the behavior of*nbody1(1NEMO)*. This keyword was introduced to integrate nice orbits like the Figure8 orbit, in which both F and FDOT were 0 for the central particle. [f]. **options=****step**- Miscellaneous
control options, specified as a comma separated list of keywords. Currently
implemented are:
**step**, outputs the current timestep per particle in the*Aux*array of a*snapshot(5NEMO)*. Default: none.

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.

nbody0Binney & Tremaine’s toy version, with NEMO interface nbody1variable timestep; runbody1 nbody2with Ahmad-Cohen scheme - (see also Benz et al, 1997); runbody2 nbody3 XXX nbody4... for HARP nbody5with regularization handling triples & binaries nbody6... for new parallel machine nbody7... secret

N, ETA, DELTAT, TCRIT, EPS2(though note the softening EPS is entered in the square value). This is followed by

NEMO/src/nbody/evolve/aarseth/nbody0official 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, 1999. "From NBODY1 to NBODY6: The Growth of an Industry" http://adsabs.harvard.edu/abs/1999PASP..111.1333A

S.J. Aarseth, 2003, "Gravitational N-Body Simulations : Tools and Algorithms" (Cambridge Univ. Press).

30-jun-89V1.0 created + NEMO interfaces to fortran sourcePJT 3-jul-89V1.1 mods to f2c interface, name of keywordsPJT 24-jan-90V1.2 all in double precisionPJT 15-nov-91fixed up pure nbody0_ff versionPJT 20-may-92-- also made the C (f2c) version availablePJT 2-apr-97documentation updated for NEMO 2.4PJT 6-aug-97V1.3 added options=PJT 11-feb-98V1.3a fixed array index bug for higher order termPJT 21-jan-00V1.4 added reset= to fix small deltat problem/bugPJT 24-feb-04V1.5 documented the academic figure8 orbit problem, fixed in nbody00PJT 9-feb-19added some docs on nbody0h4PJT