# Hernquist & Ostriker Self-Consistent-Field-type potential¶

class galpy.potential.SCFPotential(amp=1.0, Acos=array([[[1]]]), Asin=None, a=1.0, normalize=False, ro=None, vo=None)[source]

Class that implements the Hernquist & Ostriker (1992) Self-Consistent-Field-type potential. Note that we divide the amplitude by 2 such that $$Acos = \delta_{0n}\delta_{0l}\delta_{0m}$$ and $$Asin = 0$$ corresponds to Galpy’s Hernquist Potential.

$\rho(r, \theta, \phi) = \frac{amp}{2}\sum_{n=0}^{\infty} \sum_{l=0}^{\infty} \sum_{m=0}^l N_{lm} P_{lm}(\cos(\theta)) \tilde{\rho}_{nl}(r) \left(A_{cos, nlm} \cos(m\phi) + A_{sin, nlm} \sin(m\phi)\right)$

where

$\tilde{\rho}_{nl}(r) = \frac{K_{nl}}{\sqrt{\pi}} \frac{(a r)^l}{(r/a) (a + r)^{2l + 3}} C_{n}^{2l + 3/2}(\xi)$
$\Phi(r, \theta, \phi) = \sum_{n=0}^{\infty} \sum_{l=0}^{\infty} \sum_{m=0}^l N_{lm} P_{lm}(\cos(\theta)) \tilde{\Phi}_{nl}(r) \left(A_{cos, nlm} \cos(m\phi) + A_{sin, nlm} \sin(m\phi)\right)$

where

$\tilde{\Phi}_{nl}(r) = -\sqrt{4 \pi}K_{nl} \frac{(ar)^l}{(a + r)^{2l + 1}} C_{n}^{2l + 3/2}(\xi)$

where

$\xi = \frac{r - a}{r + a} \qquad N_{lm} = \sqrt{\frac{2l + 1}{4\pi} \frac{(l - m)!}{(l + m)!}}(2 - \delta_{m0}) \qquad K_{nl} = \frac{1}{2} n (n + 4l + 3) + (l + 1)(2l + 1)$

and $$P_{lm}$$ is the Associated Legendre Polynomials whereas $$C_n^{\alpha}$$ is the Gegenbauer polynomial.

__init__(amp=1.0, Acos=array([[[1]]]), Asin=None, a=1.0, normalize=False, ro=None, vo=None)[source]

NAME:

__init__

PURPOSE:

initialize a SCF Potential from a set of expansion coefficients (use SCFPotential.from_density to directly initialize from a density)

INPUT:

amp - amplitude to be applied to the potential (default: 1); can be a Quantity with units of mass or Gxmass

Acos - The real part of the expansion coefficient (NxLxL matrix, or optionally NxLx1 if Asin=None)

Asin - The imaginary part of the expansion coefficient (NxLxL matrix or None)

a - scale length (can be Quantity)

normalize - if True, normalize such that vc(1.,0.)=1., or, if given as a number, such that the force is this fraction of the force necessary to make vc(1.,0.)=1.

ro=, vo= distance and velocity scales for translation into internal units (default from configuration file)

OUTPUT:

SCFPotential object

HISTORY:

2016-05-13 - Written - Aladdin Seaifan (UofT)

classmethod from_density(dens, N, L=None, a=1.0, symmetry=None, radial_order=None, costheta_order=None, phi_order=None, ro=None, vo=None)[source]

NAME:

from_density

PURPOSE:

initialize an SCF Potential from from a given density

INPUT:

dens - density function that takes parameters R, z and phi; z and phi are optional for spherical profiles, phi is optional for axisymmetric profiles. The density function must take input positions in internal units (R/ro, z/ro), but can return densities in physical units. You can use the member dens of Potential instances or the density from evaluateDensities

N - Number of radial basis functions

L - Number of costheta basis functions; for non-axisymmetric profiles also sets the number of azimuthal (phi) basis functions to M = 2L+1)

a - expansion scale length (can be Quantity)

symmetry= (None) symmetry of the profile to assume: ‘spherical’, ‘axisymmetry’, or None (for the general, non-axisymmetric case)

radial_order - Number of sample points for the radial integral. If None, radial_order=max(20, N + 3/2L + 1)

costheta_order - Number of sample points of the costheta integral. If None, If costheta_order=max(20, L + 1)

phi_order - Number of sample points of the phi integral. If None, If costheta_order=max(20, L + 1)

ro=, vo= distance and velocity scales for translation into internal units (default from configuration file)

OUTPUT:

SCFPotential object

HISTORY:

2022-06-20 - Written - Jo Bovy (UofT)