create_trajectories.py
Go to the documentation of this file.
1 # Import packages
2 import os, shutil
3 import numpy as np
4 import matplotlib.pyplot as plt
5 # Determining the trajectory of standart Big Bang.
6 # We need to know:
7 # - Temperature evolution
8 # - Density evolution
9 # - Electron fraction at weak freezeout
10 
11 etas = np.logspace(-12,-7,num=100)
12 for e in etas:
13  # The trajectory is derived for a flat isotropic and homogeneous universe, with adiabatic expandion, following (Winteler 2013).
14  # The Friedmann equations for this are given by:
15  #
16  # (1): d^2R/dt^2 = -4pi//(3c^2) * (rho_eps + 3P) GR + 1/(3c^2) Lambda R
17  # (2): (dR/dt)^2 = H(t)^2 = 8piG/(3c^2) rho_eps - kc^2/(R^2) + 1/(3c^2) Lambda
18  # (3): d(rho_eps R^3)/dt + P dR^3/dt = 0
19  # (for a flat universe k=0 and Lambda = 0)
20 
21 
22  # At aproximately kb T_weak = 0.8 MeV [Winteler 2013, Fields 2006] the neutron to proton ratio is frozen out. From Maxwell Boltzmann distribution and the
23  # equilibrium of chemical potentials one can derive n/p = 1/6 (with n+p = 1 => n=1/7 and p=1/6)
24 
25  # Constants
26  mn = 939.5654133 # mass neutron [ MeV / c**2 ]
27  mp = 938.2720813 # mass proton [ MeV / c**2 ]
28  Delta = mn - mp # mass difference [ MeV / c**2 ]
29 
30  # Assume weak freezout at T=0.8 MeV
31  kB_Tweak = 0.8 # [MeV]
32  n_p_ratio = np.exp(-Delta/kB_Tweak) # Followed from Maxwell Boltzmann expression for the chemical potentials
33 
34  # From n+p = 1:
35  neutron_freezout = n_p_ratio/(1. + n_p_ratio)
36  proton_freezout = 1. - neutron_freezout
37  # The initial electron fraction is therefore given as:
38  ye_freezout = proton_freezout/(neutron_freezout+proton_freezout) # Same as neutron abundance, because there are only nucleons
39 
40  # Calculate the first time after freezeout.
41  # MeV -> GK: 11.604519
42  first_time = (13.36 * 1./(kB_Tweak * 11.604519))**2.
43  # Get the time
44  time = np.logspace(np.log10(first_time),10,num=200) # [s]
45 
46  # From adiabatic expansion and from relativistic degrees of freedom g = 3.3626:
47  temperature = 13.336 * 1./(time**0.5) # [GK]
48 
49  # The density can be calculated in terms of the photon to baryon ratio eta:
50  # (Change eta for creating the plot shown in Schramm, Turner 1998)
51  eta = e # Different etas
52  # Define some other constants:
53  m_u = 1.660540e-27 * 1e3 # Weight of a nucleon
54  pi = 3.14159265359
55  kB = 8.6173303e-2 # [MeV / GK]
56  hbarc = 197.3269718 * 1.e-13 # [MeV * cm]
57  # Calculate the density in [g/ccm]. (From adiabatic expansion and assuming ultra relativistic particle [see Winteler 2012])
58  dens = 2.404 * eta/(pi**2.) * ((kB*temperature)/(hbarc))**3. * m_u # [g/ccm]
59 
60  # Create ye column. Note that the network only uses the first value, so we can keep it constant
61  ye = [ye_freezout for i in range(len(time))]
62 
63  # Save the trajectory
64  out = np.array([time,temperature,dens,ye]).T
65  np.savetxt('bbn_'+str(e),out,header='time [s], T9 [GK], density [g/cm^3], Ye \n')