Chemistry C API

IMF functions

static double get_imf(double m)

This function returns the mass fraction of a star of mass m using the current IMF

\[\Phi(m) = b\, m^a\]
static double get_imf_M(double m1, double m2)

This function returns the mass fraction between m1 and m2 per mass unit, using the current IMF

\[\int^{m_1}_{m_2} \Phi(m)\,dm = \frac{b}{a+1} \left( m_2^{a+1} - m_1^{a+1} \right)\]
static double get_imf_N(double m1, double m2)

This function returns the number fraction between m1 and m2 per mass unit, using the current IMF

\[\int^{m_1}_{m_2} \frac{\Phi(m)}{m}\,dm = \frac{b}{a} \left( m_2^{a} - m_1^{a} \right)\]
static double imf_sampling()

Sample the imf using monte carlo approach

void init_imf(void)

This function initializes the imf parameters defined in the chemistry file. It compute the normalization factor \(b\) ensuring:

\[\int^{M_{\rm{min}}}_{M_{\rm{max}}} \Phi(m)\,dm = \int^{M_{\rm{min}}}_{M_{\rm{max}}} b\, m^a \,dm = 1\]