# AST3220, Cosmo I, project 2 -- Big Bang Nucleosynthesis # Jakob Borg, UiO, 2025 # Module providing the background cosmology for the BBN calculations. # Imports: ... class BackgroundBBN: def __init__(self, Omega_b0 = 0.05, N_eff = 3.0): """ Initialize the background cosmology defined by input parameters. Parameters ---------- Omega_b0 : float, optional The relative baryon density, by default 0.05 N_eff : float, optional The effective number of neutrinos, by default 3.0 """ # Define constants and parameters: self.Omega_b0 = Omega_b0 self.N_eff = N_eff self.H0 = ... self.rho_crit0 = ... self.Omega_r0 = ... def get_a(self, T): """ Compute the scale factor as a function of temperature. Parameters ---------- T : float or np.ndarray The temperature in Kelvin. Returns ------- float or np.ndarray The scale factor. """ a = ... return a def get_Hubble(self, T): """ Compute the Hubble parameter as a function of temperature. Parameters ---------- T : float or np.ndarray The temperature in Kelvin. Returns ------- float or np.ndarray The Hubble parameter in 1/s. """ H = ... return H def get_rho_b(self, T): """ Compute the energy density of baryons as a function of temperature. Parameters ---------- T : float or np.ndarray The temperature in Kelvin. Returns ------- float or np.ndarray The energy density of baryons in g/cm^3. """ rho_b = ... return rho_b