limepy

Human readable intro

Class

class limepy.limepy(phi0, g, **kwargs)[source]
__init__(phi0, g, **kwargs)[source]

(MM, A) LIMEPY

(Multi-Mass, Anisotropic) Lowered Isothermal Model Explorer in Python

This code solves the models presented in Gieles & Zocchi 2015 (GZ15), and calculates radial profiles for some useful quantities. The models are defined by the distribution function (DF) of equation (1) in GZ15.

phi0 : scalar, required
Central dimensionless potential
g : scalar, required
Order of truncation (0<= g < 3.5; 0=Woolley, 1=King, 2=Wilson)
ra : scalar, required for anisotropic models
Anisotropy radius; default=1e8
mj : list, required for multi-mass system
Mean mass of each component; default=None
Mj : list, required for multi-mass system
Total mass of each component; default=None
delta : scalar, optional
Index in s_j = s x mu_j^-delta; default=0.5 See equation (24) in GZ15
eta : scalar, optional
Index in ra_j = ra x mu_j^eta; default=0 See equation (25) in GZ15
G : scalar, optional
Final scaled gravitationsl const; default=0.004302 [(km/s)^2 pc/Msun]
M : scalar, optional
Final scaled mass; default=10^5
r0, rh, rv, rt : scalar, optional
Final scaled radius; default=rh=3
project : bool, optional
Compute model properties in projection; default=False
meanmassdef : string [global|central]
Definition of <m> in mu_j = m_j/<m>; default=’global’
potonly : bool, optional
Fast solution by solving potential only; default=False
max_step : scalar, optional
Maximum step size for ode output; default=1e10
verbose : bool, optional
Print diagnostics; default=False

ode_atol : absolute tolerance parameter for ode solver; default=1e-7 ode_rtol : relative tolerance parameter for ode solver; default=1e-7

rhat, phihat, rhohat : radius, potential and density in model units r, phi, rho : as above, in scaled units v2, v2r, v2t : total, radial and tangential mean-square velocity beta : anisotropy profile (equation 32, GZ15) mc : enclosed mass profile r0, rh, rv, rt : radii (King, half-mass, virial, truncation) K, Kr, Kt : kinetic energy: total, radial, tangential U, Q : potential energy, virial ratio A : constant in DF (equation 1, GZ15) volume : phase-space volume occupied by model nstep : number of integration steps (depends on ode_rtol & ode_atol) converged : bool flag to indicate whether model was solved

rhp : half-mass radius in projection (rhp ~ 0.75 rh) Sigma : surface (mass) density v2p : line-of-sight mean-square velocity v2R, v2T : radial and tangential component of mean-square velocity

on plane of the sky

Properties of each component: phi0j : dimensionless central potential rhohatj : dimensionless density rhoj : density profile v2j : mean-square velocity profile v2rj, v2tj : radial and tangential component of mean-square velocity

profile

r0j, raj : radii (King, anisotropy) Kj : kinetic energy Krj, Ktj : radial/tangential component of kinetic energy

Properties of each component: Sigmaj : surface (mass) density v2pj : line-of-sight mean-square velocity profile v2Rj, v2Tj : radial and tangential component on the plane of the sky

of the mean-square velocity profile

Construct a Woolley model with phi0 = 7 and print r_t/r_0 and r_v/r_h

>>> k = limepy(7, 0)
>>> print k.rt/k.r0, k.rv/k.rh
>>> 19.1293426415 1.17783663028

Construct a Michie-King model and print ratio of anisotropy radius over half-mass radius and the Polyachenko & Shukhman (1981) anisotropy parameter

>>> a = limepy(7, 1, ra=5)
>>> print a.ra/a.rh, 2*a.Kr/a.Kt
>>> 1.03377960149 1.36280949941

Create a Wilson model with phi0 = 12 in Henon/N-body units: G = M = r_v = 1 and print the normalisation constant A of the DF and the value of the DF in the centre:

>>> w = limepy(12, 2, G=1, M=1, rv=1)
>>> print w.A, w.df(0,0)
>>> [ 0.00800902] [ 1303.40270676]

Multi-mass model in physical units with r_h = 3 pc and M = 10^5 M_sun and print central densities of each bin over the total central density and the half-mass radius + half-mass radius in projection

>>> m = limepy(7, 1, mj=[0.3,1,5], Mj=[9,3,1], rh=3, M=1e5,project=True,\
...: meanmassdef='central')
>>> print m.alpha, m.rh, m.rhp
>>> [ 0.30721416  0.14103549  0.55175035] 3.0 2.25494426759

Methods

limepy.df(*arg)[source]

Returns the value of the normalised DF at a given position in phase space, can only be called after solving Poisson’s equation

Arguments can be:
  • r, v (isotropic single-mass models)
  • r, v, j (isotropic multi-mass models)
  • r, v, theta, j (anisotropic models)
  • x, y, z, vx, vy, vz, j (all models)

Here j specifies the mass bin, j=0 for single mass Works with scalar and array input