Tips at the beginning:
$\odot$ You can find the documentation here.
$\odot$ To start again and remove all output: Cell > All output > Clear
$\odot$ To move between cells the up and down arrows are conventient.
$\odot$ The empty circle in the menu bar on the right fills when the program is busy.
In [1]:
import matplotlib
matplotlib.use('nbagg')
import matplotlib.pyplot as plt
#matplotlib.use('nbagg')
import numpy as np
%matplotlib inline
import sygma as s
reload(s)
Out[1]:
HELLO art the simulation by creating an instance of the class 'sygma'. YOur will start the evlution of a SSP with an Salpeter IMF of the mass range betwen $1$ and $30M_{\odot}$ and initial metallicty of $Z=0.0001$. When reaching $1.5*10^{10}$ years the code stops. Do this with the folowing command. For a full list of input parameter see the documentation. (Use shift + enter to execte the cell.)
In [2]:
#import mpld3
#mpld3.enable_notebook()
In [3]:
k_N=1e11*0.35/ (1**-0.35 - 30**-0.35) #(I)
N_tot=k_N/1.35 * (1**-1.35 - 30**-1.35) #(II)
Yield_tot=0.1*N_tot
print Yield_tot/1e11
In [10]:
s1=s.sygma(iolevel=0,mgal=1e11,dt=1e7,tend=1.3e10,imf_type='salpeter',alphaimf=2.35,imf_bdys=[1,30],iniZ=0.02,hardsetZ=0.0001,\
table='yield_tables/isotope_yield_table_h1.txt',sn1a_on=False, sn1a_table='yield_tables/sn1a_h1.txt', \
iniabu_table='yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn')
s2=s.sygma(iolevel=0,mgal=1e11,dt=1e7,tend=1.3e10,imf_type='input',imf_bdys=[1,30],iniZ=0.02,hardsetZ=0.0001,\
table='yield_tables/isotope_yield_table_h1.txt',sn1a_on=False, sn1a_table='yield_tables/sn1a_h1.txt', \
iniabu_table='yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn')
In [11]:
s1.plot_totmasses(fig=3,mass='gas',source='all',norm='no',color='k',marker='x',shape=':',markevery=20,label='s')
s2.plot_totmasses(fig=3,mass='gas',source='all',norm='no',color='g',marker='o',shape='--',markevery=20,label='-2.35 custom')
plt.show()
In [2]:
s1=s.sygma(iolevel=0,mgal=1e11,dt=1e7,tend=1.3e10,imf_type='alphaimf',alphaimf=1.5,imf_bdys=[1,30],iniZ=0.02,hardsetZ=0.0001,\
table='yield_tables/isotope_yield_table_h1.txt',sn1a_on=False, sn1a_table='yield_tables/sn1a_h1.txt', \
iniabu_table='yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn')
s2=s.sygma(iolevel=0,mgal=1e11,dt=1e7,tend=1.3e10,imf_type='input',imf_bdys=[1,30],iniZ=0.02,hardsetZ=0.0001,\
table='yield_tables/isotope_yield_table_h1.txt',sn1a_on=False, sn1a_table='yield_tables/sn1a_h1.txt', \
iniabu_table='yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn')
In [8]:
s1=s.sygma(iolevel=0,mgal=1e11,dt=1e7,tend=1.3e10,imf_type='kroupa',alphaimf=1.5,imf_bdys=[1,30],iniZ=0.02,hardsetZ=0.0001,\
table='yield_tables/isotope_yield_table_h1.txt',sn1a_on=False, sn1a_table='yield_tables/sn1a_h1.txt', \
iniabu_table='yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn')
s2=s.sygma(iolevel=0,mgal=1e11,dt=1e7,tend=1.3e10,imf_type='input',imf_bdys=[1,30],iniZ=0.02,hardsetZ=0.0001,\
table='yield_tables/isotope_yield_table_h1.txt',sn1a_on=False, sn1a_table='yield_tables/sn1a_h1.txt', \
iniabu_table='yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn')
In [9]:
s1.plot_totmasses(fig=2,mass='gas',source='all',norm='no',color='k',marker='x',shape=':',markevery=20,label='default kroupa')
s2.plot_totmasses(fig=2,mass='gas',source='all',norm='no',color='g',marker='o',shape='--',markevery=20,label='kroupa custom')
plt.show()
#Salpeter IMF
#return mass**-1.5
#return mass**-2.35
p0 = 1.0
p1 = 0.08**(-0.3 + 1.3)
p2 = 0.5**(-1.3 + 2.3)
p3 = 1**(-2.3 +2.3)
if mass < 0.08:
return p0 * mass**(-0.3)
elif mass < 0.5:
return p1 * mass**(-1.3)
else:
return p1 * p2 * mass**(-2.3)
In [ ]: