Cosmology.jl icon indicating copy to clipboard operation
Cosmology.jl copied to clipboard

Adds ODEs for structure growth. Makes WCDM and LCDM initialization more uniform.

Open dforero0896 opened this issue 2 years ago • 3 comments

Hi, I have taken the liberty to add some functionality by providing a function to compute the growth factor and its first and second derivatives. So far I have not been able to redefine the Cosmology structures so that they allow for a cache in order to avoid re-solving the ODE in each call like fastpm does, for example. I have added tests for this part in the test suite.

I have also modified the Cosmology structures so they are all defined as the WCDM were, within the loop. I think this makes development much easier. Moreover, I made the structures able to accept kwargs instead and changed the relevant parameters for the definition of a cosmology. In particular, OmegaR, and OmegaM are now derived from OmegaC, OmegaB, Neff and T_cmb. Nonetheless, I have left OmegaM and OmegaR kewords in the cosmology function so the tests are still compatible.

Please feel free to check and modify as you please and merge if you find these modifications useful :). Also don;t hesitate to write back if there are any questions. Thanks!

dforero0896 avatar Sep 12 '22 20:09 dforero0896

Codecov Report

Merging #45 (d163fe0) into master (87e62fd) will decrease coverage by 8.54%. The diff coverage is 86.30%.

@@             Coverage Diff             @@
##            master      #45      +/-   ##
===========================================
- Coverage   100.00%   91.45%   -8.55%     
===========================================
  Files            1        1              
  Lines           74      117      +43     
===========================================
+ Hits            74      107      +33     
- Misses           0       10      +10     
Impacted Files Coverage Δ
src/Cosmology.jl 91.45% <86.30%> (-8.55%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Sep 12 '22 20:09 codecov[bot]

Is there any update on this PR? I have implemented in some of my packages a growth factor evaluation using DiffEq, which looks quite similar to the written here. It would be nice to have a single, community tested implementation for this kind of calculation.

marcobonici avatar Aug 15 '23 20:08 marcobonici

Sorry, I personally never had the time to look into this also because I'm not much into this field. However I'd note that DifferentialEquations.jl is a quite heavy dependency which I'd rather not add to such a lightweight package like Cosmology.jl. Is there any possibility of making this feature a package extension, so that it's enabled only if DifferentialEquations.jl is already present in the environment?

giordano avatar Aug 15 '23 20:08 giordano