The Plummer Model may be useful to represent stellar systems such as globular clusters, dwarf galaxies, or to serve as a toy model in N-body simulations containing these types of simple spherical distribution of particles. This python script generates initial conditions in the usual Gadget system of units (check the parameters file) for a Plummer Sphere. There are three possible output formats: txt, GADGET-2 binary, HDF5.
- os
- sys
- struct
- numpy
- ConfigParser
Simply edit the parameters in the plummer_params.ini
file as you desire, then run ic.py
python ic.py
The directory InitialConditions
will be create with the output file within it.
- The
snapwrite.py
module is exactly the same as in Elvis Mello's adaptation for python 3 of Rafael Ruggiero's clustep, necessary in order to write the output in the gadget2 binary format or hdf5. - In the GADGET-2 format, all particles are set to the particle type 'stars'. You can change this by editing this line of code accordingly.
- The overall structure of
ic.py
is basically the same as clustep's. Therefore I plan on creating a more general software which would be able to generate initial conditions for many different profiles (for instance, implementing King's model into the code should be an easy task).