231 int TFmdm_set_cosm (
double omega_matter,
double omega_baryon,
double omega_hdm,
int degen_hdm,
double omega_lambda,
double hubble,
double redshift,
double As=2.56e-9,
double k_pivot=0.05,
double n_spec=0.96)
233 double z_drag_b1, z_drag_b2, omega_denom;
241 if (omega_baryon<0.0) {
243 "TFmdm_set_cosm(): Negative omega_baryon set to trace amount.\n");
249 "TFmdm_set_cosm(): Negative omega_hdm set to trace amount.\n");
254 fprintf(stderr,
"TFmdm_set_cosm(): Negative Hubble constant illegal.\n");
256 }
else if (hubble>2.0) {
257 fprintf(stderr,
"TFmdm_set_cosm(): Hubble constant should be in units of 100 km/s/Mpc.\n");
261 if (redshift<=-1.0) {
262 fprintf(stderr,
"TFmdm_set_cosm(): Redshift < -1 is illegal.\n");
264 }
else if (redshift>99.0) {
266 "TFmdm_set_cosm(): Large redshift entered. TF may be inaccurate.\n");
270 if (degen_hdm<1) degen_hdm = 1;
275 if (omega_baryon<=0) omega_baryon=1e-5;
276 if (omega_hdm<=0) omega_hdm=1e-5;
279 omhh = omega_matter*pow(hubble, 2);
280 obhh = omega_baryon*pow(hubble, 2);
281 onhh = omega_hdm*pow(hubble, 2);
282 f_baryon = omega_baryon/omega_matter;
283 f_hdm = omega_hdm/omega_matter;
293 z_drag_b1 = 0.313*pow(
omhh,-0.419)*(1+0.607*pow(
omhh,0.674));
294 z_drag_b2 = 0.238*pow(
omhh,0.223);
295 z_drag = 1291*pow(
omhh,0.251)/(1.0+0.659*pow(
omhh,0.828))*(1.0+z_drag_b1*pow(
obhh,z_drag_b2));
301 p_c = 0.25*(5.0-sqrt(1+24.0*
f_cdm));
302 p_cb = 0.25*(5.0-sqrt(1+24.0*
f_cb));
304 omega_denom = omega_lambda+pow(1.0+redshift, 2)*(
omega_curv+omega_matter*(1.0+redshift));
306 omega_matter_z = omega_matter*pow(1.0+redshift,2)*(1.0+redshift)/omega_denom;
309 growth_to_z0 =
z_equality*2.5*omega_matter/(pow(omega_matter,4.0/7.0)-omega_lambda + (1.0+omega_matter/2.0)*(1.0+omega_lambda/70.0));
353 double tf_sup_L, tf_sup_C;
370 tf_sup_C = 14.4+325/(1+60.5*pow(
qq_eff,1.11));
407 double Pk (
double kk)
424 std::vector<double>
Pk(std::vector<double> kk) {
426 std::vector<double> _Pk(kk.size(), 0);
428 for (
size_t i=0; i<kk.size(); i++)
double f_cdm
CDM fraction.
double f_cb
baryon + CDM fraction
double growth_cbnu
growth factor for CDM+Baryon+Neutrino pert.
double omhh
Omega_matter * hubble^2.
double gamma_eff
effective
double z_equality
redshift of matter-radiation equality
double num_degen_hdm
number of degenerate massive neutrino species
double pk_normalization
the power spectrum normalization
double omega_curv
= 1 - omega_matter - omega_lambda
double p_c
the correction to the exponent before drag epoch
double TFmdm_onek_mpc(double kk)
compute the transfer function
double z_drag
redshift of the drag epoch
double alpha_gamma
sqrt(alpha_nu)
double ns
the spectral index
double tf_sup
suppressed TF
double growth_cb
growth factor for CDM+Baryon perturbations
double y_drag
ratio of z_equality to z_drag
double k_equality
the comoving wave number of the horizon at equality
double growth_k0
D_1(z) – the growth function as k->0.
EisensteinHu()=default
default constructor
double omega_lambda_z
Omega_lambda at the given redshift.
double sound_horizon_fit
the sound horizon at the drag epoch
double omega_matter_z
Omega_matter at the given redshift.
double Pk(double kk)
get the power spectrum in unit of h^{-3}Mpc^{-3}
std::vector< double > Pk(std::vector< double > kk)
get the power spectrum in unit of h^{-3}Mpc^{-3}
double max_fs_correction
correction near maximal free streaming
double theta_cmb
the temperature of the CMB; in units of 2.7 K
double tf_master
master TF
double beta_c
the correction to the log in the small-scale
double f_hdm
massive Neutrino fraction
double qq
wavenumber rescaled by
double hhubble
need to pass Hubble constant to TFmdm_onek_hmpc()
~EisensteinHu()=default
default destructor
double f_baryon
baryon fraction
double y_freestream
the epoch of free-streaming for a given scale
double f_bnu
baryon + Massive Neutrino fraction
double qq_nu
wavenumber compared to maximal free streaming
double TFmdm_onek_hmpc(double kk)
compute the transfer function
int TFmdm_set_cosm(double omega_matter, double omega_baryon, double omega_hdm, int degen_hdm, double omega_lambda, double hubble, double redshift, double As=2.56e-9, double k_pivot=0.05, double n_spec=0.96)
set the cosmological parameters
double qq_eff
wavenumber rescaled by effective Gamma
double alpha_nu
the small-scale suppression
double onhh
Omega_hdm * hubble^2.
double p_cb
the correction to the exponent after drag epoch
double obhh
Omega_baryon * hubble^2.
double tf_cbnu
the transfer function for density-weighted CDM + Baryon + Massive Neutrino perturbations.
double tf_cb
the transfer function for density-weighted CDM + Baryon perturbations.
double growth_to_z0
D_1(z)/D_1(0) – the growth relative to z=0.
static const double pi
: the ratio of a circle's circumference to its diameter
static const double cc
: the speed of light in vacuum (the value is exact) [km/sec]
The global namespace of the CosmoBolognaLib