White paper for md.sm -- Steven Janowiecki, 2-Dec-2007 md -- initialise a rotating exponential disk of particles General Description This code generates a (2D) random distribution of particles that falls off exponentially from the center, and has a velocity distribution corresponding to circular orbits. It also adds a dispersion into the rotation velocities, calibrated to match the Milky Way's dispersion, in order to have a stable-rotating galaxy. Inputs At the beginning of the code, the following parameters must be defined: h - scale length of disk galaxy (radially) cutcore - radius of center to be emptied of particles n_part - number of particles to sample from this distribution v0 - mean circular velocity for the rotating disk outfile - destination file for the x,y,z,vx,vy,vz of each particle Method/process Spatial-distribution: The particle distribution is the first computation. Using a random-number generator and an exponential function, 100,000 particles are distributed in r^2-space. The particles within cutcore of the center are eliminated to avoid problems later on with particles near the center of the potential. From the resulting particles, the first n_part of them are drawn to be kept. Each particle is then given a random phi angle, evenly sampled from 0 to 2pi. Finally, these r and phi coordinates are converted into x and y coordinates and displayed on screen. Also displayed (later on) is the surface profile of the galaxy, binned over annuli, just to be sure that the galaxy profile is exponential. Velocity-distribution: The circular velocity is set with v0, and the v_x and v_y components are computed for each particle. The radial velocity dispersion is matched with the Milky Way, and is also dependent on the circular velocity and scale length. The tangential dispersion is related to the radial dispersion by a factor of 0.6. These dispersions are Gaussian distributed about zero, and added back into the x and y velocities appropriately. The resulting velocities are also plotted to the user's satisfaction. NOTE: this code creates all particles in a perfectly flat disk, all with z=0, and without any z-velocity components. Outputs The code outputs all n_part particles in a file set by outfile. It is a simple text file with 6 columns (x,y,z,vx,vy,vz) and n_part rows. It also can save the graphs generated when you initialise the galaxy. Author: Steven Janowiecki: spj4@cwru.edu