Generate and return the square of the dimensionless Hubble Parameter \(E(z)^2 = \big(\frac{H(z)}{H_0}\big)^2\) for the default or the specified cosmological parameters.
Assuming \((\Omega_M, \Omega_\Lambda, \Omega_R, \Omega_K)\) represent the normalized densities of Dark Matter, Dark Energy, Radiation Energy, and Curvature in a Universe with negligible neutrino mass such that \(\Omega_M + \Omega_\Lambda + \Omega_R + \Omega_K = 1\), the dimensionless Hubble Parameter at a given cosmological redshift \(z\) is defined as (Peebles, 1993, Principles of Physical Cosmology, pp 310-321),
\begin{equation}
\large
E(z) = \frac{H(z)}{H_0} = \sqrt{\Omega_R(1+z)^4 + \Omega_M(1+z)^3 + \Omega_K(1+z)^2 + \Omega_\Lambda} ~,
\end{equation}
where \(H_0\) is the Hubble Constant.
Note that \(E(Z)\) is the time derivative of the logarithm of the scale factor \(a(t)\) of the Universe.
- Parameters
-
[in] | zplus1 | : The input scalar or array of the same rank as other array-like arguments, of type real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128) representing the redshift plus one, \(\log(z+1)\), at which the square of the dimensionless Hubble Parameter must be computed.
|
[in] | omegaM | : The input scalar or array of the same rank as other array-like arguments, of the same type and kind as the input argument zplus1 representing the normalized matter density in the universe.
(optional, default = OMEGA_M. It must be present if omegaL ( \(\Omega_\Lambda\)) is also present.) |
[in] | omegaL | : The input scalar or array of the same rank as other array-like arguments, of the same type and kind as the input argument zplus1 representing the normalized Dark Energy density in the universe.
(optional, default = OMEGA_L. It must be present if omegaR is also present.) |
[in] | omegaR | : The input scalar or array of the same rank as other array-like arguments, of the same type and kind as the input argument zplus1 representing the normalized radiation density in the universe.
(optional, default = OMEGA_R. It must be present if omegaK is also present.) |
[in] | omegaK | : The input scalar or array of the same rank as other array-like arguments, of the same type and kind as the input argument zplus1 representing the normalized curvature density of the universe.
(optional, default = OMEGA_K) |
- Returns
hubbleParamNormedSq
: The output scalar or array of the same rank as other array-like arguments, of the same type and kind as the input argument zplus1
containing the square of the dimensionless Hubble Parameter at the desired redshift.
Possible calling interfaces ⛓
Generate and return the square of the dimensionless Hubble Parameter for the default or the specifie...
This module contains procedures and generic interfaces and constants for cosmological calculations.
- Warning
- The condition
omegaM + omegaL + omegaR + omegaK = 1
must hold in all circumstances.
The condition 1 <= zplus1
must hold in all circumstances.
These conditions are verified only if the library is built with the preprocessor macro CHECK_ENABLED=1
.
-
The
pure
procedure(s) documented herein become impure
when the ParaMonte library is compiled with preprocessor macro CHECK_ENABLED=1
.
By default, these procedures are pure
in release
build and impure
in debug
and testing
builds.
- Note
- Dropping all optional arguments corresponds to the \(\Lambda\)CDM Universe with the latest experimental parameter inferences.
-
Note that
omegaK
(i.e., the spatial curvature density of the Universe) is defined as omegaK = 1 - omegaM - omegaL - omegaR
.
However, it is requested explicitly in this
-
Setting
omegaM = 1
and omegaL = 0
corresponds to the Einstein–de Sitter model of the universe proposed by Albert Einstein and Willem de Sitter in 1932.
- See also
- LOG_HUBBLE_CONST
HUBBLE_DISTANCE_MPC
HUBBLE_CONST
OMEGA_M
OMEGA_L
OMEGA_R
OMEGA_K
Example usage ⛓
9 type(display_type) :: disp
13 call disp%show(
"getHubbleParamNormedSq(zplus1 = 1.1)")
18 call disp%show(
"getHubbleParamNormedSq(zplus1 = 1.1d0)")
23 call disp%show(
"getHubbleParamNormedSq(zplus1 = 1.1_RKH)")
28 call disp%show(
"getHubbleParamNormedSq(zplus1 = [real :: 1, 2, 3, 4])")
33 call disp%show(
"getHubbleParamNormedSq(zplus1 = [real :: 1, 2, 3, 4], omegaM = 0.3, omegaL = 0.7)")
38 call disp%show(
"getHubbleParamNormedSq(zplus1 = [real :: 1, 2, 3, 4], omegaM = 0.3, omegaL = 0.5, omegaR = 0.2)")
43 call disp%show(
"getHubbleParamNormedSq(zplus1 = [real :: 1, 2, 3, 4], omegaM = 0.3, omegaL = 0.5, omegaR = 0.1, omegaK = 0.1)")
54 integer(IK) ,
parameter :: NP
= 1000_IK
56 integer(IK) :: i, fileUnit
58 open(newunit
= fileUnit, file
= "getHubbleParamNormedSq.RK.txt")
59 zplus1
= getLogSpace(logx1
= log(
1.), logx2
= log(
10.), count
= NP)
60 do i
= 1_IK,
size(zplus1,
1,
IK)
61 write(fileUnit,
"(*(g0,:,', '))") zplus1(i)
&
Generate count evenly-logarithmically-spaced points over the interval [base**logx1,...
This is a generic method of the derived type display_type with pass attribute.
This is a generic method of the derived type display_type with pass attribute.
This module contains procedures and generic interfaces for generating arrays with linear or logarithm...
real(RKB), parameter HUBBLE_CONST
The scalar real constant of kind with highest available precision RKB representing the Hubble constan...
This module contains classes and procedures for input/output (IO) or generic display operations on st...
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
integer, parameter RKH
The scalar integer constant of intrinsic default kind, representing the highest-precision real kind t...
Generate and return an object of type display_type.
Example Unix compile command via Intel ifort
compiler ⛓
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example Windows Batch compile command via Intel ifort
compiler ⛓
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
Example Unix / MinGW compile command via GNU gfortran
compiler ⛓
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example output ⛓
11+1.10260999999999999999999999999999999
15+1.00000000,
+3.17000008,
+9.05999947,
+20.5300007
19+1.00000000,
+3.10000014,
+8.80000019,
+19.9000015
23+1.00000000,
+6.10000038,
+24.8000011,
+70.9000015
26getHubbleParamNormedSq(zplus1
= [real ::
1,
2,
3,
4], omegaM
= 0.3, omegaL
= 0.5, omegaR
= 0.1, omegaK
= 0.1)
27+1.00000000,
+4.90000010,
+17.6000004,
+46.9000015
Postprocessing of the example output ⛓
3import matplotlib.pyplot
as plt
16xlab = {
"CK" :
"redshift: z ( real/imaginary components )"
17 ,
"IK" :
"redshift: z ( integer-valued )"
18 ,
"RK" :
"redshift: z ( real-valued )"
20legends = [
r"$(\Omega_M, \Omega_\Lambda, \Omega_R, \Omega_K) = (0.3, 0.7, 0.0, 0.0)$"
21 ,
r"$(\Omega_M, \Omega_\Lambda, \Omega_R, \Omega_K) = (1.0, 0.0, 0.0, 0.0)$"
22 ,
r"$(\Omega_M, \Omega_\Lambda, \Omega_R, \Omega_K) = (0.0, 1.0, 0.0, 0.0)$"
23 ,
r"$(\Omega_M, \Omega_\Lambda, \Omega_R, \Omega_K) = (.30, .30, .40, 0.0)$"
24 ,
r"$(\Omega_M, \Omega_\Lambda, \Omega_R, \Omega_K) = (.25, .25, .25, .25)$"
27for kind
in [
"IK",
"CK",
"RK"]:
29 pattern =
"*." + kind +
".txt"
30 fileList = glob.glob(pattern)
31 if len(fileList) == 1:
33 df = pd.read_csv(fileList[0], delimiter =
", ")
35 fig = plt.figure(figsize = 1.25 * np.array([6.4, 4.8]), dpi = 200)
39 plt.plot( df.values[:, 0] - 1
42 , linewidth = linewidth
45 plt.plot( df.values[:,1] - 1
48 , linewidth = linewidth
52 plt.plot( df.values[:, 0] - 1
55 , linewidth = linewidth
62 plt.xticks(fontsize = fontsize - 2)
63 plt.yticks(fontsize = fontsize - 2)
64 ax.set_xlabel(xlab[kind], fontsize = 17)
65 ax.set_ylabel(
"The Hubble Parameter [km / s / Mpc]", fontsize = 17)
71 plt.grid(visible =
True, which =
"both", axis =
"both", color =
"0.85", linestyle =
"-")
72 ax.tick_params(axis =
"y", which =
"minor")
73 ax.tick_params(axis =
"x", which =
"minor")
76 plt.savefig(fileList[0].replace(
".txt",
".png"))
78 elif len(fileList) > 1:
80 sys.exit(
"Ambiguous file list exists.")
Visualization of the example output ⛓
- Test:
- test_pm_cosmology
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
-
If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
-
If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
- Copyright
- Computational Data Science Lab
- Author:
- Amir Shahmoradi, Wednesday 5:43 PM, December 25, 2013, Institute for Fusion Studies, The University of Texas at Austin
Definition at line 2963 of file pm_cosmology.F90.