Radial and vertical MW structure

Potential and force

jjmodel.poisson.poisson_solver(a, fimax, dfi, SFRd, SFRt, gd, gt, Sigma, sigW, hg, **kwargs)[source]

Solver of the Poisson-Boltzmann equation.

Parameters
  • a (namedtuple) -- Collection of the fixed model parameters, useful quantities, and arrays.

  • fimax (scalar) -- The optimal maximum value of the normalized gravitational potential up to which the Poisson-Boltzmann eq. is solved (approximately corresponds to the maximum height p.zmax prescribed in the parameter file).

  • dfi (float) -- Step in normalized potential.

  • SFRd (array-like) -- Thin-disk SFR function, \(\mathrm{M_\odot \ pc^{-2} \ Gyr^{-1}}\). Array length is equal to the number of thin-disk subpopulations: a.jd = int((tp-p.td1)/tr), where tp is a present-day MW disk age and tr is the model age resolution.

  • SFRt (array-like) -- Thick-disk SFR function, \(\mathrm{M_\odot \ pc^{-2} \ Gyr^{-1}}\). Length of the array is a.jt = int(p.tt2/tr).

  • gd (array-like) -- Thin-disk mass loss function, len(gd)==len(SFRd).

  • gt (array-like) -- Thick-disk mass loss function, len(gt)==len(SFRt).

  • Sigma (array-like) -- Present-day surface densities of non-disk components (molecular gas, atomic gas, DM, stellar halo), \(\mathrm{M_\odot \ pc^{-2}}\).

  • sigW (array-like) -- Set of parameters defining W-velocity dispersions of the Galactic components: (sige, alpha, sigt, sigdh, sigsh). sige and alpha are the AVR scaling parameter (\(\mathrm{km \ s^{-1}}\)) and power index (dim). sigt, sigdh, sigsh (\(\mathrm{km \ s^{-1}}\)) are W-velocity dispersions of the thick disk, DM, and stellar halo, respectively.

  • hg (array-like) -- Scale heights of the molecular and atomic gas (hg1, hg2), pc.

  • fp (array-like) -- Optional. Relative contributions of the additional thin-disk SFR peaks to the total thin-disk SFR, \(\mathrm{M_\odot \ pc^{-2} \ Gyr^{-1}}\) (output Fp in jjmodel.funcs.SFR.sfrr()). Must be given if p.pkey=1 or p.pkey=2.

  • sigp (array-like) -- Optional. W-velocity dispersions (\(\mathrm{km \ s^{-1}}\)) of the thin-disk populations associated with the stellar density excess in the additional peaks. Must be given when p.pkey=1.

  • heffd (scalar) -- Optional. Thin-disk half-thickness (effective scale height), pc. If fixed by this parameter, additional iterations will be performed to adapt AVR to fulfill this requirement.

  • hefft (scalar) -- Optional. Thick-disk half-thickness (effective scale height), pc. If fixed by this parameter, additional iterations will be performed to adapt thick-disk W-velocity dispersion sigt to fulfill this requirement.

  • status_equation (boolean) -- Optional. If True, the iteration details are printed to console.

  • log (file) -- Optional. If given, the details of the iteration are written to the file.

  • plot (list) -- Optional. Matplotlib figure and axis for plotting the current version of potential, and name of the plot, [(fig, ax),figure_name] .

Returns

Dictionary with all sorts of output.

Keys of the standard output:

  • 'hd': 1d-array of length a.jd, scale heights of the thin-disk subpopulations (pc).

  • 'ht', 'hdh', 'hsh' : float, thick-disk, DM, and halo scale heights (pc).

  • 'heffd', 'hefft' : float, half-thickness of the thin and thick disk (pc).

  • 'sigg1', 'sigg2', 'sigt' : molecular and atomic gas and thick-disk W-velocity dispersions (\(\mathrm{km \ s^{-1}}\)).

  • 'sige' : float, scaling parameter of the thin-disk AVR (\(\mathrm{km \ s^{-1}}\)).

  • 'avr' : 1d-array of length a.jd, thin-disk AVR (\(\mathrm{km \ s^{-1}}\)).

  • 'fie', 'phi' : total vertical gravitational potential (corresponds to a.z grid). fie is the normalized potential multiplied by the constant SIGMA_E^2 (\(\mathrm{km^2 \ s^{-2}}\)), useful for further calculations of potential-dependend quantities. phi is the potential in physical units, \(\mathrm{m^2 \ s^{-2}}\).

  • 'rhodtot', 'rhot', 'rhog1', 'rhog2', 'rhodh', 'rhosh' : Mass density vertical profiles of the Galactic components (correspond to a.z grid), \(\mathrm{M_\odot \ pc^{-3}}\). 'rhodtot'' is the total thin-disk density, that includes subpopulations characterized by W-velocity dispersion prescribed by the AVR and SFR-peaks' subpopulations with special kinematics, if any.

Keys of the optional output (depending on kwargs):

  • 'hdp' : Scale height(s) of the SFR-peak(s)' subpopulations, pc.

  • 'rhodp', 'rhod0' : Mass density vertical profiles of the SFR-peak(s)' subpopulations, and of the thin-disk subpopulations with the vertical kinematics described by the AVR, \(\mathrm{M_\odot \ pc^{-3}}\). In this case total density profile is rhodtot = rhod0 + sum(rhodp,axis=0).

  • 'log' : file, log file with the iteration details.

  • 'plot' : matplotlib figure and axis for the plot of normalized potential.

Return type

dict

jjmodel.poisson.vertical_force(a, fimax, Sigma, sigW, h)[source]

Calculates the vertical force produced by some Galactic component.

Parameters
  • a (namedtuple) -- Collection of the fixed model parameters, useful quantities, and arrays.

  • fimax (scalar) -- The optimal maximum value of the normalized gravitational potential up to which the Poisson-Boltzmann eq. is solved (approximately corresponds to the maximum height p.zmax prescribed in the parameter file).

  • Sigma (scalar or array-like) -- Surface density, \(\mathrm{M_\odot \ pc^{-2}}\) (for the thin and thick disk can be a function of time, SFRd*gd and SFRt*gt, where gd and gt are mass loss functions).

  • sigW (scalar or array-like) -- W-velocity dispersion, \(\mathrm{km \ s^{-1}}\) (for the thin disk this is AVR).

  • h (scalar or array-like) -- Scale height, pc (for the thin disk this is a function of time).

Returns

Vertical force (up to p.zmax, corresponds to the grid a.z), \(\mathrm{km^2 \ s^{-2} \ kpc^{-1}}\).

Return type

1d-array

Disk modeling

jjmodel.mwdisk.rbin_builder(R, a, SFRd, SFRt, gd, gt, Sigma, sigW, hg, **kwargs)[source]

Predicts the vertical structure of the MW disk at a given Galactocentric distance.

Parameters
  • R (scalar) -- Galactocentric distance, kpc.

  • a (namedtuple) -- Collection of the fixed model parameters, useful quantities, and arrays.

  • SFRd (array-like) -- Thin-disk star formation rate function, \(\mathrm{M_\odot \ pc^{-2} \ Gyr^{-1}}\). Array length is equal to the number of thin-disk subpopulations: a.jd = int((tp-p.td1)/tr), where tp is a present-day MW disk age and tr is the model age resolution.

  • SFRt (array-like) -- Thick-disk star formation rate function, \(\mathrm{M_\odot \ pc^{-2} \ Gyr^{-1}}\). Length of the array is a.jt = int(p.tt2/tr).

  • gd (array-like) -- Thin-disk mass loss function, len(gd)==len(SFRd).

  • gt (array-like) -- Thick-disk mass loss function, len(gt)==len(SFRt).

  • Sigma (array-like) -- Present-day surface densities of non-disk components (molecular gas, atomic gas, DM, stellar halo), \(\mathrm{M_\odot \ pc^{-2}}\).

  • sigW (array-like) -- Set of parameters defining W-velocity dispersions of the Galactic components: (sige, alpha, sigt, sigdh, sigsh). sige and alpha are the AVR scaling parameter (\(\mathrm{km \ s^{-1}}\)) and power index (dim). sigt, sigdh, sigsh (\(\mathrm{km \ s^{-1}}\)) are W-velocity dispersions of the thick disk, DM, and stellar halo, respectively.

  • hg (array-like) -- Scale heights of the molecular and atomic gas (hg1, hg2), pc.

  • fp (array-like) -- Optional. Relative contributions of the additional thin-disk SFR peaks to the total thin-disk SFR, \(\mathrm{M_\odot \ pc^{-2} \ Gyr^{-1}}\) (output Fp in jjmodel.funcs.SFR.sfrr()). Must be given if p.pkey=1 or p.pkey=2.

  • sigp (array-like) -- Optional. W-velocity dispersions (\(\mathrm{km \ s^{-1}}\)) of the thin-disk populations associated with the stellar density excess in the additional peaks. Must be given when p.pkey=1.

  • heffd (scalar) -- Optional. Thin-disk half-thickness (effective scale height), pc. If fixed by this parameter, additional iterations will be performed to adapt AVR to fulfill this requirement.

  • hefft (scalar) -- Optional. Thick-disk half-thickness (effective scale height), pc. If fixed by this parameter, additional iterations will be performed to adapt thick-disk W-velocity dispersion sigt to fulfill this requirement.

  • status_equation (boolean) -- Optional. If True, the iteration details are printed to console.

  • status_progress (boolean) -- Optional. If True, the overall progress details are printed to console.

  • log (file) -- Optional. If given, the details of the iteration are written to the file.

  • plot (boolean) -- Optional. If True, the derived potential is plotted for each iteration, plots are saved.

  • save (boolean) -- Optional. If True, the output tables, are saved to the specified directory, a.dir.

