Utilities
InitialMassFunctions.partial_mean — Function
partial_mean(d::Distributions.ContinuousUnivariateDistribution, x::Real)Returns the first incomplete moment (or partial expectation) of d up to x,
\[\int_{\text{min}(d)}^{x} \, m \, \frac{dn(m)}{dm} \, dm\]
which is 0 for x <= minimum(d) and mean(d) for x >= maximum(d). For an IMF, partial_mean(d, x) / mean(d) is the fraction of the total mass in stars with masses up to x. Closed forms are implemented for the IMFs in this package and for Normal, LogNormal, Exponential, Gamma, Beta, and Uniform from Distributions.jl and their truncations; other distributions are integrated numerically with QuadGK.quadgk.
InitialMassFunctions.pl_integral — Function
pl_integral(A, α, b1, b2)Definite integral of power law $A*x^{-α}$ from b1 (lower) to b2 (upper).
\[\int_{b1}^{b2} \, A \times x^{-\alpha} \, dx = \frac{A}{1-\alpha} \times \left( b2^{1-\alpha} - b1^{1-\alpha} \right)\]
InitialMassFunctions.lognormal_integral — Function
lognormal_integral(μ, σ, b1, b2)Definite integral of the lognormal probability distribution from b1 to b2.
\[\int_{b1}^{b2} \, \frac{A}{x} \, \exp \left[ \frac{ -\left( \log(x) - \mu \right)^2}{2\sigma^2} \right] \, dx\]