File:Plot of various initial mass functions.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 370 × 355 pixels, file size: 73 KB)

Captions

Captions

Add a one-line explanation of what this file represents
Description
English: Plot of various initial mass functions (IMF). (The vertical axis is actually not ξ(m)Δm, but a scaled version of ξ(m). For m greater than 1 solar mass, it is (m/solar mass)^-2.35.)
Date
Source Own work
Author JohannesBuchner
I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

Generating Python Code[edit]

import matplotlib.pyplot as plt
import numpy
from numpy import exp, log10 as log

def salpeter55(m):
	alpha = 2.35
	return m**-alpha

def millerscalo79(m):
	return numpy.where(m > 1, salpeter55(m), salpeter55(1))

def chabrier03individual(m):
	k = 0.158 * exp(-(-log(0.08))**2/(2 * 0.69**2))
	return numpy.where(m <= 1,\
	        0.158*(1./m) * exp(-(log(m)-log(0.08))**2/(2 * 0.69**2)),\
	        k*m**-2.3)

def chabrier03system(m):
	k = 0.086 * exp(-(-log(0.22))**2/(2 * 0.57**2))
	return numpy.where(m <= 1,\
	        0.086*(1./m) * exp(-(log(m)-log(0.22))**2/(2 * 0.57**2)),\
	        k*m**-2.3)

def kroupa01(m):
	return numpy.where(m<0.08, m**-0.3, numpy.where(m < 0.5, 0.08**-0.3 * (m/0.08)**-1.3, 0.08**-0.3 * (0.5/0.08)**-1.3 * (m/0.5)**-2.3))

plt.figure(figsize=(4,4))
m = numpy.logspace(-2, 2, 400)

for label, imf in zip('Salpeter55 MillerScalo79 Kroupa01 Chabrier03individual Chabrier03system'.split(),\
        [salpeter55, millerscalo79, kroupa01, chabrier03individual, chabrier03system]):
	plt.plot(m, imf(m)/imf(1), label=label)

plt.gca().set_yscale('log')
plt.gca().set_xscale('log')
plt.xlim(1e-2, 100)
plt.ylim(1e-3, 1e3)
plt.legend(loc='best', prop=dict(size=8))
plt.xlabel('Mass [Solar mass]')
plt.ylabel(r'Mass Function $\xi(m)\Delta m$')
plt.savefig('imf.pdf', bbox_inches='tight')
plt.savefig('imf.svg', bbox_inches='tight')
plt.savefig('imf.png', bbox_inches='tight')

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current19:14, 4 November 2015Thumbnail for version as of 19:14, 4 November 2015370 × 355 (73 KB)JohannesBuchner (talk | contribs)Cross-wiki upload from en.wikipedia.org

The following page uses this file:

File usage on other wikis

The following other wikis use this file:

Metadata