Table of Contents


nbody_sh1 - hermite integrator with shared but variable time step


nbody_sh1 [-h] [-d dt] [-e dte] [-o dto] [-t t1] [-i t0] [-x]


nbody_sh1 is an N-body integrator with a shared but variable time step (the same for all particles but its size changing in time), using the Hermite integration scheme.

See Also

Hut, P., Makino, J. & McMillan, S., 1995, Astrophysical Journal Letters 443, L93-L96.


 usage: nbody_sh1 [-h (for help)] [-d step_size_control_parameter]
                  [-e diagnostics_interval] [-o output_interval]
                  [-t total_duration] [-i (start output at t = 0)]
                  [-x (extra debugging diagnostics)]
"step_size_control_parameter" is a coefficient determining the the size of the shared but variable time step for all particles

"diagnostics_interval" is the time between output of diagnostics, in the form of kinetic, potential, and total energy; with the -x option, a dump of the internal particle data is made as well

"output_interval" is the time between successive snapshot outputs

"total_duration" is the integration time, until the program stops

Input/output are read/written from/to the standard i/o streams. Since all options have sensible defaults, the simplest way to run the code is by only specifying the i/o files for the N-body snapshots:

            nbody_sh1 < > data.out
The diagnostics information will then appear on the screen. To capture the diagnostics information in a file, capture the standard error stream as follows:
            (nbody_sh1 < > data.out) >& data.err
Note: if any of the times specified in the -e, -o, or -t options are not an an integer multiple of "step", output will occur slightly later than predicted, after a full time step has been taken. And even if they are integer multiples, round-off error may induce one extra step.

External Data Format

The program expects input of a single snapshot of an N-body system, in the following format: the number of particles in the snapshot n; the time t; mass mi, position (x,y,z) and velocity (vx,vy,vz) for each particle i, with position and velocity given through their three Cartesian coordinates, divided over separate lines as follows:
                      m1 x1 y1 x1 vx1 vy1 vz1
                      m2 x2 y2 x2 vx2 vy2 vz2
                      mn xn yn xn vxn vyn vzn
Output of each snapshot is written according to the same format.

Internal Data Format

The data for an N-body system is stored internally as a 1-dimensional array for the masses, and 2-dimensional arrays for the positions, velocities, accelerations and jerks of all particles.


The external dataformat can in NEMO be generated by snapprint(1NEMO) and converted back to snapshot(5NEMO) format using tabtos(1NEMO) , as shown in the following example:
    mkplummer p100 nbody=100
    snapprint p100 m,x,y,z,vx,vy,vz header=t newline=t >
    nbody_sh1 < | tabtos - nbody,time m,x,y,z,vx,vy,vz nbody=100
or here in more traditional unix pipe example the famous figure 8 orbit:
    snapprint $NEMODAT/figure8.dat m,x,y,z,vx,vy,vz header=t newline=t |\
          nbody_sh1 -i -o 0.01 -t 20 |\
          tabtos - figure8.out nbody,time m,x,y,z,vx,vy,vz nbody=3
    snapplot figure8.out trak=t
    snapplot figure8.out trak=t xvar=x  yvar=y
    snapplot figure8.out trak=t xvar=x  yvar=vx
    snapplot figure8.out trak=t xvar=x  yvar=vy
    snapplot figure8.out trak=t xvar=y  yvar=vx
    snapplot figure8.out trak=t xvar=y  yvar=vy
    snapplot figure8.out trak=t xvar=vx yvar=vy
    snapprint figure8.out x,y,vx,vy |\
        tabplot - 1,1,1,2,2,3 2,3,4,3,4,4 -1.6 1.6 -1.6 1.6 color=2,3,4,5,6,7



See Also

snapprint(1NEMO) , tabtos(1NEMO) , snapshot(5NEMO) ,


jan-2002    Version 1:   Piet Hut, Jun Makino

Table of Contents