vice.milkyway.IMF¶
Type : str
[case-insensitive] or <function>
Default : “kroupa”
New in version 1.2.0: In version >= 1.2.0, users may construct a function of mass to describe the IMF.
The assumed stellar initial mass function (IMF). If assigned a string, VICE will adopt a built-in IMF. Functions must accept stellar mass as the only parameter and are expected to return the value of the IMF at that mass (it need not be normalized).
Built-in IMFs:
Note
VICE has analytic solutions to the cumulative return fraction and the main sequence mass fraction for built-in IMFs. If assigned a function, VICE will calculate these quantities numerically, increasing the required integration time.
Example Code¶
>>> import vice
>>> mw = vice.milkyway(name = "example")
>>> mw.IMF = "salpeter"
>>> def f(m):
if m < 0.5:
return m**-1.2
else:
return m**-2.2
>>> mw.IMF = f