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 \({\cal{S}}_n(s)\) of Sersic index \(n\); see Sersic (1963). This function represents the dimensionless three-dimensional density of a normalized Sersic surface brightness distribution,

\[ I_n(s_{\text{p}}) = \frac{b_n^{2n}}{\pi\,\Gamma(2n+1)}\, {\text{e}}^{-b_ns_{\text{p}}^{1/n}}, \]

where \(b_n\) is a dimensionless constant that is defined by the condition that

\[ \pi \int_0^1 I_n(s_{\text{p}})\, s_{\text{p}}\, {\text{d}}s_{\text{p}} = \frac12.\]

Its value can conveniently be approximated as

\[ b_n = 2n -\frac{1}{3} + \frac{4}{405n} + \frac{46}{25515n^2} + \frac{131}{1148175n^3}, \]

as derived by Ciotti & Bertin (1999, A&A 352, 447–451). Given \(I_n(s_{\text{p}})\), the Sersic function \({\cal{S}}_n(s)\) can be determined by solving the Abel integral equation

\[ 2 \int_{s_{\text{p}}}^\infty \frac{ {\cal{S}}_n(s)\, s\, {\text{d}}s }{ \sqrt{s^2-s_{\text{p}}^2} } = I_n(s_{\text{p}}). \]

The solution of this integral equation can be written as

\[ {\cal{S}}_n(s) = -\frac{1}{\pi} \int_s^\infty \frac{ \text{d}I_n }{ {\text{d}} s_{\text{p}}} (s_{\text{p}})\, \frac{ {\text{d} s_{\text{p}}}} {\sqrt{s_{\text{p}}^2-s^2}}. \]

As a C++ class, the SersicFunction class contains a vector with the values of \({\cal{S}}_n(s)\) on a grid, distributed logarithmically between \(s=10^{-6}\) and \(s=10^4\). Also the cumulative mass function,

\[ {\cal{M}}_n(s) = 4\pi \int_0^s {\cal{S}}_n(s)\,s^2\, {\text{d}}s \]

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 \(10^{-6}\) to \(10^4\) and computes the integral for \({\cal{S}}_n(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

\[ {\cal{S}}_1(s) = \frac{b_1^3}{2\pi^2}\, K_0(b_1s), \]

with \(b_1 = 1.67834699\) and \(K_0(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\pi \int_0^s {\cal{S}}_n(s')\, s'^2\, {\text{d}}s' = 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

\[ {\cal{M}}_n(s) = 4\pi \int_0^s {\cal{S}}_n(s')\, s'^2\, {\text{d}}s' \]

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 \({\cal{S}}_n(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: