Page 1 of 1

CAMB: modifying equations.f90

Posted: December 23 2019
by Filip Strubbe
Hi,

I am working with CAMB-1.0.12, and I am trying to modify some physics. My first aim is to artificially suppress the growth of only the small scale (large wavenumber k) density perturbations of the cold dark matter species.

I tried to modify the “equation of motion” for the CDM in the “equations.f90” file, which normally reads:
Clxdot=-k*z

I then recompiled using “python setup.py make”, but when I run the simulation, I see no difference in the result, even when replacing the above equation with Clxdot=-k*z*0.

My questions are:
1) I should see some effect of a modified equation of motion, so what am I doing wrong? Am I modifying the wrong equation, or in the wrong file? Is there a problem with recompiling?

2) In “equations.f90” I found the baryon equation of motion: clxbdot=-k*(z+vb). But this equation seems different than what I expected from e.g. Eq. 5-30 in arXiv:astro-ph/9804301v2. Also “dz” seems different than expected from Eq. 5-31. I have looked around but didn’t find exactly the underlying theory behind “equations.f90”. Am I missing something here?

3) Is there a simple intuitive argument why the evolution of perturbations of one species (e.g. Delta_baryon) is independent of the choice of Omega_bh^2 or Omega_cdm^2? From Eq. 6-22 in in arXiv:astro-ph/9804301v2 I would expect that the evolution of each species depends on the SUM of all densities and pressures of all other species.

All feedback is much appreciated,
Filip

Re: CAMB: modifying equations.f90

Posted: December 28 2019
by Antony Lewis
Sounds OK, make sure you re-start Python. The equations neglect some very small pressure terms (matter pressure is only important when coupled via derivatives so the last term in 5-30 is very small).

The evolution equations are not independent of those quantities (except in some limits).

Re: CAMB: modifying equations.f90

Posted: January 02 2020
by Filip Strubbe
Hi,

I have now managed to change the equations of motion in the file "equations.f90", to compile and run - so far so good...

But I still have trouble locating the following equations found in ScalEqs.txt in the file "equations.f90":

drhob:=-3*H(t)*(rhob(t)+pb(t))
drhoc:=-3*H(t)*rhoc(t);

Can somebody point out exactly in which line of equations.f90 these calculations (namely the effect of expansion on the densities of each species) are carried out?

Thanks a lot,

Filip

Re: CAMB: modifying equations.f90

Posted: November 03 2023
by Juan Pablo Brandt
How did you do to compile before running? Is it enough to do "make" inside the fortran folder?

Re: CAMB: modifying equations.f90

Posted: November 03 2023
by Antony Lewis
"python setup.py make" in the main folder will update an existing "pip install -e" installation.