This tutorial demonstrates how to use example codes in the libnuceq distribution examples/ directory.

Example 1: Calculate a weak statistical equilibrium at a fixed neutrino chemical potential.

The example code is compute_wse.c

To run compute_wse, type the following on the command line:


./compute_wse ../data_pub/example_nuc.xml 4. 1.e9 0. > ex1_output.txt

The result is ex1_output.txt

Example 2: Calculate a weak statistical equilibrium at a fixed net lepton number per nucleon.

The example code is compute_wse_from_lepton_number.c

To run compute_wse_from_lepton_number, type the following on the command line:


./compute_wse_from_lepton_number ../data_pub/example_nuc.xml 4. 1.e10 1. > ex2_output.txt

The result is ex2_output.txt

Example 3: Calculate a weak statistical equilibrium with a user-defined electron number density function and integrand.

The example code is compute_function_integrand_wse.c

To run compute_function_integrand_wse, type the following on the command line:


./compute_function_integrand_wse ../data_pub/example_nuc.xml 5. 1.e8 0. > ex3_output.txt

The result is ex3_output.txt

To shift the electron chemical potential by a constant amount in the electron number density integrand, enter a non zero value:


./compute_function_integrand_wse ../data_pub/example_nuc.xml 5. 1.e8 -3. > ex3_output_shifted.txt

The result is ex3_output_shifted.txt

Example 4: Compare weak statistical equilibria calculated with and without screening.

The example code is compare_wse_screening.c

To run compare_wse_screening, type the following on the command line:


./compare_wse_screening ../data_pub/example_nuc.xml 1. 1.e13 > ex4_output.txt

The result is ex4_output.txt

Example 5: Calculate a nuclear statistical equilibrium.

The example code is compute_nse.c

To run compute_nse, type the following on the command line:


./compute_nse ../data_pub/example_nuc.xml 5. 1.e8 0.48 > ex5_output.txt

The result is ex5_output.txt

Example 6: Calculate a nuclear statistical equilibrium and compare to one with screening and with degenerate nucleons.

The example code is compute_screened_degen_nse.c

To run compute_screened_degen_nse, type the following on the command line:


./compute_screened_degen_nse ../data_pub/example_nuc.xml 1. 3.e12 0.2 > ex6_output.txt

The result is ex6_output.txt

Example 7: Calculate a quasi-statistical equilibrium.

The example code is compute_qse.c

To run compute_qse, type the following on the command line:


./compute_qse ../data_pub/example_nuc.xml 5. 1.e8 0.48 0.01 > ex7_output.txt

The result is ex7_output.txt

Example 8: Calculate a quasi-statistical equilibrium with multiple clusters.

The example code is compute_many_qse.c

To run compute_many_qse, type the following on the command line:


./compute_many_qse ../data_pub/example_nuc.xml 5. 1.e8 0.48 "[z >=6 and z < 22]" 0.01 "[z >= 22]" 0.01 > ex8_output.txt

The result is ex8_output.txt

Example 9: Compare two quasi-equilibria with different abundance constraints.

The example code is compare_qse.c

To run compare_qse, type the following on the command line:


./compare_qse ../data_pub/example_nuc.xml 5. 1.e8 0.48 0.01 0.02 > ex9_output.txt

The result is ex9_output.txt

Example 10: Calculate an (n,gamma)-(gamma,n) equilibrium.

The example code is compute_ng.c

To run compute_ng, type the following on the command line:


./compute_ng ../data_pub/example_nuc.xml ../data_pub/z.txt 1. 1.e4 0.4 > ex10_output.txt

The result is ex10_output.txt

Example 11: Calculate a restricted nuclear statistical equilibrium.

The example code is compute_rnse.c

To run compute_rnse, type the following on the command line:


./compute_rnse ../data_pub/example_nuc.xml 2. 1.e2 0.85 0.01 > ex11_output.txt

The result is ex11_output.txt