Test post

meta
Kitchen-sink check of math, figures, citations, and embeds.
Published

October 6, 2026

The stellar initial mass function of Kroupa (2001) is a broken power law:

\[ \frac{dN}{dM_\star} \propto M_\star^{-\alpha}, \qquad \alpha = \begin{cases} 0.3 & M_\star < 0.08\,M_\odot \\ 1.3 & 0.08\,M_\odot \le M_\star < 0.5\,M_\odot \\ 2.3 & M_\star \ge 0.5\,M_\odot \end{cases} \tag{1}\]

Figure 1 plots Equation 1 per logarithmic mass interval.

Code
import numpy as np
import matplotlib.pyplot as plt

m = np.logspace(-2, 2, 400)
dNdm = np.where(m < 0.08, (m / 0.08) ** -0.3,
       np.where(m < 0.5, (m / 0.08) ** -1.3,
                (0.5 / 0.08) ** -1.3 * (m / 0.5) ** -2.3))
dNdlogm = m * dNdm

# one plot per theme; the light one doubles as the listing thumbnail and preview image
for fg, bg in [("black", "white"), ("white", "#222")]:
    with plt.rc_context({"text.color": fg, "axes.edgecolor": fg, "axes.labelcolor": fg,
                         "xtick.color": fg, "ytick.color": fg}):
        fig, ax = plt.subplots(figsize=(5, 3.5), facecolor=bg)
        ax.set_facecolor(bg)
        ax.loglog(m, dNdlogm / dNdlogm.max(), color=fg)
        ax.set(xlabel=r"$M_\star\,(M_\odot)$", ylabel=r"$dN/d\log M_\star$ (normalized)")
        plt.show()

Figure 1: The Kroupa IMF.

STARFORGE simulations (Grudić et al. 2021) form stars out of a giant molecular cloud and get an IMF of roughly this shape:

References

Grudić, Michael Y., Dávid Guszejnov, Philip F. Hopkins, Stella S. R. Offner, and Claude-André Faucher-Giguère. 2021. “STARFORGE: Towards a Comprehensive Numerical Model of Star Cluster Formation and Feedback.” MNRAS 506. https://doi.org/10.1093/mnras/stab1347.
Kroupa, Pavel. 2001. “On the Variation of the Initial Mass Function.” MNRAS 322: 231–46. https://doi.org/10.1046/j.1365-8711.2001.04022.x.