LensFactory.Cosmology
— ModuleCosmology
Initialization
LensFactory.Cosmology.init_cosmology
— Typeinit_cosmology(H0::RV=70.0, w::RV=-1.0, Omega_m0::RV=0.3, Omega_r0::RV=0.0, Omega_w0::RV=0.7)
An Abstract type to initialize a given cosmology.
Basics
LensFactory.Cosmology.scale_factor
— Functionscale_factor(z::RV)
Calculates the scale factor $(a)$ at redshift $z$. The formula is,
\[a = \frac{1}{1+z}\]
LensFactory.Cosmology.Ez
— FunctionEz(z::RV)
Calculates the dimensionless Hubble parameter $(E)$ at redshift, $z$. The formula is,
\[E(z) = \sqrt{ Ω_{m0} (1+z)^2 + Ω_{r0} (1+z)^4 + Ω_{k0} (1+z)^2 + Ω_{w0} (1+z)^{3(1+w)} }\]
LensFactory.Cosmology.hubble_parameter
— Functionhubble_parameter(cosmology::AbstractCosmology, z::RV)
Calculates the Hubble parameter $(H)$ at redshift $z$ in ${\rm \mathbf{km/s/Mpc}}$. The formula is,
\[H(z) = H_0 \: E(z)\]
Time
LensFactory.Cosmology.hubble_time
— Functionhubble_time(H0::RV)
Calculates the Hubble time $(t_H)$ in ${\rm \mathbf{Gyr}}$. The formula is,
\[t_H = \frac{1}{\rm H_0}\]
LensFactory.Cosmology.age
— Functionage(cosmology::AbstractCosmology, z::RV)
Calculates the age $(t_{\rm age})$ of the Universe at redshift $z$ in ${\rm \mathbf{Gyr}}$. The formula is,
\[t_{\rm age}(z) = \int_z^\infty \frac{1}{(1+z')H(z')} dz' \]
LensFactory.Cosmology.lookback_time
— Functionlookback_time(cosmology::AbstractCosmology, z::RV)
Calculates lookbak time $(t_L)$ to a given redshift $z$ in ${\rm \mathbf{Gyr}}$. The formula is,
\[t_L(z) = \int_0^z \frac{1}{(1+z')H(z')} dz' \]
Density parameters
LensFactory.Cosmology.rho_cz
— Functionrho_cz(cosmology::AbstractCosmology, z::RV)
Calculates the critical density $(\rho_c)$ of the Universe at redshift $z$ in ${\rm \mathbf{kg/m^3}}$. The formula is,
\[\rho_c(z) = \frac{3 H^2(z)}{8 π {\rm G} }\]
LensFactory.Cosmology.Omega_mz
— FunctionOmega_mz(cosmology::AbstractCosmology, z::RV)
Calculates the matter density parameter $(\Omega_{m})$ at redshift z
. The formula is,
\[Ω_{m}(z) = Ω_{m}(0) \: (1+z)^3 \left( \frac{H0}{H(z)} \right)^2\]
LensFactory.Cosmology.Omega_rz
— FunctionOmega_rz(cosmology::AbstractCosmology, z::RV)
Calculates the matter density parameter $(\Omega_{r})$ at redshift z
. The formula is,
\[Ω_{r}(z) = Ω_{r}(0) \: (1+z)^4 \left( \frac{H_0}{H(z)} \right)^2\]
LensFactory.Cosmology.Omega_wz
— FunctionOmega_wz(cosmology::AbstractCosmology, z::RV)
Calculates the dark energy density parameter $(\Omega_{w})$ at redshift z
. The formula is,
\[Ω_{w}(z) = Ω_{w0} (1+z)^{3(1+w)} \left( \frac{H_0}{H(z)} \right)^2\]
LensFactory.Cosmology.Omega_kz
— FunctionOmega_kz(cosmology::AbstractCosmology, z::RV)
Calculates the curvature density parameter $(\Omega_{k})$ at redshift z
. The formula is,
\[Ω_{k}(z) = Ω_{k0} (1+z)^2 \left( \frac{H_0}{H(z)} \right)^2\]
Distances
LensFactory.Cosmology.hubble_distance
— Functionhubble_distance(H0::RV)
Calculates HUbble distance (i.e., size of the observable Universe) $(D_H)$ in ${\rm \mathbf{meters}}$. The formula is
\[D_H = \frac{\rm c}{\rm H_0} \]
LensFactory.Cosmology.comoving_distance_radial
— Functioncomoving_distance_radial(cosmo::AbstractCosmology, zi::RV, zf::RV)
Calculates the comoving radial distance $(D_C)$ between $z_1$ and $z_2$ in ${\rm \mathbf{meters}}$. The formula is,
\[D_C = D_H \int_{z_1}^{z_2} \frac{dz'}{E(z')}\]
LensFactory.Cosmology.comoving_distance_transverse
— Functioncomoving_distance_transverse(cosmo::AbstractCosmology, zi::RV, zf::RV)
Calculates the comoving radial distance $(D_M)$ between, $z_1$ and $z_2$ in ${\rm \mathbf{meters}}$. The formula is,
\[D_M = \begin{cases} D_H \frac{1}{\sqrt{\Omega_k}} \sinh \left[ \sqrt{\Omega_k} \: D_C / D_H \right] & \text{if } \Omega_k > 0 \\ D_C & \text{if } \Omega_k = 0 \\ D_H \frac{1}{\sqrt{|\Omega_k|}} \sin \left[ \sqrt{|\Omega_k|} \: D_C / D_H \right] & \text{if } \Omega_k < 0 \\ \end{cases}\]
LensFactory.Cosmology.luminosity_distance
— Functionluminosity_distance(cosmology::AbstractCosmology, z::RV)
Calculates the luminosity distance $(D_L)$ to redshift $z$ in ${\rm \mathbf{meters}}$. The formula is,
\[D_L(z) = (1+z) D_M(z)\]
LensFactory.Cosmology.angular_diameter_distance
— Functionangular_diameter_distance(cosmology::AbstractCosmology, z1::RV, z2::RV)
Calculates the angular diameter distance $(D_A)$ between redshifts $z_1$ and $z_2$ in ${\rm \mathbf{meters}}$. The formula is,
\[D_A(z_1, z_2) = \frac{D_M(z_1, z_2)}{1+z_2}\]
LensFactory.Cosmology.distance_modulus
— Functiondistance_modulus(cosmo::AbstractCosmology, zf::RV)
Calculates the distance modulus $(\mu)$ to a given redshift $z$. The formula is,
\[\mu = 5 \log\left( \frac{D_L}{\rm pc} \right) - 5\]
LensFactory.Cosmology.angular_scale
— Functionangular_scale(cosmo::AbstractCosmology, zf::RV)
Calculates the angular size in ${\rm \mathbf{Kpc}}$ for $1''$ on sky at redhsift, $z$. The formula is
\[d = 1'' \times \left( \frac{D_A}{\rm{kpc}} \right)\]
Volumes
LensFactory.Cosmology.comoving_volume_element
— Functioncomoving_volume_element(cosmology::AbstractCosmology, zf::RV)
Calculates the comving volume element $(dV_C)$ at redshift $z$ in ${\rm \mathbf{Gpc^3}}$. The formula is
\[dV_C = D_H \frac{D_M^2(z)}{E(z)}\]
LensFactory.Cosmology.comoving_volume
— Functioncomoving_volume(cosmology::AbstractCosmology, zf::RV)
Calculates the total comving volume up to redshift $z$ in ${\rm \mathbf{Gpc^3}}$. The formula is,
\[V_C = \begin{cases} \frac{4π}{2} \frac{D_H^3}{Ω_k} \left[ \frac{D_M}{D_H} \sqrt{1+Ω_k \left(\frac{D_M}{D_H}\right)^2} - \frac{1}{\sqrt{|Ω_k|}} {\rm arcsinh}\left( \sqrt{|Ω_k|} \frac{D_M}{D_H} \right) \right] & \text{if } Ω_k > 0 \\ \frac{4π}{3} D_M^3 & \text{if } Ω_k = 0 \\ \frac{4π}{2} \frac{D_H^3}{|Ω_k|} \left[ \frac{D_M}{D_H} \sqrt{1+Ω_k \left(\frac{D_M}{D_H}\right)^2} - \frac{1}{\sqrt{|Ω_k|}} \arcsin\left( \sqrt{|Ω_k|} \frac{D_M}{D_H} \right) \right] & \text{if } Ω_k < 0 \\ \end{cases}\]