PlummerSphere#

class agabpylib.simulation.starclusters.spacedistributions.PlummerSphere(a)#

Bases: SpaceDistribution

Plummer density distribution.

Implements a spherical Plummer distribution with core radius \(a\):

\[\rho(r) = \frac{C}{(1+(r/a)^2)^{5/2}}\]

Note that the mass of the cluster is ignored in this implementation.

The density of stars in this model as a function of distance from the cluster centre (at (0,0,0)), expressed as a probability density, is given by:

\[\rho(r) = \frac{3}{4\pi a^3} \frac{1}{(1+(r/a)^2)^{5/2}}\]

The number of stars per distance interval, expressed as a probability density, is:

\[n(r) = 4\pi r^2\rho(r)\]
core_radius#

Core radius in pc.

Type:

astropy.units.Quantity

Methods Summary

addinfo()

returns:

info -- String with specific information about the space distribution.

generate_positions(n, rng)

Generate the positions of the stars randomly according to the prescribed space distribution.

getmeta()

returns:

meta -- Metadata on the space distribution of the cluster stars.

Methods Documentation

addinfo()#
Returns:

info – String with specific information about the space distribution.

Return type:

str

generate_positions(n, rng)#

Generate the positions of the stars randomly according to the prescribed space distribution.

Parameters:
  • n (int) – Number of star positions to generate.

  • rng (numpy.random.Generator) – Random number generator. This is provided separately to enable user control over the random number sequence.

Returns:

x, y, z – The x, y, z positions of the stars in units of pc.

Return type:

astropy.units.Quantity arrays

getmeta()#
Returns:

meta – Metadata on the space distribution of the cluster stars.

Return type:

dict