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)
233 stars 289 forks source link

output ncdm distribution function #76

Open ctchiang opened 8 years ago

ctchiang commented 8 years ago

Hi,

I was trying to output the ncdm distribution function by modifying the subroutine "perturb_total_stress_energy". Basically I added some lines to get y[index] with the correct index corresponding to ncdm species. Most of the distribution functions I got for given wavenumber, momentum, and l (moment in Legendre polynomials) are fine, but some of them are very strange. Specifically, I got NaN, and extremely large numbers like 1e308 for large l. I wonder if there is something wrong in my added lines.

My modified version is attached, and the added lines are sandwiched by "!!!!!!!!!!!!!!!!!!!" at line 5390.

perturbations_w_youtput.c.zip

In terms of the parameter file, I have N_ncdm = 0 m_ncdm = 0.1 ncdm_fluid_approximation = 3 l_max_ncdm = 20 gauge=newtonian

Thanks so much for your reply! Chi-Ting

ctchiang commented 8 years ago

Another question - I thought that in the CLASS format, the large-scale (super-horizon) CDM transfer functions in newtonian and synchronous gauge are related by

T{synchronous} = T{newtonian} * (2/3) * (k/aH)^2

My result is attached, which is not what I expected. newtonian_to_synchronous.pdf

Do I miss something here?

Thanks again for your reply! Chi-Ting