# galpy.potential.Potential.mass¶

Potential.mass(R, z=None, t=0.0, forceint=False)[source]

NAME:

mass

PURPOSE:

evaluate the mass enclosed

INPUT:

R - Cylindrical Galactocentric radius (can be Quantity)

z= (None) vertical height up to which to integrate (can be Quantity)

t - time (optional; can be Quantity)

forceint= if True, calculate the mass through integration of the density, even if an explicit expression for the mass exists

OUTPUT:

Mass enclosed within the spherical shell with radius R if z is None else mass in the slab <R and between -z and z; except: potentials inheriting from EllipsoidalPotential, which if z is None return the mass within the ellipsoidal shell with semi-major axis R

HISTORY:

2014-01-29 - Written - Bovy (IAS)

2019-08-15 - Added spherical warning - Bovy (UofT)

2021-03-15 - Changed to integrate to spherical shell for z is None slab otherwise - Bovy (UofT)

2021-03-18 - Switched to using Gauss’ theorem - Bovy (UofT)