Skip to content
Snippets Groups Projects

Analyse isolated galaxy simulations and reproduce the plots from Ploeckinger et al. (arXiv)

The python routines to reproduce each figure from Ploeckinger et al. (arXiv) can be found here. For the figures showing results from the isolated galaxy simulations, the simulations have to be run first by following the instructions here.

Required python packages:

  • matplotlib
  • numpy
  • unyt

Additional python packages required for individual plots

  • astropy (Fig. 4)

Fig. 1: Comparison between Newtonian and softened Jeans mass

Reproduce Fig. 1 with:

python3 Fig1_Jeans_mass_comparison.py

Comment: Easily adapt this figure to different constant Plummer-equivalent softening lengths by changing the line eps = 100. # in pc.

Fig. 2: Illustration of the inaccuracy of the SPH-estimated density depending on a minimum smoothing length

Reproduce Fig. 2 with:

python3 Fig2_SPH_density_sketch.py

Comment: Re-running the figures can lead to slightly different results because the particle positions are random. The minimum smoothing length can be varied by changing the line hmin_in_pc = 1.55 * 10. # minimum smoothing length in pc.

Fig. 3: Runaway collapse zone

Reproduce Fig. 3 with:

python3 Fig3_runaway_collapse_zone.py

Comment: The plotted resolution parameters can be updated by changing the lines that set epsarr, mBarr, and h_min_ratio_arr (see comments in the python script).

Fig. 4: Runaway collapse zones examples from the literature

Reproduce Fig. 4 with:

python3 Fig4_runaway_collapse_zone_examples.py 

Comment: The astropy python package is used to convert the over-density into a physical density for the Springel & Hernquist (2003) effective equation of state. If the relevant lines that add this line to the subplot are commeted out, the astropy package is not necessary. The parameters for some other simulation projects can be found in the python script and can be used for any of the subplots by modifying the call to make_subplot. Some examples are commented out under "other options" towards the end of the python script.

Fig. 5: Gravitational stability at the length scale of a smoothing kernel (constant softening)

Reproduce Fig. 5 with:

python3 Fig5_zones_at_lsmooth.py 

Comment: Change the plot for different resolution parameters by modifying the lines:

mB = [1.e5/8., 1.e5, 8.e5] # msun
mB_default = 1
lsoft = [10., 20., 50., 100., 200., 500.] # pc
lsoft_default = 3

Here, mB_default and lsoft_default are the indices for the default values for each panel.

Fig. 6: Gravitational stability at the length scale of a smoothing kernel (adaptive softening)

Reproduce Fig. 6 with:

python3 Fig6_zones_at_lsmooth_adap.py

Comment: Change the plot for different resolution parameters by modifying the lines:

######### Plot nr 1. ########

lsoftmin = 2.25
lsmoothmin = 2.25
mB = 6.4e4 

to update the left panel and

######### Plot nr 2. ########
lsoftmin = 108.
lsmoothmin = 0.
mB = 8.5e4

to update the right panel.

Fig. 7: Gravitational stability within a smoothing kernel

Authors and acknowledgment

S. Ploeckinger, University of Vienna