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)
217 stars 291 forks source link

Is there a way to remove baryons? #246

Open hfei10 opened 5 years ago

hfei10 commented 5 years ago

Hi There,

I tried to run CLASS by setting omega_b = 0.0 (and other very small number such as 1e-10) YHe = 0.25 However, I got error message like below:

Error in thermodynamics_init =>thermodynamics_init(L:390) :error in thermodynamics_recombination(ppr,pba,pth,preco,pvecback); =>thermodynamics_recombination(L:2611) :error in thermodynamics_recombination_with_recfast(ppr,pba,pth,preco,pvecback); =>thermodynamics_recombination_with_recfast(L:3253) :error in generic_integrator(thermodynamics_derivs_with_recfast, zstart, zend, y, &tpaw, ppr->tol_thermo_integration, ppr->smallest_allowed_variation, &gi); =>generic_integrator(L:112) :error in rkqs(&x, h, eps, &hdid, &hnext, derivs, parameters_and_workspace_for_derivs, pgi); =>rkqs(L:156) :condition (xnew == *x) is true; stepsize underflow at x=8.544827e+00

I wonder if there is a way to study non-standard cosmology where there is no baryons but just dark matter in CLASS. If there is, can you point out how to correctly do that with CLASS?

Your help will be greatly appreciated!

avishekdusoye commented 5 years ago

This error is coming from the fact that baryons and photon engage in Baryonic Acoustic Oscillation and the sub code RECFAST is trying to solve for the optical depths of the CMB. The removal of baryons imply no BAO and no CMB at all and no recombination as well, because the last surface of scattering of CMB happens when baryons and photon decouple. The nature of CDM cannot interact with photons, (obviously, otherwise we would have detected CDM long time ago). Replacing baryons by CDM is not reflective of true reality because we do observe the CMB.

lesgourg commented 5 years ago

Full agree with Avi. CLASS does expect a photon-baryon decoupling at some point, thus for the code the "minimal non-negotiable requirement" is that both omega_gamma (i.e. T_cmb) and omega_baryon are non zero. Still, it is possible to take a very small omega_b. To reach really small values, you probably need to do extra things, like turning off reionisation with the reio_none option (reionisation cannot happen if omega_b is infinitely small). You should also fix primordial helium yourself manually with the YHe=... input parameter, instead of having it fix by BBN. Let us know if you have other problems while trying the omega_b-->0 limit.

hfei10 commented 5 years ago

Thanks for the reply. I know removing baryons is not reflective of true reality. However, I merely want to study the perturbations from dark matter, and the existing BAO is preventing me from seeing what I want to see. That said, I don't really need the CMB and recombination stuff. I just want to use CLASS as a Boltzmann solver for matter power spectrum. Is this possible?

I tried what what Julien said with reio_parametrization=reio_none YHe=0.25 omega_b --> 0 However, the smallest omega_b I can set is omega_b=9e-4. If I go lower, I got error message like the one I attached in my initial question. So, is there a systematic way to turn off all the things related to baryons and simply run it with dark matter, dark energy and radiation?

lesgourg commented 5 years ago

Sorry hfei10 if my previous answer was not clear enough! I meant that: no, CLASS is not the code you need if you want zero baryons, it's not designed for that. You seem to be under the impression that Omega_b=0 should be a simple limit of the cosmological equation set, and that it is strange not to allow this limit in the code. But it is a very radical thing. If Omega_b=0, then photons never experience Thomson scattering; thus they are not described by the usual Boltzmann equation, but by a a free-streaming Vlasov equation like neutrinos; consequently they never emerged from a tight-coupling regime; and therefore the initial conditions for perturbations read differently. Your intuition is that one can go continuously from a finite Omega_b to Omega_b=0, but concretely this is not the case: Boltzmann codes are based on a number of minimal assumptions, like the fact that one may start to follow the perturbations during a tighty-coupled regime. You are sending this regime back to the Big Bang! For a model with pure CDM, what you would need then is not an Einstein-Bolztmann solver, but a pure Einstein solver; or more precisely a code solving a simple and unique differential equation: the Mezaros equation. It would be much much less work to write a dedicated 50-line code solving this equation in a LambdaCDM background than to teach CLASS or CAMB to extend their range of validity to such a limit. I am actually amazed that one can go down to omega_b=9e-4 in CLASS. Its a pity that you are dealing with a problem in which this is not yet small enough. I am curious of what this problem could be. Are you sure that what you need is not rather a "realistic" P(k) (with non-zero baryons) but after a "de-wiggling process" that can be implemented numerically?

lesgourg commented 5 years ago

P.S. Of course you remember that baryons modify the P(k) of LambdaCDM not just through BAOs, but also through a different shape and amplitude for k>k_eq. Thus, if you turn off baryons, you don't only turn off the oscillations in the P(k), you also distort its smooth component away from the vanilla best-fit model... do you really want that?

hfei10 commented 5 years ago

Hi, thank you for the detailed reply and suggestions. I merely wanted to disentangle the effects of DM from that of baryons. But since CLASS is not built for this, I'll need to rethink about my original purpose and maybe write a short code for that. Anyway, thanks a lot!