Returns

Dictionary with all sorts of output (mainly the output of jjmodel.poisson.poisson_solver()).

Keys of the standard output:

  • 'hd': 1d-array of length a.jd, scale heights of the thin-disk subpopulations (pc).

  • 'ht', 'hdh', 'hsh' : float, thick-disk, DM, and halo scale heights (pc).

  • 'heffd', 'hefft' : float, half-thickness of the thin and thick disk (pc).

  • 'sigg1', 'sigg2', 'sigt' : molecular and atomic gas and thick-disk W-velocity dispersions (\(\mathrm{km \ s^{-1}}\)).

  • 'sige' : float, scaling parameter of the thin-disk AVR (\(\mathrm{km \ s^{-1}}\)).

  • 'avr' : 1d-array of length a.jd, thin-disk AVR (\(\mathrm{km \ s^{-1}}\)).

  • 'fie', 'phi' : total vertical gravitational potential (corresponds to a.z grid). fie is the normalized potential multiplied by the constant SIGMA_E^2 (\(\mathrm{km^2 \ s^{-2}}\)), useful for further calculations of potential-dependend quantities. phi is the potential in physical units, \(\mathrm{m^2 \ s^{-2}}\).

  • 'rhodtot', 'rhot', 'rhog1', 'rhog2', 'rhodh', 'rhosh' : Mass density vertical profiles of the Galactic components (correspond to a.z grid), \(\mathrm{M_\odot \ pc^{-3}}\). 'rhodtot'' is the total thin-disk density, that includes subpopulations characterized by W-velocity dispersion prescribed by the AVR and SFR-peaks' subpopulations with special kinematics, if any.

  • 'Kzdtot', 'Kzt', 'Kzg1', 'Kzg2', 'Kzdh', 'Kzsh' : Vertical force from i-th model component, \(\mathrm{m^2 \ s^{-2} \ pc^{-1}}\). Kzdtot corresponds to the total thin disk, as rhodtot.

Keys of the optional output (depending on kwargs):

  • 'hdp' : Scale height(s) of the SFR-peak(s)' subpopulations, pc.

  • 'rhodp', 'rhod0' : Mass density vertical profiles of the SFR-peak(s)' subpopulations, and of the thin-disk subpopulations with the vertical kinematics described by the AVR, \(\mathrm{M_\odot \ pc^{-3}}\). In this case total density profile is rhodtot = rhod0 + sum(rhodp,axis=0).

  • 'Kzd0', 'Kzdp' : Analogically to rhodp and rhod0, thin-disk vertical graditational force components, \(\mathrm{m^2 \ s^{-2} \ pc^{-1}}\).

  • 'plot' : matplotlib figure and axis for the plot of normalized potential.

Return type

dict

jjmodel.mwdisk.local_run(p, a, inp, **kwargs)[source]

Builds the local JJ model based on the given parameters and input functions. Accepts optional parameters of jjmodel.mwdisk.rbin_builder().

Parameters
  • p (namedtuple) -- Set of model parameters from the parameter file.

  • a (namedtuple) -- Collection of the fixed model parameters, useful quantities, and arrays.

  • inp (dict) -- Collection of the input functions including SFR, AVR, AMR, and IMF.

Returns

Output of the function jjmodel.mwdisk.rbin_builder() for p.Rsun.

Return type

dict

jjmodel.mwdisk.extended_run(inp, i, out_local, **kwargs)[source]

Calculates the JJ-model predictions at a given Galactocentric distance. Accepts optional parameters of jjmodel.mwdisk.rbin_builder().

Parameters
  • inp (dict) -- Collection of the input functions including SFR, AVR, AMR, and IMF.

  • i (int) -- Index of the current radial bin in a.R array.

  • out_local (dict) -- Output of the function jjmodel.mwdisk.local_run().

  • status_progress (boolean) -- Optional. If True, the overall progress details are printed to console.

Returns

Output of the function Accepts optional parameters of jjmodel.mwdisk.rbin_builder() for the i-th radial bin.

Return type

dict

jjmodel.mwdisk.disk_builder(p, a, inp, **kwargs)[source]

Constructs the disk (vertical structure at some Galactocentric distance). Can work in two modes (depending on the parameter p.run_mode):

  1. models the Solar neighbourhood only;

  2. starts with the Solar neighbourhood and then extends the local JJ model to other radii.

Input data (e.g. SFR and AMR) and results (e.g. potential, densities, scale heights, AVR) are saved as txt files to the output directory a.dir. Accepts optional parameters of jjmodel.mwdisk.rbin_builder().

Parameters
  • p (namedtuple) -- Set of model parameters from the parameter file.

  • a (namedtuple) -- Collection of the fixed model parameters, useful quantities, and arrays.

  • inp (dict) -- Collection of the input functions including SFR, AVR, AMR, and IMF.

  • status_progress (boolean) -- Optional. If True, the overall progress details are printed to console.

Returns

None.