LAL  7.5.0.1-08ee4f4
LALCosmologyCalculator.h
Go to the documentation of this file.
1 /* Copyright (C) 2012 Walter Del Pozzo, Tjonnie Li
2  *
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with with program; see the file COPYING. If not, write to the
15  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16  * MA 02110-1301 USA
17  */
18 
19 #ifndef LALCOSMOLOGYCALCULATOR_H
20 #define LALCOSMOLOGYCALCULATOR_H
21 
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include <string.h>
25 #include <math.h>
26 #include <gsl/gsl_const_mksa.h>
27 #include <gsl/gsl_integration.h>
28 
29 typedef struct tagLALCosmologicalParameters
30 {
31  double h; /* normalised hubble constant h = H0/100km/Mpc/s */
32  double om; /* matter energy density */
33  double ol; /* cosmological constant density */
34  double ok; /* curvature */
35  double w0; /* 0th order dark energy equation of state parameter */
36  double w1; /* 1st order dark energy equation of state parameter */
37  double w2; /* 2nd order dark energy equation of state parameter */
39 
40 typedef struct tagLALCosmologicalRateParameters
41 {
42  double r0; /* local coalescence rate in units of Mpc^-3 yr^-1 */
43  double W; /* phenomenological parameter for the analytical fit to the SFR rate */
44  double Q; /* phenomenological parameter for the analytical fit to the SFR rate */
45  double R; /* phenomenological parameter for the analytical fit to the SFR rate */
47 
48 typedef struct tagLALCosmologicalParametersAndRate
49 {
53 
56  double z);
57 
58 double XLALAngularDistance(
60  double z);
61 
64  double z);
65 
68  double z);
69 
70 double XLALHubbleDistance(
72  );
73 
74 double XLALHubbleParameter(double z,
75  void *omega
76  );
77 
80  double z);
81 
83  double z,
84  void *omega);
85 
86 double XLALComovingVolume(
88  double z);
89 
90 
92  double z,
93  void *omega);
94 
97  double z,
98  double zmax);
99 
101 
103 
104 LALCosmologicalParameters *XLALCreateCosmologicalParameters(double h, double om, double ol, double w0, double w1, double w2);
105 
107 
112 double XLALGetW0(LALCosmologicalParameters *omega);
113 double XLALGetW1(LALCosmologicalParameters *omega);
114 double XLALGetW2(LALCosmologicalParameters *omega);
116 
117 
118 LALCosmologicalRateParameters *XLALCreateCosmologicalRateParameters(double r0, double W, double Q, double R);
121 double XLALStarFormationDensity(double z, void *rate);
122 
123 double XLALRateWeightedUniformComovingVolumeDensity(double z, void *params);
126 
130 #endif
131 
double XLALGetOmegaLambda(LALCosmologicalParameters *omega)
double XLALComovingVolume(LALCosmologicalParameters *omega, double z)
This function computes the comoving volume between 0 and z.
double XLALGetW2(LALCosmologicalParameters *omega)
double XLALLuminosityDistance(LALCosmologicalParameters *omega, double z)
The set of functions in this module implements the standard cosmological distance measures defined a ...
double XLALGetLocalRate(LALCosmologicalRateParameters *rate)
Returns the local rate.
double XLALGetHubbleConstant(LALCosmologicalParameters *omega)
The next set of functions return specific parameters from the LALCosmologicalParameters structure.
double XLALIntegrateComovingVolume(LALCosmologicalParameters *omega, double z)
Function that integrates the comoving volume element.
double XLALGetOmegaK(LALCosmologicalParameters *omega)
double XLALRateWeightedUniformComovingVolumeDensity(double z, void *params)
Returns the Rate weighted uniform comoving volume density.
double XLALIntegrateComovingVolumeDensity(LALCosmologicalParameters *omega, double z)
Function that integrates the uniform in comoving volume density to compute the normalisation factor.
double XLALComovingTransverseDistance(LALCosmologicalParameters *omega, double z)
Computes the comoving transverse distance from the comoving line-of-sight distance (proper distance) ...
double XLALHubbleParameter(double z, void *omega)
Computes the inverse of the Hubble parameter at redshift z Eq.
LALCosmologicalRateParameters * XLALCreateCosmologicalRateParameters(double r0, double W, double Q, double R)
Function to create a LALCosmologicalRateParameters structure.
double XLALUniformComovingVolumeDistribution(LALCosmologicalParameters *omega, double z, double zmax)
This function computes the value of a uniform probability distribution over the comoving volume.
double XLALGetOmegaMatter(LALCosmologicalParameters *omega)
double XLALComovingVolumeElement(double z, void *omega)
This function computes the comoving volume element (a 4&pi shell) between redshift z and z+dz.
double XLALIntegrateHubbleParameter(LALCosmologicalParameters *omega, double z)
Computes the integral of inverse of the Hubble parameter at redshift z.
LALCosmologicalParametersAndRate * XLALCreateCosmologicalParametersAndRate(void)
Creates a cosmological parameters and rate structure.
double XLALRateWeightedComovingVolumeDistribution(LALCosmologicalParametersAndRate *p, double z, double zmax)
Returns the source redshifts distribution function obtained by normalizing the differential rate dR/d...
double XLALGetW0(LALCosmologicalParameters *omega)
void XLALDestroyCosmologicalParametersAndRate(LALCosmologicalParametersAndRate *p)
Destroys a cosmological parameters and rate structure.
double XLALComovingLOSDistance(LALCosmologicalParameters *omega, double z)
Computes the comoving line-of-sight distance (usually called the proper distance) by integrating the ...
double XLALAngularDistance(LALCosmologicalParameters *omega, double z)
Computes the angular size distance by dividing the comoving transverse distance by 1+z Eq.
void XLALDestroyCosmologicalParameters(LALCosmologicalParameters *omega)
Destroys a LALCosmologicalParameters structure.
double XLALUniformComovingVolumeDensity(double z, void *omega)
This function computes the value of a uniform probability density distribution over the comoving volu...
double XLALGetW1(LALCosmologicalParameters *omega)
double XLALHubbleDistance(LALCosmologicalParameters *omega)
Computes the Hubble distance, independent of the redshift.
void XLALSetCosmologicalParametersDefaultValue(LALCosmologicalParameters *omega)
Function to set a LALCosmologicalParameters structure to the default LambdaCDM value (see http://arxi...
void XLALSetCosmologicalRateParametersDefaultValue(LALCosmologicalRateParameters *params)
Function to set a LALCosmologicalRateParameters structure to the default independent of z value.
void XLALDestroyCosmologicalRateParameters(LALCosmologicalRateParameters *rate)
Destroys a LALCosmologicalParameters structure.
double XLALStarFormationDensity(double z, void *rate)
Implements the fit to the SFR in Eq.7 of Coward, Burman 2005 ( http://arxiv.org/abs/astro-ph/0505181 ...
LALCosmologicalParameters * XLALCreateCosmologicalParameters(double h, double om, double ol, double w0, double w1, double w2)
Creates a LALCosmologicalParameters structure from the values of the cosmological parameters.
double XLALIntegrateRateWeightedComovingVolumeDensity(LALCosmologicalParametersAndRate *p, double z)
Function that integrates the uniform in comoving volume density to compute the normalisation factor.
static double Q(double mu, double x)
Definition: XLALMarcumQ.c:99
LALCosmologicalRateParameters * rate
LALCosmologicalParameters * omega