lesgourg / class_public

Public repository of the Cosmic Linear Anisotropy Solving System (master for the most recent version of the standard code; GW_CLASS to include Cosmic Gravitational Wave Background anisotropies; classnet branch for acceleration with neutral networks; ExoCLASS branch for exotic energy injection; class_matter branch for FFTlog)
230 stars 285 forks source link

Background.c equations for dark matter decay #407

Closed astrogirl1 closed 3 years ago

astrogirl1 commented 3 years ago

Hi again,

I have introduced new parameters to the code, which are being read and used by CLASS successfully. The issue that I am running into is I am trying to trigger the following if condition to use the equations with the newly added parameters but it is not working. I am unsure where/how I should define has_dcdm so that the condition is TRUE and the equations are calculated.

I know this because I added a print statement inside the if condition and nothing is printing. I have tried to use this in CLASS on its own (using explanatory.ini and defining values there, even has_dcdm) and also using MontePython, but the posteriors for my variables looks exactly like the input priors.

if (pba->has_dcdm == _TRUE_){ printf("'new_param2' input parameter = %g\n", pba->new_param2); /** - compute dcdm density \f$ \rho' = -3aH \rho - a \Gamma \rho \f$*/ dy[pba->index_bi_rho_dcdm] = -3.*y[pba->index_bi_a]*pvecback[pba->index_bg_H]*y[pba->index_bi_rho_dcdm]- y[pba->index_bi_a]*pba->new_param1*pba->Gamma_dcdm*y[pba->index_bi_rho_dcdm]; }

Thank you for your help! Meera

lesgourg commented 3 years ago

By looking into input.c and background.c you can see what happens:

In conclusion, you are not supposed to pass has_dcdm in your input parameter file, but only Omega_dcdmdr or omega_dcdmdr, as documented in explanatory.ini. All the cosmological parameters understood by CLASS are documented in explanatory.ini, and no other cosmological parameter is understood by CLASS (unless you modify the code yourself).

astrogirl1 commented 3 years ago

Yes, this has worked thank you!