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

Adding sigma8 as an input parameter (=>class_fzero_ridder(L:3435) :error; root must be bracketed in zriddr.) #83

Closed borisbolliet closed 8 years ago

borisbolliet commented 8 years ago

Dear CLASS Users and Masters,

I am trying to add sigma8 as an input parameter. I have followed the method presented by @ThomasTram at the CLASS Workshop in Barcelona.

The compilation works fine.

However, it seems the code gets stuck while trying to initialize sigma8 as I get the following error message:

/////////////////////////////////////////////////////////////////// _Error running input_init_from_arguments =>input_init_from_arguments(L:179) :error in input_init(&fc, ppr, pba, pth, ppt, ptr, ppm, psp, pnl, ple, pop, errmsg); =>input_init(L:382) :error in class_fzero_ridder(input_fzerofun1d, x1, x2, 1e-5(((fabs(x1))<(fabs(x2))) ? (fabs(x2)) : (fabs(x1)) ), &fzw, &f1, &f2, &xzero, &fevals, errmsg); *_=>class_fzeroridder(L:3435) :error; root must be bracketed in zriddr.** ///////////////////////////////////////////////////////////////

Did anyone encounter the same kind of issue before? Does anyone know the solution to this problem?

Thanks a lot, CLASS is great.

Boris

borisbolliet commented 8 years ago

ISSUE CLOSED I have got a modified version of CLASS with extra modules. On the original version I was able to add sigma8 as a new input parameter without any trouble, following the method presented during the worshop.

In case anyone needs it, let me recall the steps to be done in order to add sigma8 as a new input parameter using the "shooting method" (credit: @ThomasTram ).

fkoehlin commented 8 years ago

Hi Boris,

Many thanks for that recipe. I recently followed your steps to make sigma8 an input parameter (CLASS 2.5.0) and I just wanted to add that in point 1) one necessary change is missing:

// add cs_spectra here (this was missing in original post) enum computation_stage target_cs[] = {cs_thermodynamics, cs_background, cs_background, cs_background, cs_background, cs_background, cs_spectra};

(Maybe that got mixed up with adding cs_spectra in "input.h" because in my case that entry was already there...)

Cheers,

Fabian

mahtaparsa commented 7 years ago

Dear Boris, Thanks for your useful comment. However, I can not understand the last step "Finally, in the "ini" file, specify the desired value for sigma8" . How should I ask in the .ini file to print the sigma8 vs z file?

borisbolliet commented 7 years ago

Hi Fabian and Mahtaparsa,

Fabian: Thank you very much for your comment.

Mahtaparsa:

You just need to specify, e.g. sigma8=0.8 in the **.ini file.

To get a file with sigma8 vs redshift you will need to modify two functions in "background.c":

1) int background_output_titles 2) int background_output_data

Then don't forget to set in the **.ini file:

write background = yes

Let me know if you need further details, Boris

mahtaparsa commented 7 years ago

Dear Boris, Thanks for your reply. Actually, I want to derive a relation for "f sigma8" in order to get an output file of it for my cosmological model. I need a file which contain "f sigma8" in term of redshift, in order to make a likelihood for "f sigma8" with the available observational data. First of all I should know the theory values of "f sigma8" predicted from my model. In background module there are relations for "f" and also "D". However, as I have understood they are for the LCDM model and have been defined from background parameters. I need their relations in the perturbation module (relations for "f" and "sigma8") in order to modify it according to my model. I do not think background module would be useful here.

borisbolliet commented 7 years ago

Yes, you are totally right.

Then, for a MG or DE model, the growth function "f" generally obeys a scale dependent differential equation that you have to implement in the perturbation module (the form of this equation depends on your model).

You have therefore to define a new variable, "f_de" for instance, in the perturbations.h file.

So, after you have done that, just do what I suggested in my previous post, but in the perturbation module (perturboutput***).

Note that a likelihood for "fsigma8" given a MG or DE model is quite ambiguous, as I think the data itself for "fsigma8" is model dependent, it assumes LCDM (correct me if I am wrong).

Best, Boris

borisbolliet commented 7 years ago

(you may want to have a look to this thread too: https://github.com/baudren/montepython_public/issues/93#issuecomment-310117877)

mahtaparsa commented 7 years ago

Dear Boris, "f" measurements are according to LCDM model. However, the "f sigma8" parameter is model-independent. You can see this paper arXiv:0807.0810v2 for more details.