Regression test suite: Test of MSP (multiple stellar populations/continous SFR) GCE features

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.

Results:

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()

Only AGB and massive stars


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


0.0110631843892

Do 1 star burst with starbursts=[0.1]


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)


################    Start SYGMA simulation   ##############
Use specified tables as input
Note that table, sn1a_table iniabu_table and pop3_table have to be specified as an input
/home/christian/NuGrid/SYGMA_PROJECT/SYGMA/yield_tables/popIII_heger10.txt
correct for isotopes
Use initial abundance of  yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn
################    Simulation successful    ##############
Run time: 1.44s

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]


0.0110631843892
[0.3, 0.0, 0.0, 0.0, 0.0]

Another starburst


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


################    Start SYGMA simulation   ##############
Use specified tables as input
Note that table, sn1a_table iniabu_table and pop3_table have to be specified as an input
/home/christian/NuGrid/SYGMA_PROJECT/SYGMA/yield_tables/popIII_heger10.txt
correct for isotopes
Use initial abundance of  yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn
################    Simulation successful    ##############
Run time: 1.47s

In [27]:
ssp2.history.mgal/1e11,Yield_tot_sim2/1e11


Out[27]:
(0.70092519382748564, 0.015508929324638404)

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


Pristine gas after secodn burst: 28037007753.1
0.0265721137138

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


ISM after first burst 0.700925193827
0.0110631843892 0.0155089293246

Do two star bursts at once


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


################    Start SYGMA simulation   ##############
Use specified tables as input
Note that table, sn1a_table iniabu_table and pop3_table have to be specified as an input
/home/christian/NuGrid/SYGMA_PROJECT/SYGMA/yield_tables/popIII_heger10.txt
correct for isotopes
Use initial abundance of  yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn
################    Simulation successful    ##############
Run time: 1.52s
2657211371.38

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


After second burst 0.279444883704
0.3 0.420555116296
0.306016997417
[0.3, 0.6, 0.0, 0.0, 0.0]
[30000000000.0, 42055511629.649139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

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


SSP combination 0.0265721137138
Sim 0.0265721137138
Ejecta from stars only with hand calc: 0.0265721137138
Should be 1: 1.0
##############################
ratio should be 1 :  1.0
ratio should be 1 :  1.0

With SNIa


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]


################    Start SYGMA simulation   ##############
Use specified tables as input
Note that table, sn1a_table iniabu_table and pop3_table have to be specified as an input
/home/christian/NuGrid/SYGMA_PROJECT/SYGMA/yield_tables/popIII_heger10.txt
correct for isotopes
Use initial abundance of  yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn
################    Simulation successful    ##############
Run time: 1.57s

Test the yield interpolation


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)


################    Start SYGMA simulation   ##############
correct for isotopes
interpolation necessary between  0.001  and  0.006  with ISM Z  0.001323
################    Simulation successful    ##############
Run time: 3.18s

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')


################    Start SYGMA simulation   ##############
correct for isotopes
Use SNIa tables from yield_tables/sn1a_t86.txt
interpolation necessary between  0.0001  and  0.001  with ISM Z  0.000204
interpolation necessary between  0.0001  and  0.001  with ISM Z  0.000213
interpolation necessary between  0.0001  and  0.001  with ISM Z  0.000238
interpolation necessary between  0.0001  and  0.001  with ISM Z  0.000272
interpolation necessary between  0.0001  and  0.001  with ISM Z  0.000311
interpolation necessary between  0.0001  and  0.001  with ISM Z  0.000357
interpolation necessary between  0.0001  and  0.001  with ISM Z  0.000415
interpolation necessary between  0.0001  and  0.001  with ISM Z  0.000483
interpolation necessary between  0.0001  and  0.001  with ISM Z  0.000562
interpolation necessary between  0.0001  and  0.001  with ISM Z  0.000658
interpolation necessary between  0.0001  and  0.001  with ISM Z  0.000774
interpolation necessary between  0.0001  and  0.001  with ISM Z  0.000914
interpolation necessary between  0.001  and  0.006  with ISM Z  0.001082
interpolation necessary between  0.001  and  0.006  with ISM Z  0.00136
interpolation necessary between  0.001  and  0.006  with ISM Z  0.001685
interpolation necessary between  0.001  and  0.006  with ISM Z  0.002105
interpolation necessary between  0.001  and  0.006  with ISM Z  0.002657
interpolation necessary between  0.001  and  0.006  with ISM Z  0.003352
interpolation necessary between  0.001  and  0.006  with ISM Z  0.004203
interpolation necessary between  0.001  and  0.006  with ISM Z  0.005224
interpolation necessary between  0.006  and  0.01  with ISM Z  0.006432
interpolation necessary between  0.006  and  0.01  with ISM Z  0.008247
interpolation necessary between  0.01  and  0.02  with ISM Z  0.010216
interpolation necessary between  0.01  and  0.02  with ISM Z  0.012297
interpolation necessary between  0.01  and  0.02  with ISM Z  0.014694
interpolation necessary between  0.01  and  0.02  with ISM Z  0.01747
################    Simulation successful    ##############
Run time: 17.56s

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')


################    Start SYGMA simulation   ##############
correct for isotopes
Use SNIa tables from yield_tables/sn1a_t86.txt
correct initial abundace of input 0.0001  for ISM Z  0.000204
correct initial abundace of input 0.0001  for ISM Z  0.000213
correct initial abundace of input 0.0001  for ISM Z  0.000238
correct initial abundace of input 0.0001  for ISM Z  0.000271
correct initial abundace of input 0.0001  for ISM Z  0.00031
correct initial abundace of input 0.0001  for ISM Z  0.000356
correct initial abundace of input 0.0001  for ISM Z  0.000412
correct initial abundace of input 0.0001  for ISM Z  0.000479
correct initial abundace of input 0.0001  for ISM Z  0.000557
correct initial abundace of input 0.0001  for ISM Z  0.00065
correct initial abundace of input 0.0001  for ISM Z  0.000762
correct initial abundace of input 0.0001  for ISM Z  0.000896
correct initial abundace of input 0.001  for ISM Z  0.001057
correct initial abundace of input 0.001  for ISM Z  0.001333
correct initial abundace of input 0.001  for ISM Z  0.001661
correct initial abundace of input 0.001  for ISM Z  0.00209
correct initial abundace of input 0.001  for ISM Z  0.002661
correct initial abundace of input 0.001  for ISM Z  0.00339
correct initial abundace of input 0.001  for ISM Z  0.004296
correct initial abundace of input 0.001  for ISM Z  0.005412
correct initial abundace of input 0.006  for ISM Z  0.006778
correct initial abundace of input 0.006  for ISM Z  0.008241
correct initial abundace of input 0.006  for ISM Z  0.009946
correct initial abundace of input 0.01  for ISM Z  0.011905
correct initial abundace of input 0.01  for ISM Z  0.014354
correct initial abundace of input 0.01  for ISM Z  0.017175
################    Simulation successful    ##############
Run time: 22.04s

Test of the galaxy='milky_way' setting


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')


################    Start SYGMA simulation   ##############
Use specified tables as input
Note that table, sn1a_table iniabu_table and pop3_table have to be specified as an input
/home/christian/NuGrid/SYGMA_PROJECT/SYGMA/yield_tables/popIII_heger10.txt
correct for isotopes
Use initial abundance of  yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn
################    Simulation successful    ##############
Run time: 3.03s

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')


################    Start SYGMA simulation   ##############
Use specified tables as input
Note that table, sn1a_table iniabu_table and pop3_table have to be specified as an input
/home/christian/NuGrid/SYGMA_PROJECT/SYGMA/yield_tables/popIII_heger10.txt
correct for isotopes
Use initial abundance of  yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn
################    Simulation successful    ##############
Run time: 2.87s

With SNIa Maoz


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')


################    Start SYGMA simulation   ##############
Use specified tables as input
Note that table, sn1a_table iniabu_table and pop3_table have to be specified as an input
/home/christian/NuGrid/SYGMA_PROJECT/SYGMA/yield_tables/popIII_heger10.txt
correct for isotopes
Use SNIa tables from yield_tables/sn1a_h1.txt
Use initial abundance of  yield_tables/iniabu/iniab1.0E-04GN93_alpha_h1.ppn
################    Simulation successful    ##############
Run time: 16.5s

With default mode; composition


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)


################    Start SYGMA simulation   ##############
correct for isotopes
Use SNIa tables from yield_tables/sn1a_t86.txt
################    Simulation successful    ##############
Run time: 17.82s

In [19]: