Table Of Contents

Previous topic

History

This Page

limepy

Human readable intro

Class

class dflab.limepy(W0, g, **kwargs)
__init__(W0, g, **kwargs)

(MM, A)limepy

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

Parameters:

W0 : scalar
Central dimensionless potential
g : scalar
Order of truncation [0=Woolley, 1=King, 2=Wilson]; default=1
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 sig_j = v_0*mu_j**-delta; default=0.5
eta : scalar, optional
Index in ra_j = ra*mu_j**eta; default=0.5
MS : scalar, optional
Final scaled mass; default=10^5 [Msun]
RS : scalar, optional
Final scaled mass; default=3 [pc]
GS : scalar, optional
Final scaled mass; default=0.004302 [(km/s)^2 pc/Msun]
scale_radius : str, optional
Radius to scale [‘rv’ or ‘rh’]; default=’rh’
scale : bool, optional
Scale model to desired G=GS, M=MS, R=RS; default=False
potonly : bool, optional
Fast solution by solving potential only; default=False
max_step : scalar, optional
Maximum step size for ode output; default=1e4
verbose : bool, optional
Print diagnostics; default=False

Examples:

Construct a Woolley model with W0 = 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.1293450185 1.17562140501

Construct a Michie-King model and print r_a/r_h

>>> a = limepy(7, 1, ra=2)
>>> print a.ra/a.rh
>>> 5.55543555675

Create a Wilson model with W_0 = 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, scale=True, GS=1, MS=1, RS=1, scale_radius='rv')
>>> print w.A, w.df(0,0)
>>> [ 0.00800902] [ 1303.40165523]

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

>>> m = limepy(7, 1, mj=[0.3,1,5], Mj=[9,3,1], scale=True, MS=1e5,RS=1)
>>> print m.alpha
>>> array([ 0.3072483 ,  0.14100799,  0.55174371])

Methods

limepy.df(*arg)

Returns the normalised DF, can only be called after Poisson solver Arguments can be:

  • r, v, j (isotropic 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 ndarray input