Regression test suite: Test of scaling of yields below Z=1e-4

Yields of 1e-5 and 1e-6 as a input for SYGMA can be calculated by scaling down the yields fromm Z=1e-4. SYGMA is doing it in the read_yields.py. You can find the documentation here.

Run this to set up the environment:


In [1]:
#mpld3.enable_notebook()
#%pylab

In [1]:
s1=s.sygma(iniZ=0.0001,dt=7e6,tend=1e9)


################    Start SYGMA simulation   ##############
################    Simulation successful    ##############
Run time:  3 s

In [11]:
s1.history.isotopes[:10]


Out[11]:
['H-1', 'H-2', 'He-3', 'He-4', 'Li-7', 'B-11', 'C-12', 'C-13', 'N-14', 'N-15']

In [12]:
s1.history.isotopes.index('Li-6')


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-12-ca3523868d60> in <module>()
----> 1 s1.history.isotopes.index('Li-6')

ValueError: 'Li-6' is not in list

In [13]:
len(s1.history.ism_iso_yield[0])


Out[13]:
280

In [10]:
np.array(s1.history.ism_iso_yield[0])/1e11


Out[10]:
array([  7.51359709e-01,   1.45766611e-05,   4.12478128e-05,
         2.48484466e-01,   7.61193199e-14,   2.85845873e-12,
         1.25030639e-05,   4.15985222e-08,   1.05975990e-06,
         4.17447022e-09,   7.40903727e-05,   3.81649810e-09,
         2.17301408e-08,   5.61599601e-10,   5.75334396e-06,
         4.57939041e-09,   1.47155737e-07,   4.00314227e-08,
         1.51170676e-06,   7.74004466e-08,   8.85597912e-08,
         6.48689627e-08,   1.51252281e-06,   3.92292660e-08,
         2.67518353e-08,   7.11270642e-09,   2.80024754e-12,
         3.09243003e-12,   1.09302238e-06,   3.26774676e-09,
         1.89212440e-08,   8.08024653e-11,   6.82722558e-09,
         2.30786501e-09,   1.63801677e-07,   1.57556277e-08,
         2.65257876e-11,   3.90323236e-09,   5.00961138e-13,
         2.96132659e-10,   1.20570394e-07,   5.06788510e-10,
         1.08261842e-10,   1.71174934e-09,   3.43155538e-12,
         1.67400223e-10,   5.41858266e-11,   3.23468746e-10,
         2.97967453e-10,   5.37650112e-09,   2.25936424e-10,
         2.20999837e-10,   1.01639317e-12,   4.14149914e-10,
         8.27280837e-10,   1.65907543e-08,   1.91734424e-09,
         4.86231399e-10,   1.09909664e-08,   8.12552563e-08,
         1.32277574e-06,   3.10941724e-08,   4.21066113e-09,
         3.99507743e-09,   5.71611495e-08,   2.27776267e-08,
         1.00662979e-09,   3.26219225e-09,   8.57583683e-10,
         6.60627470e-10,   3.03741211e-10,   1.13176806e-09,
         6.69609071e-10,   9.98922623e-11,   4.63642644e-10,
         1.57820320e-11,   4.55463769e-11,   3.11041571e-11,
         5.16182221e-11,   6.91654589e-11,   1.95634097e-11,
         9.23675091e-11,   1.96468598e-11,   1.43131246e-11,
         1.19896545e-12,   1.29730154e-11,   1.07145258e-11,
         3.37935264e-11,   7.23279473e-11,   1.30482128e-11,
         1.39055541e-11,   1.38716601e-11,   3.90369935e-13,
         2.57702776e-12,   1.32072673e-11,   1.32535819e-11,
         6.60791947e-11,   2.04622087e-11,   1.28357467e-11,
         5.06730945e-12,   3.23090139e-13,   5.84980762e-12,
         4.44711246e-12,   5.01530152e-11,   1.23044781e-11,
         1.53574093e-11,   3.38706510e-12,   5.23147117e-12,
         5.41814739e-12,   8.91142837e-13,   1.90176188e-12,
         1.01340652e-12,   6.45331870e-13,   1.12290389e-12,
         1.18857308e-12,   6.88145319e-13,   1.75593639e-12,
         7.15249052e-13,   2.92826882e-13,   1.00800362e-13,
         6.95164487e-13,   6.93413080e-13,   9.48360790e-13,
         1.77132755e-12,   1.06588298e-12,   1.05562682e-12,
         4.24495932e-14,   4.72706658e-13,   9.56645893e-13,
         1.18200329e-12,   1.16596841e-12,   5.26009377e-13,
         7.84720969e-13,   7.42665722e-13,   6.35168669e-14,
         4.60772924e-14,   6.58609988e-13,   6.81092562e-13,
         1.29553316e-12,   6.61946421e-13,   1.57005066e-12,
         4.16498073e-13,   2.60619201e-14,   5.92021421e-13,
         1.22211041e-13,   8.44235199e-14,   4.38097453e-14,
         1.89485548e-12,   1.00923898e-12,   3.21205613e-12,
         1.14804907e-12,   4.39520131e-12,   6.34629419e-13,
         8.06674677e-13,   6.32343823e-13,   4.80717727e-13,
         1.62976756e-14,   4.49269760e-13,   1.58002569e-13,
         8.44853393e-13,   1.26246860e-12,   3.37830443e-12,
         5.73804940e-12,   6.21613435e-12,   1.46041710e-12,
         2.21148799e-14,   1.95102016e-14,   3.94628114e-13,
         4.89737582e-12,   7.87210090e-13,   3.94821668e-12,
         4.81052556e-12,   1.78959647e-12,   1.47974483e-12,
         1.42733143e-12,   1.81594299e-14,   1.76371185e-14,
         4.27616681e-13,   1.17496291e-12,   1.41009280e-12,
         2.03165916e-12,   1.30636752e-11,   1.60551492e-15,
         1.79182755e-12,   8.38928680e-15,   1.14875125e-14,
         4.10671110e-12,   5.23397840e-13,   6.91659429e-13,
         9.92867510e-13,   4.48758753e-13,   8.83404737e-13,
         3.09827016e-13,   6.45351524e-13,   2.18699000e-13,
         2.17020502e-13,   3.68684405e-14,   1.83607599e-13,
         1.38587608e-13,   1.71527174e-13,   9.22140870e-14,
         3.38619751e-13,   2.91886151e-13,   2.03783436e-13,
         2.25398965e-13,   2.94984247e-15,   3.21240034e-14,
         2.19412181e-13,   3.05379054e-13,   2.35037485e-13,
         3.75309186e-13,   3.34589924e-13,   2.76738966e-13,
         1.00458298e-15,   1.74422099e-15,   4.30535562e-14,
         3.50098777e-13,   4.75224325e-13,   4.66724007e-13,
         5.31633223e-13,   4.24773225e-13,   1.61030733e-15,
         1.91457808e-14,   4.04808655e-13,   2.77839325e-13,
         3.26554133e-13,   1.84154323e-13,   1.85592274e-13,
         1.58462252e-15,   3.74969285e-14,   1.77172987e-13,
         2.72430277e-13,   2.02466726e-13,   4.01845469e-13,
         1.62943309e-13,   1.82953841e-13,   4.88065789e-15,
         1.23235960e-15,   4.03981711e-14,   1.43911783e-13,
         2.12325049e-13,   1.06606341e-13,   2.76092619e-13,
         2.43136861e-17,   1.98745975e-13,   8.40238375e-16,
         1.87916912e-13,   1.02064134e-13,   2.19690337e-13,
         2.06015719e-13,   1.04880149e-13,   1.77461033e-13,
         7.11469362e-16,   5.78340696e-14,   6.00366718e-14,
         4.87799814e-13,   5.97900010e-13,   9.77473992e-13,
         1.53408167e-12,   1.35859263e-12,   2.31042534e-12,
         1.00936927e-15,   5.85527850e-14,   2.49203620e-12,
         2.57057231e-12,   1.92773429e-12,   5.52666370e-13,
         1.08427493e-12,   3.01208935e-15,   1.97672570e-13,
         3.36293577e-13,   4.62636566e-13,   2.65349093e-13,
         6.04168381e-13,   1.40263250e-13,   3.22362432e-13,
         7.77084591e-13,   2.93364127e-13,   8.85772295e-12,
         8.72608573e-13])

1.) Test of scaling

Start the simulation by executing the following line. You create a single stellar population out of a gas cloud of $10^{11}M_{\odot}$ and a metallicity of $Z=10^{-4}$ ([Fe/H]=-2.3) and let it evolve over $10^{10}$ years. AGB, massive stars with SN2 as well as SN1a eject their material into the ISM.


In [2]:
s1=s.sygma(iniZ=0.0001,dt=7e6,tend=1e9)
s2=s.sygma(iniZ=0.00001,dt=7e6,tend=1e9)
s3=s.sygma(iniZ=0.000001,dt=7e6,tend=1e9)


################    Start SYGMA simulation   ##############
################    Simulation successful    ##############
Run time:  3 s
Use option to scale down abundance from Z=0.0001!
Only usable with elements (and their isotopes): H,He,C,N,O,Mg,Ca,Ti,Fe,Co,Zn
################    Start SYGMA simulation   ##############
################    Simulation successful    ##############
Run time:  2 s
Use option to scale down abundance from Z=0.0001!
Only usable with elements: H,He,C,N,O,Mg,Ca,Ti,Fe,Co,Zn
################    Start SYGMA simulation   ##############
################    Simulation successful    ##############
Run time:  2 s

2) Scaling to 0.00001, 0.000001

a) Standard case

For primary elements ('H','He','C','O','Mg','Ca','Ti','Fe','Co','Zn'):

He: discuss more here! recently added C,O,Mg: pre-exp Ca, : explosive O-burning (minor from freezout) Ti : explosive conditions (M=15-20Msun) Fe : dominant Fe56 produced mostly as Ni56, NSE Co : NSE Zn: Assume it comes all from alpha-rich freezout (~50% of solar value)

$m_{eject,i}(Z) =(P_i-1.)*(X_{ini,set,i}*Y_{tot,eject}) + (X_{ini,Z,i}*Y_{tot,eject}) $

if $m_{eject,i}(Z) < 0$ : $m_{eject,i}(Z) = 0 $

For secondary elements ('N'):

In our non-rotation models: N is secondary (CN cycle secondary, see HIF dir) but in rotating models primary.

$m_{eject,i}(Z) =(P_i-1.)*(X_{ini,Z,i}*Y_{tot,eject}) + (X_{ini,Z,i}*Y_{tot,eject}) $

+ for mass conservation, assume total mass lost is same as in case of Z=0.0001.

Alter H for that: $m_{eject,H}(Z)$ is reduced

Non-Standard case

For primary elements ('H','C','N','O','Mg','Ca','Ti','Fe','Co'):

N : becomes primary (w/ rotation)

For secondary elements ('Zn'):

Zn : from slope of observational data (Bisterzo06)

In [3]:
ele=['H','He','C','N','O','Mg','Ca','Ti','Fe','Co','Zn']
color=['r','b','g']
marker=['o','s','D']
label=['0.0001','0.00001','0.000001']
for e in range(len(ele)):
    s1.plot_mass(fig=e,yaxis=ele[e],color=color[0],marker=marker[0],label=label[0])
    s2.plot_mass(fig=e,yaxis=ele[e],color=color[1],marker=marker[1],label=label[1])
    s3.plot_mass(fig=e,yaxis=ele[e],color=color[2],marker=marker[2],label=label[2])
    plt.title(ele[e])



In [4]:
ele=['H','He','C','N','O','Mg','Ca','Ti','Fe','Co','Zn']
color=['r','b','g','k']
marker=['o','s','D','x']
label=['0.01','0.006','0.001','0.0001']
lim=[[1e9,1e10],[1e5,1e9],[1e4,1e8],[1e5,1e9],[1e4,1e8],[1e2,1e8],[1e1,1e7],[1e1,1e8],[1e1,1e8],[1e1,1e8]]
for e in range(len(ele)):
    s1.plot_mass_range_contributions(fig=e,specie=ele[e],color='r',prodfac=False,label='0.0001')
    s2.plot_mass_range_contributions(fig=e,specie=ele[e],color='g',prodfac=False,label='0.00001')
    s3.plot_mass_range_contributions(fig=e,specie=ele[e],color='b',prodfac=False,label='0.000001')
    plt.yscale('log')
    #plt.ylim(lim[e][0],lim[e][1])
    plt.title(ele[e])


Test for primary and secondary behavior

N is different (sec), T strange metallicity trend


In [5]:
s00=s.sygma(iniZ=0.01,dt=7e6,tend=1e9)
s11=s.sygma(iniZ=0.006,dt=7e6,tend=1e9)
s22=s.sygma(iniZ=0.001,dt=7e6,tend=1e9)
s33=s.sygma(iniZ=0.0001,dt=7e6,tend=1e9)


################    Start SYGMA simulation   ##############
################    Simulation successful    ##############
Run time:  3 s
################    Start SYGMA simulation   ##############
################    Simulation successful    ##############
Run time:  3 s
################    Start SYGMA simulation   ##############
################    Simulation successful    ##############
Run time:  3 s
################    Start SYGMA simulation   ##############
################    Simulation successful    ##############
Run time:  3 s

In [6]:
ele=['H','C','N','O','Mg','Ca','Ti','Fe','Co','Zn']
color=['r','b','g','k']
marker=['o','s','D','x']
label=['0.01','0.006','0.001','0.0001']
for e in range(len(ele)):
    s00.plot_mass(fig=e,yaxis=ele[e],color=color[0],marker=marker[0],label=label[0])    
    s11.plot_mass(fig=e,yaxis=ele[e],color=color[1],marker=marker[1],label=label[1])
    s22.plot_mass(fig=e,yaxis=ele[e],color=color[2],marker=marker[2],label=label[2])
    s33.plot_mass(fig=e,yaxis=ele[e],color=color[3],marker=marker[3],label=label[3])
    plt.title(ele[e])


N production:


In [7]:
s00.plot_mass_range_contributions(specie='N',color='k',prodfac=False,label='0.01')
s11.plot_mass_range_contributions(specie='N',color='r',prodfac=False,label='0.006')
s22.plot_mass_range_contributions(specie='N',color='g',prodfac=False,label='0.001')
s33.plot_mass_range_contributions(specie='N',color='b',prodfac=False,label='0.0001')
plt.yscale('log')
plt.ylim(1e5,1e8)


Out[7]:
(100000.0, 100000000.0)
What happens to N production in massive stars at 0.0001? Why is it dominating (in 0.001 case HBB dominates)?; High N production factors in the M20,M25 models, coming from the pre-exp (ingestion) and decay after explosion in the M20 (about the same) and in the M25 (exp contribution dominates).

Zn production:


In [8]:
s00.plot_mass_range_contributions(specie='Zn',color='k',prodfac=False,label='0.01')
s11.plot_mass_range_contributions(specie='Zn',color='r',prodfac=False,label='0.006')
s22.plot_mass_range_contributions(specie='Zn',color='g',prodfac=False,label='0.001')
s33.plot_mass_range_contributions(specie='Zn',color='b',prodfac=False,label='0.0001')
plt.yscale('log')
plt.ylim(1e1,1e8)


Out[8]:
(10.0, 100000000.0)

Looks secondary for massive stars and AGB stars! Where is Zn coming in the M12,M15 models? seems to be primary in thoses cases. Large difference in mass cut!

Primary or secondary component visible from total contribution?


In [9]:
ele=['H','C','N','O','Mg','Ca','Ti','Fe','Co','Zn']
color=['r','b','g','k']
marker=['o','s','D','x']
label=['0.01','0.006','0.001','0.0001']
lim=[[1e9,1e10],[1e5,1e9],[1e4,1e8],[1e5,1e9],[1e4,1e8],[1e2,1e8],[1e1,1e7],[1e1,1e8],[1e1,1e8],[1e1,1e8]]
for e in range(len(ele)):
    s00.plot_mass_range_contributions(fig=e,specie=ele[e],color='k',prodfac=False,label='0.01')
    s11.plot_mass_range_contributions(fig=e,specie=ele[e],color='r',prodfac=False,label='0.006')
    s22.plot_mass_range_contributions(fig=e,specie=ele[e],color='g',prodfac=False,label='0.001')
    s33.plot_mass_range_contributions(fig=e,specie=ele[e],color='b',prodfac=False,label='0.0001')
    plt.yscale('log')
    plt.ylim(lim[e][0],lim[e][1])
    plt.title(ele[e])


Difficult to distinguish between prim and second because mini+m_prim; if mini>m_prim then decrease even though its primary.


In [9]: