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