Test of SSP with artificial yields (e.g. pure h1 yields) provided in tables. Focus are basic GCE features. You can find the documentation here.
For H only:
$\odot$ Different SFR input, two times one burst compared to two bursts with starburst variable
$\odot$ MW Settting: galaxy='milky_way'
$\odot$ MW Settting: galaxy='milky_way' with Maoz12
In [22]:
#from imp import *
#s=load_source('sygma','/home/nugrid/nugrid/SYGMA/SYGMA_online/SYGMA_dev/sygma.py')
import sygma as s
reload(s)
from scipy.integrate import quad
from scipy.interpolate import UnivariateSpline
#import mpld3
#mpld3.enable_notebook()
In [23]:
#First star burst
k_N=0.3*1e11*0.35/ (1**-0.35 - 30**-0.35) #(I)
N_tot=k_N/1.35 * (1**-1.35 - 30**-1.35) #(II)
Yield_tot1=0.1*N_tot
print Yield_tot1/1e11
In [24]:
ssp1=s.sygma(iolevel=0,dt=6e7,mgal=1e11,starbursts=[0.3],tend=13e9,special_timesteps=30,imf_type='salpeter',imf_bdys=[1,30],sn1a_on=False,hardsetZ=0.0001,iniZ=-1,table='yield_tables/isotope_yield_table_h1.txt', sn1a_table='yield_tables/sn1a_h1.txt', iniabu_table='yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn')
Yield_tot_sim1=ssp1.history.ism_elem_yield[-1][0]-(0.7*1e11)
In [25]:
#reduce ISM by not processed material to get only ejecta
ism_after_burst=ssp1.history.ism_elem_yield[1][0]
print Yield_tot_sim1/1e11
print ssp1.history.sfr[:5]
#print ism_after_burst/1e11
#print Yield_tot_sim1/1e11
#print ssp1.history.ism_elem_yield[1]
#print ssp1.history.ism_elem_yield[-1]
In [26]:
ssp2=s.sygma(iolevel=0,dt=6e7,mgal=ism_after_burst,starbursts=[0.6],tend=13e9,special_timesteps=30,imf_type='salpeter',imf_bdys=[1,30],sn1a_on=False,hardsetZ=0.0001,iniZ=-1,table='yield_tables/isotope_yield_table_h1.txt', sn1a_table='yield_tables/sn1a_h1.txt', iniabu_table='yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn')
Yield_tot_sim2=ssp2.history.ism_iso_yield[-1][0]-0.4*ism_after_burst
In [27]:
ssp2.history.mgal/1e11,Yield_tot_sim2/1e11
Out[27]:
In [28]:
print 'Pristine gas after secodn burst:',0.4*ism_after_burst
Yield_tot_comb=Yield_tot_sim2+Yield_tot_sim1
print Yield_tot_comb/1e11
In [29]:
#Second star burst
print 'ISM after first burst',ism_after_burst/1e11
k_N=0.6*(ism_after_burst)*0.35/ (1**-0.35 - 30**-0.35) #(I)
N_tot=k_N/1.35 * (1**-1.35 - 30**-1.35) #(II)
Yield_tot2=0.1*N_tot
print Yield_tot1/1e11,Yield_tot2/1e11
Yield_tot=Yield_tot1+Yield_tot2
In [30]:
msp=s.sygma(iolevel=0,dt=6e7,mgal=1e11,starbursts=[0.3,0.6],tend=13e9,special_timesteps=30,imf_type='salpeter',imf_bdys=[1,30],sn1a_on=False,hardsetZ=0.0001,iniZ=-1,table='yield_tables/isotope_yield_table_h1.txt', sn1a_table='yield_tables/sn1a_h1.txt', iniabu_table='yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn')
Yield_tot_sim=msp.history.ism_iso_yield[-1][0] - (1e11 - msp.history.m_locked[0] - msp.history.m_locked[1])#-(1e11 -0.1*1e11-0.2*0.1*1e11)
print Yield_tot_sim
In [31]:
print 'After second burst',(1e11 - msp.history.m_locked[0] - msp.history.m_locked[1])/1e11
print msp.history.m_locked[0]/1e11,msp.history.m_locked[1]/1e11
print msp.history.ism_iso_yield[-1][0]/1e11
print msp.history.sfr[:5]
print msp.history.m_locked
In [32]:
print 'SSP combination',Yield_tot_comb/1e11
print 'Sim',Yield_tot_sim/1e11
print 'Ejecta from stars only with hand calc:',Yield_tot/1e11
print 'Should be 1:',Yield_tot_comb/Yield_tot_sim
print '##############################'
print 'ratio should be 1 : ',Yield_tot_sim/Yield_tot
print 'ratio should be 1 : ',Yield_tot_comb/Yield_tot
In [33]:
msp=s.sygma(iolevel=0,dt=6e7,mgal=1e11,starbursts=[0.1,0.2],tend=13e9,special_timesteps=30,imf_type='kroupa',imf_bdys=[0.1,100],sn1a_on=False,hardsetZ=0.0001,iniZ=-1,table='yield_tables/isotope_yield_table_h1.txt', sn1a_table='yield_tables/sn1a_h1.txt', iniabu_table='yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn')
Yield_tot_sim=msp.history.ism_iso_yield[-1][0]
In [34]:
import sygma as s;reload(s)
msp=s.sygma(iolevel=0,iniZ=0.0001,dt=6e7,mgal=1e11,starbursts=[0.1,0.2],tend=13e9,special_timesteps=30,imf_type='kroupa',imf_bdys=[0.1,100],sn1a_on=False)
In [35]:
mw=s.sygma(iolevel=0,dt=6e7,mgal=1e11,tend=13e9,special_timesteps=30,imf_type='kroupa',imf_bdys=[0.1,100],sn1a_rate='maoz',galaxy='milky_way')
In [15]:
reload(s)
mw=s.sygma(yield_interpolate='ini_corr',iolevel=0,dt=6e7,mgal=1e11,tend=13e9,special_timesteps=30,imf_type='kroupa',imf_bdys=[0.1,100],sn1a_rate='maoz',galaxy='milky_way')
In [16]:
reload(s)
mw=s.sygma(iolevel=0,dt=6e7,mgal=1e11,tend=13e9,special_timesteps=30,imf_type='kroupa',imf_bdys=[0.1,100],sn1a_rate='maoz',galaxy='milky_way',hardsetZ=0.0001,iniZ=-1,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 [17]:
mw=s.sygma(iolevel=0,dt=6e7,mgal=1e11,tend=13e9,special_timesteps=30,imf_type='kroupa',imf_bdys=[0.1,100],sn1a_rate='maoz',galaxy='milky_way',hardsetZ=0.0001,iniZ=-1,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 [18]:
import sygma as s;reload(s)
mw=s.sygma(iolevel=0,dt=6e7,mgal=1e11,tend=13e9,special_timesteps=30,imf_type='kroupa',imf_bdys=[0.1,100],sn1a_rate='maoz',galaxy='milky_way',hardsetZ=0.0001,iniZ=-1,table='yield_tables/isotope_yield_table_h1.txt',sn1a_on=True, sn1a_table='yield_tables/sn1a_h1.txt', iniabu_table='yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn')
In [19]:
mw=s.sygma(iolevel=0,dt=6e7,mgal=1e11,tend=13e9,special_timesteps=30,imf_type='kroupa',imf_bdys=[0.1,100],sn1a_rate='maoz',galaxy='milky_way',hardsetZ=0.0001,iniZ=0.0001)
In [19]: