This tutorial demonstrates how to use example codes in the wn_simple_gce distribution examples/ directory.
Example 1: Create a simple GCE model and compute the total mass, the mass in stars, and the mass in gas.
The example code is gce_masses.c
To compute the total mass, the star mass, and the gas mass for a simple GCE model with initial gas mass of 1.0e10, infall parameters k = 1 and Delta = 0.1, and a gas consumption rate of 0.298805 per Gyr, type:
./gce_masses 1.e10 1 0.1 0.298805 > ex1_output.txt
The result is ex1_output.txt
Example 2: Compute the gas consumption rate omega from the gas fraction at a given time.
The example code is get_omega_from_gas_fraction.c
To compute the gas consumption rate omega for k = 1 and Delta = 0.5 to give a gas mass fraction (gas mass/total mass) of 0.1 at 12 Gyr, type:
./get_omega_from_gas_fraction 1 0.5 0.1 12. > ex2_output.txt
The result is ex2_output.txt
Most of the examples on this page use a model with k = 1 and Delta = 0.1. To compute the gas consumption rate omega for this model such that the gas mass fraction is 0.1 at 12 Gyr, type:
./get_omega_from_gas_fraction 1 0.1 0.1 12. > ex2_output2.txt
The result is ex2_output2.txt
Example 3: Use supplied infall functions in place of the default.
The example code is gce_with_infall_function.c
To compute the total mass, gas mass, star mass, and gas fraction for a simple GCE model with initial gas mass 1.e10, infall parameters k = 1 and Delta = 0.1, a gas consumption rate 0.298805 per Gyr, and an omega1 [see Eq. (14) of Clayton (1984)], type:
./gce_with_infall_function 1.e10 1 0.1 0.298805 0.15 > ex3_output.txt
The result is ex3_output.txt
Example 4: Compute the primary metallicity as a function of time in a simple GCE model.
The example code is compute_primary_metallicity.c
To compute the primary metallicity in a simple GCE model with infall parameters k = 1 and Delta = 0.1, a gas consumption rate of 0.298805 per Gyr, and a primary metallicity yield of 0.012, type:
./compute_primary_metallicity 1 0.1 0.298805 0.012 > ex4_output.txt
The result is ex4_output.txt
Example 5: Compute a species yield as a function of time.
The example code is compute_species_yield.c
To compute the yield of al27 for a simple GCE model with infall parameters k = 1 and Delta = 0.1, a gas consumption rate of 0.298805 per Gyr, a primary metallicity yield of 0.012, and a species primary yield of 1.7e-5, type:
./compute_species_yield 1 0.1 0.298805 0.012 al27 1.7e-5 > ex5_output.txt
The result is ex5_output.txt
To run with a secondary component to the yield (the beta term), add that to the command line:
./compute_species_yield 1 0.1 0.298805 0.012 al27 1.7e-5 2.1e-3 > ex5_output_beta.txt
The result is ex5_output_beta.txt
It is also possible to add higher order terms:
./compute_species_yield 1 0.1 0.298805 0.012 al27 1.7e-5 2.1e-3 -1.e-2 > ex5_output_gamma.txt
The result is ex5_output_gamma.txt
Example 6: Compute the species yield as function of time with a user-defined species yield function.
The example code is compute_species_yield_with_user_function.c
We consider a user-defined species yield function for which the initial primary yield coefficient is alpha1 but after the primary metallicity reaches z_break, an additional primary component with alpha2 gets add to the first coefficient. To use such a function to compute the yield of fe56 for a simple GCE model with infall parameters k = 1 and Delta = 0.1, a gas consumption rate of 0.298805 per Gyr, a primary metallicity yield of 0.012, an alpha1 = 3.2e-4, an alpha2 = 7.5e-4, a z_break of 3.e-3, and a turn on width of 2.e-4, type:
./compute_species_yield_with_user_function 1 0.1 0.298805 0.012 fe56 3.2e-4 7.5e-4 3.e-3 2.e-4 > ex6_output.txt
The result is ex6_output.txt
Example 7: Compute the yield parameters to give a particular mass fraction at a particular time.
The example code is compute_species_yield_parameters.c
To compute the alpha yield parameter for a simple GCE model with infall parameters k = 1 and Delta = 0.1, and a gas consumption rate of 0.298805 per Gyr to give a si28 (a primary, stable species) mass fraction of 7.552e-4 at 8.0 Gyr, type:
./compute_species_yield_parameters 1 0.1 0.298805 si28 0. 8.0 7.552e-4 > ex7_output.txt
The result is ex7_output.txt
If you know the alpha part of the yield for the species, you can similarly derive the beta (secondary) part. For example, if you assume si29 is purely secondary, to find the beta parameter required to give a mass fraction of 3.972e-05 at 8.0 Gyr, type:
./compute_species_yield_parameters 1 0.1 0.298805 si29 0. 8.0 3.972e-5 0.012 0. > ex7_output2.txt
The result is ex7_output2.txt
Example 8: Compute the mass fraction of a species in the gas as a function of time.
The example code is compute_species_mass_fraction.c
To compute the gas mass fraction of al27 for a simple GCE model with infall parameters k = 1 and Delta = 0.1, a gas consumption rate of 0.298805 per Gyr, a primary metallicity yield of 0.012, and a species primary yield of 1.7e-5, type:
./compute_species_mass_fraction 1 0.1 0.298805 0.012 al27 0. 1.7e-5 > ex8_output.txt
The result is ex8_output.txt
To run with a secondary component to the yield (the beta term), add that to the command line:
./compute_species_mass_fraction 1 0.1 0.298805 0.012 al27 0. 1.7e-5 2.1e-3 > ex8_output_beta.txt
The result is ex8_output_beta.txt
To run with a species that is radioactive, add the non-zero decay rate to the command line:
./compute_species_mass_fraction 1 0.1 0.298805 0.012 al26 967. 2.2e-7 6.5e-6 > ex8_output_rad.txt
The result is ex8_output_rad.txt
Example 9: Compute the mass fraction of a species in the gas as a function of time with a user-defined species yield function.
The example code is compute_species_mass_fraction_with_user_function.c
We consider a user-defined species yield function for which the initial primary yield coefficient is alpha1 but after the primary metallicity reaches z_break, an additional primary component with alpha2 gets add to the first coefficient. To use such a function to compute the gas mass fraction of fe56 for a simple GCE model with infall parameters k = 1 and Delta = 0.1, a gas consumption rate of 0.298805 per Gyr, a primary metallicity yield of 0.012, an alpha1 = 3.2e-4, an alpha2 = 7.5e-4, a z_break of 3.e-3, and a turn on width of 2.e-4, type:
./compute_species_mass_fraction_with_user_function 1 0.1 0.298805 0.012 fe56 0. 3.2e-4 7.5e-4 3.e-3 2.e-4 > ex9_output.txt
The result is ex9_output.txt
Example 10: Compute the mass fraction of a species in the gas as a function of age at a given time.
The example code is compute_species_mass_fraction_vs_age.c
To compute the gas mass fraction of u235 as a function of age (at a time 12.5 Gyr) for a simple GCE model with infall parameters k = 1 and Delta = 0.1, a gas consumption rate of 0.298805 per Gyr, a primary metallicity yield of 0.012, a decay rate of 0.985, and a species primary yield of 1.6e-10, type:
./compute_species_mass_fraction_vs_age 1 0.1 0.298805 0.012 u235 0.985 12.5 1.6e-10 > ex10_output.txt
The result is ex10_output.txt
Example 11: Compute the ISM mass fraction ratio of a radioactive species relative to that of a reference (stable or radioactive) isotope as a function of time.
The example code is radioactivity.c
To compute the ISM mass fraction ratio of al26 to al27 for a k = 1, Delta = 0.1 model with omega = 0.298805 / Gyr, type:
./radioactivity 1 0.1 0.298805 0.012 al26 967. 2.2e-7 6.5e-6 al27 0. 1.7e-5 2.1e-3 > ex11_output.txt
The result is ex11_output.txt
Example 12: Compute the remainder of a radioactive species (mass fraction in the gas relative to that if the species were stable) as a function of time.
The example code is remainder.c
To compute the remainder of al26 for a simple GCE model with infall parameters k = 1 and Delta = 0.1, a gas consumption rate of 0.298805 per Gyr, a primary yield alpha = 0.012, and species yield parameters alpha = 2.2e-7 and beta = 6.5e-6, type:
./remainder 1 0.1 0.298805 0.012 al26 967. 2.2e-7 6.5e-6 > ex12_output.txt
The result is ex12_output.txt
Example 13: Compute the mass fraction of a species in multiple GCE zones at a given time simultaneously.
The example code is multi_zone_species.c
To compute the mass fraction of si30 in the two zones at 7.7 Gyr for the input parameters in zones.txt, type:
./multi_zone_species zones.txt 7.7 > ex13_output.txt
The result is ex13_output.txt