our universe starts with hydrogen ( h ) , helium ( he ) and a small amount of lithium ( li ) .
these elements are synthesized during the big bang and all the other elements equal to or heavier than carbon ( c ) are synthesized in stars and during supernovae . in astrophysics , the history of heavy element generation via the nucleosynthesis in stars and succeeding pollution of the interstellar medium ( ism ) are expressed as `` chemical evolution '' .    during stellar evolution , nucleosynthesis progresses from h to iron ( fe ) where the final products depend on the mass of a star .
the massive stars heavier than @xmath0 are thought to explode as type ii supernovae ( hereafter sne ii ) . in this phase ,
heavy elements ( @xmath1 fe ) are synthesized .
if a star is not so massive , say @xmath2 , it experiences an asymptotic giant branch ( agb ) phase after the main sequence phase . during the agb phase , the neutron capture process takes place with a slow speed ( slow means that the timescale of the @xmath3 decay , @xmath4 , is comparable to that of the neutron capture , @xmath5 ) .
this slow process ( @xmath6-process ) generates elements heavier than fe efficiently .
in addition , a part of the intermediate mass stars binary systems is thought to explode as a type ia sne ( hereafter sne ia ) .
sne ia are triggered by the roche - lobe overflows or the final coalescences of binary systems . in the former situation , one of the progenitor star in a binary is a degenerated star and , in the latter , both are degenerated stars .
thus , these two scenarios are called single - degenerate or double - degenerate scenarios @xcite . again , heavier elements are synthesized , such as fe and nickel ( ni ) .
numerical studies tell us that neutron star - neutron star mergers ( nsms ) could be a possible site of @xmath7-process ( @xmath8 ) elements , in particular , the heavier r - process elements ( e.g. , * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
each process has its own characteristic time - scale and abundance pattern .
thus , they work as the chronometer for the formation history of the galactic stellar system . for instance , in an early phase ( @xmath9 ) , the chemical evolution progresses mainly through the pollution by sne ii . with this process , the @xmath10 elements of which the masses are multiples of he , such as oxygen ( o ) , magnesium ( mg ) , silicon ( si ) , and calcium ( ca ) ,
are ejected to the interstellar medium ( ism ) . on the other hand , in sne ia ,
fe , and ni are efficiently released to the ism .
the combination of these events makes the observed features of the plateau ( flat part ) of the [ @xmath10/fe ] as a function of [ fe / h ] \equiv \log_{10 } ( n_{\rm a}/n_{\rm b } ) - \log_{10 } ( n_{\rm a}/n_{\rm b})_{\odot}$ ] , where @xmath11 and @xmath12 are the number abundance of element a and b , respectively . ] in a low metallicity part , and causes the distribution of [ @xmath10/fe ] as a function of [ fe / h ] ( e.g. , * ? ? ?
the flat part represents the abundance pattern of sne ii .
the decreasing part is composed of the mixture of sne ii and sne ia where the contribution of sne ii is gradually decreasing , reflecting its time - scale , and that of sne ia is gradually increasing .
the breaking point of the flat part reflects the time scale of the enrichment of the chemical composition in the ism .
the breaking point is [ fe / h ] @xmath13 in the milky way galaxy ( e.g. , * ? ? ?
* ) , whereas it is much lower in the local dwarf galaxies ( e.g. , * ? ? ?
agbs do not mainly contribute to the distributions of [ @xmath10/fe]-[fe / h ] relations while they can contribute rather low mass elements such as c and nitrogen ( n ) .
there are many galactic surveys which resolve the chemical compositions and kinematic information of a lot of stars , e.g. , rave @xcite , apogee @xcite , gaia - eso @xcite , hermes ( grash ) @xcite .
the data obtained by these surveys can make a strong constraint on the formation and evolution of the milky way galaxy and thus , it becomes a clue to understanding the formation and evolution of galaxies in general .
it has been almost a quarter of a century since the first 3-dimensional simulations of galaxy formation , including dark matter and baryon . the first galaxy formation simulation including chemical evolution
was carried out by @xcite . in this simulation
, they only solved the evolution of the metallicity @xmath14 , the mass fraction of the heavy elements , synthesized by sne ii .
then , @xcite introduced both sne ii and ia .
the models have improved further and the current concordance simulations include about 10 elements ( e.g. , * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ) , as well as the mixing of them in the ism @xcite .
semi - analytical models are also considered , in which various elements are released from different feedback models ( e.g. , * ? ? ?
? * ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
unlike solving the evolution of individual stars , simulations of galaxy formation use a simple stellar populations ( ssp ) approximation , where star particles consist of a cluster of stars sharing the same age and metallicity , and whose mass function follows a certain initial mass function ( hereafter imf ) .    in order to solve chemical evolution ,
the amount of newly synthesized elements in stars , `` yields '' , and the return mass fraction of ssp particles are necessary .
these data are obtained from the studies of stellar evolution and explosions .
there are flexibilities to choose yields tables as well as the functional forms of imf and its mass range .
the most popular yields for sne ii are @xcite and its improved version supplied by @xcite . for sne ia ,
the yields of @xcite and its updated version given by @xcite are well - used . for agbs ,
the yields tables of @xcite , @xcite , and @xcite are widely used .
the combinations of yields tables can lead to different chemical abundance patterns and thus it is intensively studied ( e.g. , * ? ? ? * ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
it is pointed out by the galactic chemical evolution model of @xcite that the fe yields of @xcite are slightly large in order to obtain good agreement with observations .
is too small . ]
usually the fe yield is reduced by a factor of 2 from the original values ( e.g. , * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
the yields tables of @xcite , which is an extended version of @xcite , also have the same problem .
sometimes ad hoc modifications are used to halve the yield of fe and double those of mg and c in order to fit the observations ( see * ? ? ?
since these yield tables are widely used in simulations of galaxy formation , these modifications are commonly used .    an essential solution to solve
this problem is to update the yields tables following the progress of stellar evolution models and reaction rates .
however , it might be difficult to update yields tables frequently since , in simulation code , the chemical evolution part is deeply connected to them .
moreover , the size and range of mass and metallicity grids of the yields tables are generally different from each other .
this inhibits the smooth replacement of yields tables , although it is a theoretically straightforward task .
if the chemical evolution part is implemented separately in a software library which can be linked from simulation codes directly and it has clearly defined application interfaces ( apis ) , the chemical evolution part is developed independently and it becomes easy to take the latest models .
insofar as we know , such software library does not exist .
there are several softwares which can generate stellar yields tables .
starburst99 is a widely - used software to model spectrophotometric properties of star - forming galaxies @xcite .
this software contains a huge database of stellar evolutions and thus , it can output yields .
since this software is not designed to link from other codes , it is necessary to pre - generate a yields table if one uses it in one s simulation code .
thus , when parameters change , e.g. , the functional form and the mass range of imf , the reconstruction of the yields table is necessary .
the nugrid collaboration has developed a python code , sygma , which can deal with the yields of the nugrid project and can be used in chemical evolution of galaxies @xcite .
since this is implemented as an ipython notebook , users need to pre - generate yields in order to use the outcomes from sygma .
the aim of this paper is to describe a software library which deals with chemical evolution via apis and to demonstrate the capability of this library .
this library is named `` celib '' after the term `` chemical evolution library '' .
since the primary purpose of this library is to use it with simulation codes of galaxy formation , this library works under the ssp approximation .
note that its main function is to return yields ( and energy ) of various feedback types from ssp particles .
redistribution of these quantities is not within its scope because there are a number of redistribution manners and the implementation of them is deeply coupled with simulation codes .
models and parameters of this library are selectable at the runtime and the imf weighted yields are automatically generated in the initialization process .
celib is an open - source software library and is released under the mit license .
the whole source codes including some examples are distributed through the following website : https://bitbucket.org/tsaitoh/celib .
a documentation is also available in this site .
the structure of this paper is as follows .
first , we briefly describe the design concept of this library in  [ sec : design ] .
then we describe the notations and definitions in  [ sec : notations ] and we introduce components which this library consists of in  [ sec : components ] .
the reference feedback models of sne ii / ia , agbs and nsms are described in  [ sec : modeling ] . in  [ sec : implementation ] , we explain our implementation of this library . in  [ sec : applications ] , we show the results of the simple one - zone model and galaxy simulation using this library . finally , we provide the summary in  [ sec : summary ] .
the key concepts of the design of celib are as follows .    * celib returns yields and energy from ssp particles , based on the adopted imf and yields tables .
all returned quantities are imf weighted ones .
useful data , such as the functional form of imf and stellar lifetimes , are also implemented .
* celib supplies reference feedback models of sne ii / ia , agbs and nsms .
reference feedback models can provide the event time and the amount of released mass , metal and energy .
a redistribution manner of these quantities is outside its scope . * the functional form of the imf , its mass ranges , yields tables , etc .
are changed by using control flags and parameters .
all changes of flags and parameters are reflected when the initializer of celib is called . * all communication between a user simulation code and celib is carried out through celib apis .
figure [ fig : concept ] shows the schematic picture of the relation between a user s simulation code and celib .
the simulation code deals with the time integration of a system solving gravitational interactions among dm , gas , and star ( ssp ) particles and hydrodynamics , involving baryon physics such as radiative cooling / heating , star formation , and feedbacks .
celib is responsible for the chemical evolution part .
event time , released energy and ejected metals are evaluated when the simulation code sends data of an ssp particle to celib via apis .
what the simulation code needs to do is to add the released energy and the ejected metals to the surrounding ism and to reduce the mass of the ssp particle so that the mass is conserved .
before explaining details of celib , we need to confirm the notations and what quantities are used and obtained by using the library .
we describe them in this section .
the primary purpose of this library is to calculate the stellar yields from various evolution phases of stars under the ssp approximation .
the stellar yield , the ejected mass of the @xmath15-th element from a star whose mass is @xmath16 , is expressed as @xmath17 where @xmath18 is the _ net yield _ which represents that the newly synthesized mass of @xmath15-th element , @xmath19 is the metallicity of the @xmath15-th element originally presented in the progenitor star and @xmath20 is the total ejecta mass of the star .
this quantity , @xmath21 , is always larger than or equal to zero .
the total ejecta mass is @xmath22 where @xmath23 is the remnant mass of a star whose mass is @xmath16 .
it is essential to use the net yields for the study of the galactic chemical evolution . rearranging eq .
, we can obtain @xmath24 we gather this quantity from the literature . however , some studies provide not @xmath25 but @xmath21 or @xmath26 where @xmath27 is the ejected mass of the @xmath15-th element via stellar winds . in such cases , we reconstruct @xmath28 carefully with several reasonable assumptions . this quantity can be positive and negative , unlike the stellar yield @xmath29 .
we use @xmath28 for sne ii and agbs , whereas we adopt @xmath29 for sne ia and nsms .
since this library is used under the ssp approximation , the imf weighted yield is useful . here , we use @xmath30 where @xmath31 is the imf function ( see below for the concrete functional forms ) . with this quantity and the return mass fraction , @xmath32 we can evaluate the yield of an ssp particle as @xmath33 by multiplying the mass of the ssp particle to eq .
, we can obtain the amount of the released mass of @xmath15-th element from a feedback event .
the imf weighted released amount of energy from massive stars can be evaluated by the following equation : @xmath34 where , @xmath35 is the released energy from a star whose mass is @xmath16 .
strictly speaking , the released mass of @xmath15-th element changes depending on the amount of the other elements .
the @xmath36 formulation @xcite is known as a model which considers the effect of the change in amounts of other elements .
we do not implement the @xmath36 formulation here in celib , for simplicity .
in this section , we describe key components of celib .
imfs which are pre - implemented are shown in
[ sec : imf ] .
the metallicity dependent stellar lifetimes are explained in  [ sec : lifetime ] .
then , thirteen elements in celib are explained in  [ sec : elements ] .
yields for sne ii / ia , agbs and nsms are described in  [ sec : snii ] ,  [ sec : snia ] ,  [ sec : agb ] , and  [ sec : nsm ] , respectively . released energy and return mass from an ssp particle with various imfs are summarized in  [ sec : misc ] . in  [ sec : abundance ] , the implemented solar abundance patterns are shown .
celib pre - implements seven popular imfs for ordinary population stars ( population i / ii ; hereafter pop i / ii ) and users can choose which one to use .
moreover , celib supports an imf for population iii ( hereafter pop iii ) stars , which is utilized only for extremely low metal ssps .
celib does not allow the functional form of the imf to be changed depending on the situation in a single simulation , except for the case using a pop iii imf . when the contribution of pop iii stars is adopted , the functional form of the imf and mass range are changed depending on metallicity .
the definition of the imf is @xmath37 where @xmath38 is the number of stars in a given mass bin ( @xmath39 ) .
the explicit functional forms of the imf users can choose will be explained below .
the normalization of the imf is done by the following equation : @xmath40 here , @xmath41 and @xmath42 are the lower and upper mass boundaries of the imf . substituting eq . into eq .
, we have @xmath43 thus , the normalization is `` the mass weighted number of stars '' . because of this definition
, the number of stars per @xmath44 of a given mass range ( @xmath45 ) can be calculated as @xmath46    the current version of celib supports seven well used imfs for pop
i / ii and one imf for pop iii stars .
they are the salpeter , diet salpeter , miller - scalo , kennicutt , kroupa(2001 & 1993 ) , chabrier , and susa imfs .
we describe the functional form of each imf below .
the salpeter imf @xcite is the most fundamental one which has a power law form with a single segment : @xmath47    the second imf is the diet salpeter imf .
the lower part of the imf is reduced to be a flat profile , whereas the higher part is the same as the original salpeter imf .
this imf is originally introduced in order to explain the observed mass - to - light ratio of disk galaxies @xcite .
the form of the diet salpeter imf is @xmath48    the miller - scalo imf @xcite has a power law form with three segments : @xmath49 the high ( low ) mass end has a deeper ( shallower ) power index when we compare it with that of the salpeter imf .
the functional form of the kroupa imf @xcite celib adopts is as follows : @xmath50 note that the minimum mass of a star which is followed by the original form of the kroupa s imf is @xmath51 , but we do not take them and adopt an imf greater than @xmath52 .
in addition to the kroupa imf @xcite , celib also has the imf of @xcite ( hereafter kroupa1993 imf ) .
the functional form of this imf is @xmath53 as is obvious , the slope of this imf in the mass regime at @xmath54 is steeper than that of the @xcite s imf .
@xcite has provided the imf with the following form : @xmath55    the final imf for ordinary populations of stars is the chabrier imf @xcite .
this imf has a rather complicated form since the lower part of it is expressed by a log - normal function .
the values of the normalization parameters are given by @xcite .
the functional form of the imf is @xmath56 ^ 2}{2 \sigma^2 } \right \ }    \\ \hspace{1 cm } 0.1~{m_{\odot } } < m < 1~{m_{\odot } } , \\
m^{-1.3 } \\ \hspace{1 cm } 1~{m_{\odot } } < m < 100~{m_{\odot } } , \end{cases}\ ] ] where @xmath57 and @xmath58 .    for the imf of pop iii stars ,
we use the following function : @xmath59 ^ 2 } { 2 \sigma_{\rm popiii}^2 } \right \ }   \\ & \hspace{1 cm } 0.7~{m_{\odot } } < m < 300~{m_{\odot } } , \nonumber\end{aligned}\ ] ] where @xmath60 and @xmath61 .
this functional form is evaluated by using the eye - ball fitting of the mass distribution of @xcite ( their figure 9 ) .
this imf is used only when the pop iii mode turns on .
it should be noted that there is no consensus on the shape of the pop iii imf and other researchers obtain different functional forms of pop iii imfs ( e.g. , * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
it is formally not difficult to extend this library to use other functional forms for pop iii stars .
the normalization coefficient of each imf for the given mass range is evaluated at the initialization phase of the library following eq . .
the contributions of the lower and upper mass boundaries of pop i / ii imfs are not crucial for the whole evolution of a system . for the lower mass boundary
, we adopted @xmath52 for all these imfs for simplicity .
there are some variations , but the contribution of the lower mass limit is almost negligible because of their long lifetimes ( see  [ sec : lifetime ] ) . for the upper mass boundary
, we assumed @xmath62 for the chabrier imf and @xmath63 for the others .
this difference is , again , negligible , because the contribution of massive stars is insignificant due to steeply decreasing profiles .
note that the lower and upper mass ends of the imf are changeable from the fiducial ones in this library .    for pop iii stars ,
we adopt an entirely different mass range , @xmath64@xmath65 , reflecting the potential difference in formation of pop iii stars from ordinary stars due to their inherent cooling processes ( e.g. , * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
? * ; * ? ? ?
* ) .    in figure
[ fig : imfs ] , we compare the shapes of these seven imfs .
for ordinary populations , we can see that stars with masses of @xmath66 dominate in the six imfs except for the salpeter imf ; it has many more low - mass stars .
we also find a substantial variation at the high mass end ; high mass end pop i / ii stars make the largest contribution in the chabrier imf , and the smallest in the miller - scalo and kroupa1993 imfs .
these differences reflect the amount of energy released by sne ii ( see  [ sec : modeling : snii ] and table [ tab : sniienergy ] ) .
the pop iii imf has a peak at @xmath67 which surely follows the mass spectrum of the pop iii in @xcite .
it is noted that the very massive stars ( @xmath68 ) with @xmath69 results in pair - creation instability sne @xcite and so far there is no clear relic which predicts the existence of the pair - creation instability sne @xcite . with our pop
iii imf , the contribution of the pair - creation instability sne is negligible and thus , there is no discrepancy .
there is a possibility that the imf is not universal .
for instance , the top - heavy imf is favored to obtain a sufficient number of faint sub - mm galaxies in semi - analytical models @xcite ( see also * ? ? ? * which does not require a top - heavy imf to reproduce the number count of sub - mm galaxies ) .
also , it is used in galaxy formation simulations @xcite . as is described in the above studies ,
the top - heavy imf is utilized for a case with violent events such as mergers and when strong shocks take place .
recent observations indicate that imf slopes alter depending on host galaxy mass @xcite .
@xcite reported that there is a tension between binary population synthesis results and observed agb stars in the galactic halo if the present - day imf is applied . in the current version of celib
, the imf does not allow situation - dependent changes to its slopes and mass range , except for in the case of extremely metal poor stars .      in this library
, we adopt the metallicity dependent lifetime table provided by @xcite ( see their table 14 ) .
the definition of the lifetime in @xcite is the sum of the h - burning and he - burning time scales of the stellar tracks of the padova library .
the lifetimes depend slightly on the stellar metallicity .
their table covers stars from @xmath70 to @xmath71 and from @xmath72 to @xmath73 .
note that we use the linear interpolation in @xmath14 and the lifetime of @xmath72 ( @xmath73 ) if the metallicity is below ( above ) the value .
it is also worth noting that there are other stellar lifetime data : both analytical forms ( e.g. , * ? ? ?
* ; * ? ? ?
* ) and grid data @xcite
. the differences between them are not so large .    for pop iii stars ,
we need the lifetime of stars @xmath74 .
unfortunately , the lifetime table of @xcite did not provide the lifetime of this mass range . here ,
we use the lifetime data obtained by @xcite .
he calculated the lifetime of the pop iii stars within a mass range of @xmath75 . to make the lifetime data of @xmath69 stars , we combine the @xcite s lifetime data of @xmath72 and the @xcite s lifetime data of @xmath69 .
we employ the @xcite s lifetime data to less than @xmath71 stars whereas we adopt the @xcite s lifetime data of @xmath76@xmath65 stars . with these two sets of data
, we can cover the full range of pop iii stars ( @xmath64@xmath65 ) .
figure [ fig : lifetime ] shows the stellar lifetime as a function of mass . here
, we interpolate both mass and metallicity and the linear interpolation is used for this process .
apparently , the curve of the lifetime is not smooth .
these `` bumps '' come from the original data , and they will propagate other quantities .
thus , instead of using this data , we make polynomial functions using the least square method and use them as the fiducial ones .
the procedure is described below .
we assume that the lifetime distribution function can be described using the following polynomial function : @xmath77 ^k , \label{eq : lifetime : polynomial}\ ] ] where @xmath78 is the mass of stars in units of @xmath79 , @xmath80 is the lifetime of a star with @xmath78 in the unit of year , and @xmath81 , is the coefficient of @xmath82-th power of @xmath83 .
coefficients are summarized in table [ tab : lifetime : polynomial ] .
the first three coefficients for @xmath84 ( 9.99 , -3.55 , 2.60 ) are not far from those found in the other fitting formula for the stellar lifetime of eq .
( 5 ) in @xcite ( 10 , -4.319 , 1.543 ) which was based on @xcite and @xcite .    using the five fitted functions and the results of their interpolations in the direction of the metallicity ( we use the linear interpolation ) ,
we obtain smoothed lifetime distribution functions .
we show the lifetime distributions of five representative metallicities in figure [ fig : lifetime : polynomial ] .
the typical difference between the original and the smoothed lifetimes at a given mass is less than @xmath85 .
celib adopts these smoothed lifetime distribution functions as the fiducial ones .
.coefficients of stellar lifetime distribution functions used in eq . .
[ cols="^,^,^,^,^,^,^ " , ]      +    @xmath86 note that the modifications for the yields of c , mg , and fe are applied .
see also section [ sec : snii ] .
figure [ fig : chemodyn : disks ] displays the face - on and edge - on maps of the surface stellar density of runs a , b , c and d at @xmath87 . when we compare the results with the yields tables of @xcite and @xcite and without agbs , i.e. , runs a and b , we see that the stellar disk of run a is more compact and thicker than that of run b. the reason for this difference is that there is a relatively smaller amount of energy release from sne ii in run a compared to run b , as is expected from table [ tab : sniienergy ] . with this less efficient feedback , a dissipation - less nature is emphasized further .
to clarify the contribution of agbs , we turn on the agb feedback , which is mainly the mass recycling processes involving newly synthesized metals ( runs c and d ) .
we see from figure [ fig : chemodyn : disks ] that the stellar disk becomes larger in the radial direction .
the return mass via agbs enhances the late epoch star formation , resulting in the extended disk .
reflecting the fact that run c forms more stars , the contribution of agbs is also more prominent , resulting in a larger disk compared to that in run d.    the impacts of the pop iii imf ( run e ) and hne ( runs f and g ) on galactic structures are found in figure [ fig : chemodyn : disks : efg ] . with the pop iii imf and @xcite s yields table , the released energy due to sne
ii increases @xmath88 times larger than that without the pop iii imf ( see table [ tab : sniienergy ] ) .
thus there are striking effects on the galactic structure .
when we use the pop iii imf , the initial burst of star formation is suppressed significantly ( we argue it below ) . in this case , the stellar disk becomes smaller because the initial burst induced by the pop iii feedback removes the gas component from the galaxy .
as is expected , the model with hne ( @xmath89 ) is almost no difference from the run without hne ( run c ) .
the model with hne ( @xmath90 ) , on the other hand , has large impacts on the galactic structure since the amount of the released energy with @xmath90 is about four times larger than that with @xmath91 ( see table [ tab : sniienergy ] ) .
this larger feedback energy results in the strong suppression of star formation and the removal of the log - angular momentum gas ( e.g. , * ? ? ?
the disk becomes much smaller compared to runs c and f.    figure [ fig : chemodyn : disks : hijk ] shows the runs involving both hne ( @xmath92 and @xmath93 ) and the pop iii imf , without and with metal mixing ( runs h , i , j , and k ) . in the model with the metal mixing (
run j ) , metals spread to the surrounding ism and the radiative cooling becomes more efficient compared to that without mixing ( run h ) .
thus , the star formation is significantly enhanced and the disk size becomes larger when the metal mixing is involved . in the models with @xmath90 ( runs i and k ) , the difference is hard to see because of their strong feedback .
note that these models are not models of a realistic galaxy formation through hierarchical mergers and hence , the contribution of metal mixing might be more complicated in the realistic model .
we will study this in the future .
star formation rates ( sfrs ) as a function of time for all runs are shown in figure [ fig : chemodyn : sfr ] .
all of the models shown the upper panel have strong initial bursts of star formation and then they rapidly quench .
the duration of the initial starburst depends on the adopted yields tables and model parameters .
models whose released energy are large have shorter duration times : the duration time of the initial starburst of run b ( d ) is shorter than that of run a ( c ) .
we find the contribution of agbs is easily seen in run c while not in run d. the reason why the run d does not show the enhancement of star formation at the late stage would be non - linear effects .
the bottom panel of figure [ fig : chemodyn : sfr ] summarizes star formation histories with pop iii / hne / metal mixing .
we see that the initial burst of the star formation in the model with pop iii ( run e ) is strongly enhanced : this enhancement of star formation is due to a large amount of return mass and metals . when the released energy reaches the typical potential energy of the central region , the gas component leaks from the galaxy and thus the star formation quenches .
this effect is also found in the models involving both pop iii and hne ( for instance , runs h and j ) .
when we turn on the hn mode ( runs f and g ) , the peaks of sfrs decrease . in the case with @xmath90 , the star formation is strongly suppressed and the peak of the sfr becomes less than @xmath94 , because of an extremely large release energy .    the metal mixing model enhances star formation in the whole time .
the peak sfr increases from @xmath95 ( run h , without mixing ) to @xmath96 ( run j , with mixing ) .
the star formation in the late stage is kept a slightly higher sfr of @xmath97 if the metal mixing model is used . for the models with @xmath90 ,
the contribution of metal mixing is hard to see .
figures [ fig : chemodyn : xfefeh : n13 ] and [ fig : chemodyn : xfefeh : p98 ] show [ x / fe]-[fe / h ] relations of nine elements for runs a , b , c , and d. we draw the median and 10% and 90% values as a function of [ fe / h ] in these figures .
the evolution of [ x / fe ] in these figures is basically similar to those obtained by our one - zone models ( see figures [ fig : oz : afefeh : n ] and [ fig : oz : afefeh : p ] ) , although the metal redistribution scale is completely different .
initially , there are plateaus consisting of the sne ii yields .
then the values of [ x / fe ] become mixtures of sne ii , sne ia and agbs yields . in the cases with agbs in 3-dimensional simulations ,
the contribution of agbs are more prominent compared to the one - zone models and they are not only limited in light elements .
this effect is more prominent in the run with the @xcite s yields table .
this is because of the localization effect .
the breaking points are shifted to + 0.5 dex from those of one - zone models due to the rapid evolution of sfr ( see figure [ fig : chemodyn : sfr ] ) . when the agbs are taken into account , not only the median but also the scatter has changed . in particular in the low metal stars , the scatter increases because of the early agbs ( recall figure [ fig : agbs : cumulativereturnmass ] ) .
figure [ fig : chemodyn : xfefeh : popiiihne ] displays the [ x / fe]-[fe / h ] relations with the pop iii stars ( run e ) and with hne ( runs f and g ) . in these runs , the @xcite s yields table is used . the impact of the pop iii stars on [ x / fe]-[fe / h ] relations are significant .
the effect of the pop iii stars is observed up to [ fe / h ] = @xmath98 ( note that @xmath99 ) . with the pop iii stars ,
the amounts of [ @xmath10/fe ] increase ( see figure [ fig : snii : yields : n13 ] ) and thus , [ @xmath10/fe]s at [ fe / h ] @xmath100 shift upward .
this behavior is comparable to that found in the one - zone model in figure [ fig : oz : afefeh : n ] .
however , these rapid changes in [ x / fe]-[fe / h ] relations are not observationally confirmed .
we will see in the next figures , figures [ fig : chemodyn : xfefeh : nsms:005 ] and [ fig : chemodyn : xfefeh : nsms ] , that these gaps diminish / disappear when we adopt both the pop iii imf and hne .    the contributions of hne to [ x / fe]-[fe / h ] relations can be seen as the timescale of the fe pollution . comparing [ x / fe]-[fe / h ] relations of runs f and g to those of run c , we find that the breaking points of [ x / fe]-[fe / h ] relations change from @xmath101 ( run c ) to @xmath102 ( runs f and g ) .
this is because the larger fe yield of hne ( recall figure [ fig : snii : yields : n13hn ] ) . in the case with @xmath90 , the values of [ x / fe ] at sne ii plateaus decrease @xmath103 dex in [ o / fe ] , [ ne / fe ] , [ mg / fe ] , [ si / fe ] , [ s / fe ] and [ ca / fe ] , while that increases @xmath103 dex in [ ni / fe ] .
we can see similar tendencies in the case with @xmath89 , although the changes are much smaller than the case with @xmath90 .    from figure
[ fig : chemodyn : xfefeh : nsms:005 ] , we can see the impact of metal mixing on the [ x / fe]-[fe / h ] relations .
as is expected , the metal mixing greatly reduces scatters , which is identical to the result obtained in @xcite .
the transition points from the pop iii sne to the normal sne ii and the breaking points of sne ii / ia are slightly moved toward high [ fe / h ] regions when the mixing is adopted .
this is because that the self - enrichment is more efficient in the run with the mixing model . with a small amount of hne , the values of [ x / fe ] of the most metal - rich stars are almost identical to those without hne ( runs a and c ) .
figure [ fig : chemodyn : xfefeh : nsms ] shows the [ x / fe]-fe / h relations with @xmath90 and with / without the metal mixing .
although the star formation histories are completely different between cases with @xmath104 and @xmath89 , the positions of breaking points with @xmath105 are comparable to those found in the case with @xmath89 .
the scatters in the run i are much wider than those in the run h. this would be that stars in the run i distribute farther from the galactic center and agbs affect more in the outer fresh gas , due to the more energetic feedback . when the metal mixing turns on , the scatters become narrow ( run k ) .
the black curves ( run k ) have sudden rises at @xmath106 .
their values of [ x / fe]s are identical to those expected by yields of sne ii .
hence , the contribution of sne ii dominates in stars at the metallicity range .
this might be an accidental case .
the [ eu / fe]-[fe / h ] relations are shown in figures [ fig : chemodyn : xfefeh : nsms:005 ] and [ fig : chemodyn : xfefeh : nsms ] .
the median values of [ eu / fe ] rise at [ fe / h ] @xmath102 and they saturate [ eu / fe ] @xmath107 at [ fe / h ] @xmath108 .
these evolution tracks are expected by one - zone simulations .
while we adopted @xmath109 and @xmath110 , the evolution tracks on the plane in figures [ fig : chemodyn : xfefeh : nsms:005 ] and [ fig : chemodyn : xfefeh : nsms ] are similar to the case with @xmath109 and @xmath111 in figure [ fig : oz : nsms : eu ] .
this is because star - formation time scales in our three - dimensional simulations are shorter than those used in one - zone simulations . as a result ,
stars with low - z and high [ eu / fe ] are hard to see in our model , whereas stars with [ eu / fe ] @xmath112 and [ fe / h ] @xmath113 are found in observations ( see * ? ? ?
the gap between our results and observations originate from the models we used in this paper .
our models are too simple to express detailed distributions of chemical composition generated by rare events .
we expect that the scatter will revert in a cosmological simulation because of its hierarchical nature .
we will investigate the evolution of r - process elements in the cosmological context elsewhere in the near future .
we developed a software library for the chemical evolution simulation of galaxy formation , named `` celib '' .
this library adopts the ssp approximation and , under this approximation , it provides the return mass of each element and released energy from an ssp particle depending on feedback type .
how these quantities are redistributed is left to the user s simulation code .
all of the necessary data , such as imfs , stellar lifetime data , and yields are implemented in celib , as well as reference feedback models .
the data is obtained from the literature .
most functions are selectable at the runtime , and hence it is easy to compare the contribution of each model . the use of celib is easy if users follow the standard way because it consists of a limited number of apis . since celib is a simple software library , it is easy to carry out simulations of chemical evolution even for a beginner of this field . using internal functions ,
it is also possible to construct one s favorite model of chemical evolution .    as demonstrations of celib
, we showed the results of our simple one - zone models and three - dimensional chemodynamical simulations in a dark matter halo .
the yields for sne ii have a large impact on chemical evolution , as is pointed out in previous studies .
when we compare the results with the yields table of @xcite and that of @xcite with slight modifications , these two results are almost comparable except for the light elements , c and n. on the other hand , if we use the original yields of @xcite , the [ x / fe]-[fe / h ] relations become inconsistent with other results .
sne ia affect the position of the breaking point of the plateaus .
a different yields table gives different final amounts of metals released by sne ia .
this implies that we need to be careful with models and yields of sne ia when we compare results with observations .
agbs affect the evolutions of relatively light elements , such as c and n. these effects can be seen in both one - zone and three - dimensional simulations .
the feedback from agbs is sometimes not taken into account even in current simulations of galaxy formation .
however , they can not be ignored since they are very common in the ism .
we provide the community with this library ( https://bitbucket.org/tsaitoh/celib ) and it is also archived on zenodo ( 10.5281/zenodo.190830 ) .
we believe that this library will accelerate the understanding of galaxy formation from the perspective of chemical evolution .
following are the future prospects of this library .
* further flexibility would be necessary for imf shapes .
it is more convenient if each stellar particle can have its own imf and mass range .
the importance of the top - heavy imf in galaxy formation is well understood ( e.g. , * ? ? ?
* ; * ? ? ?
* further extension of yields tables is desirable .
for instance , recently , the nugrid collaboration published their yields tables @xcite which are based on the mesa and genec codes @xcite .
the published yields are @xmath114 and @xmath115 .
we will take their yields when all data is published . in the current version of this library
, all yields tables are obtained from models without stellar rotations .
it is pointed out that stellar rotation changes yields ( e.g. , * ? ? ?
* ; * ? ? ?
the effect of the rotating zero metal stars was studied in @xcite and they showed these stars have significant effects on [ c / fe]-[fe / h ] and [ n / fe]-[fe / h ] relations and a moderate effect on the [ o / fe]-[fe / h ] relation .
* further sophisticated treatment of the chemical enrichment might be important .
strictly speaking , the yield of each element depends on the abundance of other elements
. however , the current formulation implemented on celib ignores this effect .
as such , the @xmath36 formalism has been proposed @xcite . with and without this formulation , there might be certain differences in chemical enrichment @xcite .
note , however , that they assumed the solar proportions , which is not ideal for understanding the @xmath36 formulation . *
further extension of available yields and isotopes are important to connect studies of galaxy formation and planet formation . in the current version of celib ,
the distributions of isotopes are not considered .
it is also important to distinguish the contributions from different types of feedback .
generally , only the data of long lived isotopes are provided . .
this data is sufficient for galactic chemical evolution studies .
however , in the case that the distributions of the short lived isotopes are important , the current treatment of the isotopes is insufficient .
for example , it is pointed out that the radio isotope of aluminum , @xmath116al , is abundant during the early age of the solar system ( e.g. , * ? ? ? * ; * ? ? ? * ; * ? ? ? * ; * ? ? ? * ; * ? ? ? * ) and the decay heat of @xmath116al , whose half - time period is @xmath117 , is considered to be a primary source of the earth s early evolution ( e.g. , * ? ? ? * ; * ? ? ? * ; * ? ? ? * ) , as well as these of @xmath118u , @xmath119u , @xmath120th , and @xmath121k . to deal with the decays of all of radioactive isotopes
is unrealistic .
at least it is necessary to deal with the decays of some of the important radioactivate isotopes to understand the formation history of stars and planets from the perspective of galactic chemodynamical simulations .
it is certain that star - by - star simulations are the next breakthrough of galaxy formation simulation since there are an enormous amount of evidence that massive stars have crucial impacts on the galaxy formation and evolution .
in some first star and first galaxy simulations , pop iii stars are dealt with discrete stars sampled from a pop iii imf instead of using the ssp approximation ( e.g. , * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ; * ? ? ?
* ) or its formation is directly followed ( e.g. , * ? ? ?
* ; * ? ? ?
while such treatment of stars is beyond the original scope of celib , the all necessary data used for the chemical evolution of star - by - star simulations have been implemented .
hence , celib provides apis which can be used by star - by - star simulation ( see appendix [ sec : apis : starbystar ] ) .
the author thanks the anonymous referee who gave constructive and helpful comments that improved this study .
the author also thanks yutaka hirai , takashi okamoto , junichi baba , daisuke kawata , ko nakamura , takuma suda and yutaka katsuta who gave important input for this study .
a part of numerical simulations was carried out on the cray xc30 system in the center for computational astrophysics at the national astronomical observatory of japan .
this work is supported by a grant - in - aid for scientific research ( 26707007 ) of japan society for the promotion of science and strategic programs for innovative research of the ministry of education , culture , sports , science and technology ( spire ) .
here we describe the major functions of celib .
all available functions are defined in celib.h .
this library is initialized by just calling this function ;    ....    void celibinit(void ) ; ....    when this function is called , the imf and its mass range are fixed . then under these conditions , the imf weighted yields of the adopted yield tables are computed . the smoothed lifetime functions and necessary data for reference feedback models are also computed .
this function should be called at the beginning of a simulation using this library .
every model s parameters are fixed at this time .
if a user wants to use different model parameters , the user needs to call this function again after resetting new parameters .      with reference feedback models ,
the user can easily obtain event times . in order to obtain an event time of an ssp particle
, the user has to use the following function ;    .... double celibgetnexteventtime(struct celibstructnexteventtimeinput input , const int type ) ; ....    this function returns the event time of a target event in units of year .
this function requires two arguments .
the first argument is a structure defined in ` celib.h ` and the definition of it is    .... struct celibstructnexteventtimeinput {      double r ;                    // a random real number in [ 0,1 )      double initialmass_in_msun ; //
an initial mass of the target ssp particle                                  //    in units of the solar mass      double metallicity ;          // a metallicity of the target ssp particle      int count ;                   // a counter for a target event                                   //
this is used in sne ia / agbs / nsms                                  // count should start zero . } ;   ....    the second argument of this reference api is used to specify the feedback type .
feedback types are defined as ` enum ` and the user should select one out of four ;    .... enum {      celibfeedbacktype_snii ,      celibfeedbacktype_snia ,      celibfeedbacktype_agb ,      celibfeedbacktype_nsm ,      celibfeedbacktype_number , } ; ....    for example , we consider a case in which the user wants to obtain the explosion time of sne ii using the reference model . in this case , the user has to call the reference api like this ;    .... struct celibstructnexteventtimeinput input = {          .r = a_r ,                       // a random real number in [ 0,1 )          .initialmass_in_msun = m_ssp ,   // the initial mass of the target ssp particle          .metallicity = z_ssp ,           //
the metallicity of the target ssp particle          } ;   double t_snii = celibgetnexteventtime(input , celibfeedbacktype_snii ) ; ....    ` count ` is not used to obtain the feedback time of sne ii and thus it is ignored in this case .
the return value ` t_snii ` is the explosion time which follows figures [ fig : snii : rate : n13 ] or [ fig : snii : rate : p98 ] .
if the simulation time is @xmath122 , the feedback event takes place at @xmath123 .
the released masses of metals and energy are also easily obtained by using a reference api .
when the time in a simulation reaches the event time , we need to call the following function ;    .... struct celibstructfeedbackoutput                   celibgetfeedback(struct celibstructfeedbackinput input , const int type ) ; ....    the first argument is the structure defined in ` celib.h ` and it holds all the necessary data to evaluate the feedback event .
the structure is    .... struct celibstructfeedbackinput {      double mass ;                  // the mass of the target ssp particle in simulation unit      double metallicity ;           //
the metallicity of the target ssp particle      double massconversionfactor ; // a factor to convert elements [ ] from                                    //    the simulation mass unit to the solar mass      double * elements ;             //
the pointer to the array of elements for                                    //    the target ssp particle in the simulation mass unit      int count ;                    // a counter of the target event } ; ....    the second argument is the type of feedback and it is the same as that used to obtain the feedback time .
the results are loaded to a structure whose type is ` struct celibstructfeedbackoutput ` .
the definition of it is as follows :    .... struct celibstructfeedbackoutput {      double energy ;                       // the released energy in units of erg      double ejectamass ;                   // the ejecta mass in units of the solar mass      double remnantmass ;                  // the remnant mass in units of the solar mass      double elements[celibyield_number ] ; //
the mass of released metals in units of the solar mass } ; ....    note that ` celibyield_number ` is defined in celib.h and is thirteen in the current version .    for example , we show the way to obtain the results of sne ii feedback .
first the user needs to put all necessary data to the structure ` struct celibstructfeedbackinput ` and then call ` celibgetfeedback ` with ` celibfeedbacktype_snii ` .
.... struct celibstructfeedbackinput input = {          .mass = m_ssp ,          .metallicity = z_ssp ,          .massconversionfactor = mass_solar_mass / mass_sim_unit ,          .elements = elements_ssp ,      } struct celibstructfeedbackoutput snii =                   celibgetfeedback(input , celibfeedbacktype_snii ) ; ....    units of energy and mass in ` snii ` are erg for energy and @xmath79 .
if the simulation units are different from these units , the user needs to convert them into the simulation units .
all of the control parameters are stored in the structure ` struct celibstructrunparameters ` .
celib prepares a structure ` celibrunparameters ` and it is used to manage this library .
the fiducial model is the same as that used in
[ sec : chemodyn ] as run f ( see table [ tab : chemodyn : runs ] ) .
when the values in ` celibrunparameters ` are changed and the initializer is called , celib recomputes all data and thus a new simulation is ready to start .
celib provides apis for star - by - star simulations .
so far , celib supports only feedback from massive stars .
this function returns the lifetime of a star in units of year , referring the lifetime tables built in
[ sec : lifetime ] .
the structure of the first argument , which is also defined in ` celib.h ` , is as follows :      the second argument is the type of feedback .
although only feedback from massive stars is supported in the current version of celib , we prepare this argument for the future extension . in the current version , ` type ` should be ` celibfeedbacktype_snii ` .    [
[ get - released - masses - of - metals - and - energy - for - star - by - star - simulations ] ] get released masses of metals and energy for star by star simulations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~          .... struct celibstructfeedbackstarbystarinput {      double mass ;                  // mass of the star in simulation unit .
double metallicity ;           //
metallicity of the star z      double massconversionfactor ; // a factor to convert elements [ ] from                                   //    the simulation mass unit to msun .
double * elements ;             // star particle 's elements composition in simulation unit . } ; ....        .... struct celibstructfeedbackstarbystaroutput {      double energy ;                       // the released energy in units of erg      double ejectamass ;                   // the ejecta mass in units of the solar mass      double remnantmass ;                  // the remnant mass in units of the solar mass      double elements[celibyield_number ] ; // the mass of released metals in units of the solar mass } ; ....