This HTML automatically generated with rman for NEMO
Table of Contents


mkplummer - construct a Plummer model


mkplummer [parameters=values...]


mkplummer constructs an N-body realization of a Plummer model, with a spatial or mass based cut-off, after which it (optionally) performs a coordinate transformation to the center-of-mass coordinate system. The data are then written into a file snap-file, in a standard N-body snapshot(5NEMO) format. The model is constructed in VIRIAL units (M=G=-4E=1, with E the total energy), and finite spatial extent which can be regulated by specifying mfrac or rfrac or using their default values. The distribution function of a Plummer model is spherically symmetric and isotropic, and is a polytrope of index n = 5. See also Aarseth et al. (1974) and Plummer (1911).

There is also an implementation in Dehnen’s falcON suite: mkplum(1NEMO)

For more advanced Plummer models, see mcluster(1NEMO) .


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.
Output data is written into snapfile, in standard snapshot(5NEMO) format.
No default
Number of particles nobj in N-body snapshot realization of the Plummer model.
No default.
inner core mass fraction within which no stars will be populated.
[Default: 0]
mass fraction of the (otherwise infinitely extended) Plummer model; see rfrac immediately below Note that the total mass is still normalized to 1.
[Default: rfrac=22.8042468]
radius fraction of the (otherwise infinitely extended) Plummer model. If mfrac = 1.0 then particles will be sprinkled in all over space. If mfrac < 1.0 or rfrac > 0.0 then each particle is constrained to lie within both the radial and (cumulative) mass bound. For example, if rfrac( mfrac ) > rfrac then rfrac is the limiting factor, but if rfrac( mfrac ) < rfrac then mfrac limits the extent of the Plummer realization. Note: specifying either value may have no effect if the default value of the other parameter is still the limiting factor; Beware! (Default: mfrac=0.999; rfrac=22.8042468 , chosen so that the cumulative mass at rfrac is mfrac).
Default: ....
seed for the random number generator. A value of 0 (the default) will be converted into a unique new value using UNIX’s clock time, in seconds since 1970.0). See also xrandom(1NEMO) for more options.
[Default: 0]
Time at which the snapshot applies
[Default: 0.0]
Reset center of mass to zero?
[Default: t].
A scale factor or scale to virial units (M=G=-4E=1). Use -1 for virial units (see also VIRIAL UNITS below), and 1 to get a model in structural (natural) units. Note: large scale factors means small systems with large velocity disperson.
[Default: -1].
Level of quit start. 0 is noisy, 1=somewhat quiet, 2=more quiet. See "QUIET START" below
[Default: 0].
Identification of the mass spectrum. It is normally only a function of mass, so n(m) will suffice. If nothing specified, all stars will have the same mass (total mass M=1).
[Default: not used].
Expression for the mass-spectrum. In addition to the mass m from the massname it may contain any variables contained in the masspars to be specified next.
[Default: pow(m,p)].
List of parameters and their values. They can be used by name in the massexpr specified before.
[Default: p,0.0].
Valid massrange. A lower and higher cutoff must be supplied. The massrange has arbitrary units, since all masses will be rescaled to set the total mass M=1. .br [Default: 1,1].
Optional headline, which is written as the first item in the snapshot file, the next item being the snapshot itself.
[Default: not used].
Number of models to generate. Although mostly meant for benchmarks, generating more then 1 model can be useful to process very large snapshots (that normally won’t fit in memory) in a serialized fashion. See also snapsplit. Most NEMO programs will
[Default: 1]
The processing mode, purely for debugging benchmarks. 0=no data written. 1=data written, but no extra analysis. 2=data written, and extra analysis done.
[Default: 1]

Virial Units

The scale length of a Plummer sphere in virial units is 3.pi/16 ~ 0.589. As an example the following two commands should plot the same "rotation" curve:

mkplummer - 10000 | radprof - tab=t | tabplot - 1 3 0 2 0 1 yapp=1/xs
rotcurves plummer ’0,1,3*pi/16’ xrange=0:2 yrange=0:1 yapp=2/xs

Quiet Start

For small N-body systems it can easily happen that small random fluctuations cause a unacceptabel large deviation from an ideal Plummer sphere. One way to achieve more "quiet" initial conditions is by positioning the particles more uniformly in their 1/N mass shells, instead of uniformly filling the space between 0 and 1. This is controlled by the quiet=1 setting. An even more quiet start can be achieved by placing the particles on exactly the radius compatible with its mass fraction, this is achieved with the the quiet=2 setting.

In this example you can clearly see the difference between the radii selected:

mkplummer - 10 quiet=0 zerocm=f | snapsort - - r | snapprint - r | tabplot - 0 1 line=1,1 point=2,0.1
mkplummer - 10 quiet=1 zerocm=f | snapsort - - r | snapprint - r | tabplot - 0 1 line=1,1 point=2,0.1
mkplummer - 10 quiet=2 zerocm=f | snapsort - - r | snapprint - r | tabplot - 0 1 line=1,1 point=2,0.1

Important to note that with zerocm=f the center of mass will drift, while the "mathematical center" was placed at the origin. This will counter the quietness, if you will.


A non-delta function mass-spectrum will not create a properly virialized system yet. See snapvirial(1NEMO)

For very large (>1000) ratio in the mass ranges the spline interpolation, used in frandom(3NEMO) , can fail using a valid [0,1] range.


mkplummer can also be used to create a plummer sphere with a mass spectrum, e.g. a Salpeter mass spectrum with

mkplummer salpeter.dat 10000 massname=’n(m)’ massexpr=’pow(m,p)’ masspars=p,-2.35 massrange=0.1,10

Another method to create a Plummer sphere is by using the Osipkov-Merritt tables in NEMO, e.g.

plummer plum.dat ntab=1024
mkommod plum.dat plum.snap nbody=10000

or in ZENO the new General Spherical Profile:

plumsnap plum1.snap

plumgsp plum.gsp gsprealize plum.gsp plum.snap zerocm=true snapcopy plum.snap


with a note that ZENO files may need an extra snapcopy(1NEMO) to be compatible with NEMO snapshot(5NEMO) files.


The default benchmark (see Benchfile) creates a 10,000,000 snapshot in double precision, with and without writing to a local file:

cd $NEMO/nemo/src/nbody/init/

make -f Benchfile bench0 bench1


/usr/bin/time mkplummer . 10000000 /usr/bin/time mkplummer bench1.snap 10000000

with some sample CPU for bench0: xps13 3.1s or 171 MB/s
t480 4.9s or 72 MB/s
the time difference betweeen bench0 and bench1 can be interpreted as the time needed to write 535MB (for 10M particles)



See Also

mkpolytrope(1NEMO) , snapvirial(1NEMO) , mkplummer(3NEMO) , snapmass(1NEMO) , snapsplit(1NEM0) , mkplum(1NEMO) , mcluster(1NEMO) , xrandom(3NEMO)

H.C.Plummer (1911), MNRAS, 71, 460.

S.J. Aarseth, M. Henon and R. Wielen (1974), Astron. and Astrophys. 37, p. 183.

A.H.W. Kuepper, Th. Maschberger, P. Kroupa and H. Baumgardt, 2011, MNRAS, 417, 2300 (McLuster)

Arnold et al. (2022) - -


@ads 1974A&A....37..183A


Piet Hut (Peter Teuben)


~/src/nbody/init    mkplummer.c


23-Apr-87    Version 1.0: created             PIET
10-Jun-88    Version 1.1: created             PIET
xx-xxx-88    V1.2: zerocm keyword added    PJT
xx-Mar-89    V2.0: full new snapshot version    + doc PJT
15-nov-90    V2.3: mass-spectrum and cleanup    for NEMO 2.x    PJT
6-jun-96    V2.5d: report total mass before scaling      PJT
21-mar-04    V2.7: added mlow=    PJT+NCM
11-apr-05    V2.8: added nmodel=    PJT
15-sep-10    V2.9: clarified rfrac and allow rfrac<0        PJT
2-dec-2017    documented mcluster    PJT
29-mar-2021    benchmark    PJT
25-sep-2023    describe quiet starts    PJT
1-apr-2024    experimenting with how to place defaults    PJT

Table of Contents