GalacticDynamicsExamples/06_plummer_intermediate_betaadd84cc60282main
06_plummer_intermediate_beta
README
Example 6: Plummer model with arbitrary anisotropy
In this example, the mass distribution again follows a Plummer model. However, now, the velocity distribution is generated so that it satisfies the Jeans Equation for arbitrary (constant) values of the anisotropy parameter "beta" seen in class: beta = 1 - (sigma_phi^2 + sigma_theta^2)/2sigma_r^2
Recall that: beta = -inf: purely circular orbits beta = 0: isotropic (ergodic) orbits beta = 1: purely radial orbits
The first case has already been tested in the previous example. Here, we can play around with values in the interval (-inf,1].
Running the example & visualizing the output
The two examples shown in the lecture, along with the commands used to generate the corresponding IC file are:
- beta = 0
python makeIC.py
- beta = 0.875
python makeIC.py -beta 0.875
By default, the ICs contain 256k particles. This number can be changed with the -N argument. The makeIC script also prints an estimate of the characteristic time of the system, chosen as the period of a circular orbit at the Plummer radius a. With the default parameters, the system is evolved for about six characteristic periods.
SWIFT can then be run on the ICs either in self-gravity mode:
bash run.sh
or in external gravity mode:
bash run_external_gravity.sh
For reference, here are the exact commands used to produce the self-gravity beta=0.875 movie:
python makeIC.py -beta 0.875 mkdir snap bash run.sh python ../visualize.py snap/snapshot_*.hdf5 -shift 10 -lim 5 -nbins 800 -frsp 0.4 -interp bilinear -fps 50 --savefilm mv film.mp4 06_plummer_beta_0.875.mp4
Plot the Velocity Dispersion
To see how the dispersion of the different components of the velocity evolves with time, the script dispersion_profile.py is provided. By default, when given a set of snapshots, the script will produce two plots corresponding to the radial and tangential components of the velocty dispersion against radius, for each snapshot. It achieves this by placing the particles in radial bins, projecting their velocities onto r and t components and computing the variance. Assuming default parameters were used, the following produces a comprehensive plot of the time-evolution:
python dispersion_profile.py snap/snapshot_0*00.hdf5 -Rmax 7
To save the plot, append --saveplot to the command.
Plot the Density profile
To quantify how the initially spherical, Plummer mass distribution evolves, the density_profile.py script is used to plot the mass density against radius, for a set of snapshot files (as above). To use the script, run e.g.
python density_profile.py snap/snapshot_0*00.hdf5
To save the plot, append --saveplot to the command.