HTML automatically generated with rman
Table of Contents


potcode - non-selfconsistent N-body code with options to dissipate/diffuse orbits


potcode [parameter=value] ...


potcode is an equal-timestep N-body integrator which is not self-consistent. The forces and potential are obtained from a standard potential descriptor, given by the three keywords potname=,potpars=,potfile= (See also potential(3,5NEMO)). If the potential is conservative, the energy will (should) be conserved, but the user is of course free to pick any potential.

In addition to integrating the equations of motion, the particles are allowed to loose some (eta) of their random energy (smoothed over a certain ‘‘box’’ size (cell)), and turn it into mean orbital motion.

Orbits can also be diffused: each timestep the velocity vector can be rotated over the randomly gaussian distributed angle (sigma).

A special integration mode (mode=-1) will advance particles assuming their orbits are epicycles, and launched with velocities deviating from the angular velocity consistent with rotation. The supplied potential should be axisymmetric and numerical derivatives are used to calculate the angular, radial and vertical frequencies such that the orbital motions can be solved for analytically. from their guidance center.


The following parameters are recognized in order; they may be given in any order if the keyword is also given. Use --help to confirm this man page is up to date.
Initial conditions will be read from in-file in snapshot format [default: none - but is required].
If given, results are written to out-file in snapshot format [default: empty, no snapshot output file produced].
name of file of potential(5NEMO) descriptor [default: harmonic].
List of parameters to the potential descriptor. The first parameter must be the pattern speed in the x-y plane, although rotating frames of reference are not yet supported. The remaining parameters are used by the _inipotential() routine in the potential descriptor. [default: none - let them be defined by routine itself].
name of an optional datafile to the potential descriptor. This might be an N-body snapshot or list of spline fit coefficients etc. [default: none].
If given, the system state will be saved in state-file after each timestep. Useful for some recovery after system crashes.
Inverse time-step, to be used with the time integrator. [Default: 64.0 (64 steps per unit time)].
Integration modes, must be a number:
0=Euler (kick and drift at same time)
1=PC (Predictor Corrector) algorithm, 
2=modified PC algorithm, 
3=Runge-Kutta (JEB modified)
4=4th order Runge-Kutta.
6=modified Euler (kick done after drift)
-1=special epicyclic motion, full motion)
-2=special epicyclic motion, shows only epi motion
[default: 3].
Time to stop integration in N-body model units. Default is 2.0.
Frequency of major N-body data outputs. Default is 4.0 (4 frames per unit time).
Frequency of minor diagnostic outputs. Default is 32.0 (32 diagnostic measurements per unit time).
Miscellaneous control options, specified as a comma-separated list of keywords. Currently recognized keywords are: reset_time: when reading initial data, set tnow to zero; new_tout: when restarting, set new output times; mass, phi, acc: output mass, potential, acceleration data with major data outputs.
Fraction of random energy that is dissipated [Default: 0.0].
Cell size in which dissipation is performed after every timestep. Dissipation is current performed on a cartesian grid, in which cells are square (2D) or a cube (3D) . [Default: 0.1].
Maximum size of the "box" (actually cube) within which dissipation is performed. If a negative number is given, the box is allow to grow as large as is needed, though this may consume a lot of memory. Default: -1, i.e. box can grow indefinite.
The ratio of diffusion angle to rms velocity dispersion in a cell. If fheat>0, each time dissipation is applied, the rms velocity dispersion in a cell is computed, and a diffusion angle computed. The velocity vector of each particle is then rotated with a gaussian distributed value with rms fheat*velsig. This in effect gives a dissipation dependant heating source. See also sigma=, which is position independant. [Default: 0].
Diffusion angle, gaussian distributed with this sigma, about which each velocity vector is rotated after each timestep. [Default: 0].
Random number seed, only used when diffusion (sigma=) is used. 0 must be used to get the random seed from the time of the day. [Default: 0].
Identifying text for this run. Default: not used.


RK, PC and PC1 don’t work in rotating potential - use EULER or RK4.

Since cell is a fixed number throughout the execution, is doesn’t deal well with systems who’s lenght-scale changes, in particular, expanding systems will allocate more and more space to hold the dissipation grid.


Various schemes of dissipation can be invoked. Here’s one, see also Lin & Pringle (1974):

For each cell the relative position and velocity for each particle within that cell is computed:

        R   =  r  - <r >
         i      i     i
        V   =  v  - <v >
         i      i     i
after which the dimensionless viscosity parameter ’alpha’ controls the new velocity for each particle after a timestep:
                                 < R  x  V >
                                    j     j
        u  =  <v>  - alpha  R  x ------------   +  (1-alpha) V
         i      i            i                                i
                                 < R  .  R >
                                    j     j  

See Also

newton0(1NEMO) , hackcode1(1NEMO) , hackcode3(1NEMO) , nbody0(1NEMO) , snappot(1NEMO) , snapshot(5NEMO) (mode=-1)


Peter Teuben

Update History

5-feb-89    V1.0 written      PJT
3-apr-90    V2.0 new potential(5), renamed keywords    PJT
9-jun-92    V3.0 rotating pattern are now allowed - made rk4    PJT
17-jun-92    V3.1 fix energy conservation in ’dissipation’    PJT
19-jun-92    V3.2 added diffusion    PJT
6-oct-92    V4.0 added rmax=, made options= same as hackcode1    PJT
24-oct-92    V4.1 added fheat=            PJT
5-mar-03    V5.0 added mode=-1 to "integrate" orbits numerically on epicyclic orbits    PJT
6-jul-03    (V5.1) compute guiding center    PJT/RPO
12-aug-09    V5.1 added leapfrog and modified euler    PJT
2-jul-21    V5.2 fheat added, but not implemented    PJT

Table of Contents