The SKIRT project
advanced radiative transfer for astrophysics
Public Member Functions | Private Attributes | List of all members
SersicFunction Class Reference

#include <SersicFunction.hpp>

Public Member Functions

 SersicFunction (double n)
 
double inverseMass (const double M) const
 
double mass (const double s) const
 
double operator() (const double s) const
 

Private Attributes

Array _Mv
 
Array _sv
 
Array _Sv
 

Detailed Description

The SersicFunction class represents the Sersic function Sn(s) of Sersic index n; see Sersic (1963). This function represents the dimensionless three-dimensional density of a normalized Sersic surface brightness distribution,

In(sp)=bn2nπΓ(2n+1)ebnsp1/n,

where bn is a dimensionless constant that is defined by the condition that

π01In(sp)spdsp=12.

Its value can conveniently be approximated as

bn=2n13+4405n+4625515n2+1311148175n3,

as derived by Ciotti & Bertin (1999, A&A 352, 447–451). Given In(sp), the Sersic function Sn(s) can be determined by solving the Abel integral equation

2spSn(s)sdss2sp2=In(sp).

The solution of this integral equation can be written as

Sn(s)=1πsdIndsp(sp)dspsp2s2.

As a C++ class, the SersicFunction class contains a vector with the values of Sn(s) on a grid, distributed logarithmically between s=106 and s=104. Also the cumulative mass function,

Mn(s)=4π0sSn(s)s2ds

is stored on the same grid.

Constructor & Destructor Documentation

◆ SersicFunction()

SersicFunction::SersicFunction ( double  n)

Constructor for the SersicFunction class. It creates a logarithmic grid of s-points ranging from 106 to 104 and computes the integral for Sn(s) on each of the grid points. An additional integration (with logarithmic interpolation between the grid points) is used to calculate the cumulative mass function. The accuracy of the integrations has been checked for the n=4 case through comparison with the tabulated values of Young (1976). For the case n=1 the integrations are checked directly against the analytical value: in this case we find

S1(s)=b132π2K0(b1s),

with b1=1.67834699 and K0(x) the modified Bessel function of the second kind. In both cases, a relative accuracy better than 0.01% is typically reached.

Member Function Documentation

◆ inverseMass()

double SersicFunction::inverseMass ( const double  M) const

The function returns the inverse function of the cumulative mass function; it solves the equation

4π0sSn(s)s2ds=M

for s, given the normalized cumulative mass M, assumed to lie between 0 and 1. The value of s is determined by logarithmic interpolation on the internally stored grid.

◆ mass()

double SersicFunction::mass ( const double  s) const

The function returns the cumulative mass function

Mn(s)=4π0sSn(s)s2ds

at the dimensionless radius s. Its value is determined by logarithmic interpolation on the internally stored grid.

◆ operator()()

double SersicFunction::operator() ( const double  s) const

The function returns the Sersic function Sn(s) for the dimensionless radius s. Its value is determined by logarithmic interpolation on the internally stored grid.


The documentation for this class was generated from the following file: