Presentation is loading. Please wait.

Presentation is loading. Please wait.

Play with CAMB/CosmoMC

Similar presentations


Presentation on theme: "Play with CAMB/CosmoMC"— Presentation transcript:

1 Play with CAMB/CosmoMC
April 11, 2017 Play with CAMB/CosmoMC Gong-Bo Zhao ICG, Portsmouth May, 2010 ICG PhD lectures

2 Why CAMB/CosmoMC? Very efficient
April 11, 2017 Why CAMB/CosmoMC? Very efficient Well-structured (modulised) -- easy to tweak and hack Well-supported – cosmocoffee.info Popular – mainstream numeric tool in cosmology ICG PhD lectures May, 2010 ICG PhD lectures

3 This 4.5-hr course is to … Show you how to run CAMB/CosmoMC
April 11, 2017 This 4.5-hr course is to … Show you how to run CAMB/CosmoMC Link CAMB equations to Ma&Bertschinger ‘96 Show several useful examples of hacking CAMB -- dynamical dark energy, modified gravity Guide you how to modify CAMB/CosmoMC for your own research purpose Show you useful numerical tricks extensively used in CAMB ICG PhD lectures May, 2010 ICG PhD lectures

4 Theory (see Kazuya, Rob and Cyril’s lectures)
April 11, 2017 This course is not on … Theory (see Kazuya, Rob and Cyril’s lectures) Fortran programming (See Numerical Recipe) ICG PhD lectures May, 2010 ICG PhD lectures

5 April 11, 2017 Warming-ups Download, compile and run CAMB camb.info make clean; make all ./camb params.ini Change model parameters in params.ini and make CMB, P(k) plots change cosmo. params add neutrinos do CMB lensing do vector and tensor modes compare with Wayne Hu’s plots at ICG PhD lectures May, 2010 ICG PhD lectures

6 Look into the code… Analyze the code using “understand for fortran”
(choose the free 15-day trial version)

7 Structure of CAMB Messy? Not really!! ICG PhD lectures May, 2010

8 Structure of CAMB preparation core output results ICG PhD lectures
May, 2010

9 Structure of CAMB_GetResults
ICG PhD lectures May, 2010

10 Structure of CMBmain ICG PhD lectures May, 2010

11 Structure of CMBmain ICG PhD lectures May, 2010

12 CAMB language A,B,C ICG PhD lectures May, 2010

13 CAMB vs. M+B ’96 astro-ph/9506072 Constraint equations (algebraic)
Differential equations to evolve in CAMB Constraint equations (algebraic)

14 Hacking 1: Dynamical DE Task: Default CAMB only works for constant w. Modify it to implement the CPL parametrisa-tion, i.e. w(a)=w0+wa(1-a) and calculate the luminosity distance, CMB and P(k) for a model of {-1.5, +(-)0.4}. Compare your spectra with that of the LCDM model. ICG PhD lectures May, 2010

15 Start the game! Spot the dark energy stuff in CAMB We need w(a), dw/da, Int {[1+w(a)]dlna} Files to hack: equations.f90, inidriver.F90 Subroutine/functions to hack: dtauda, fderivs, output Change the background and the DE perturbation equations!! ICG PhD lectures May, 2010

16 Background evolution For constant w (default CAMB) grhoa2=grhoa2+grhov*a2**2 For functional w (hacked) grhoa2=grhoa2+grhov*Funcofw(a,..)*a2 ICG PhD lectures May, 2010

17 function Funcofw(a,deriv) implicit none real(dl) a, Funcofw, a0
real(dl) w0, wa integer deriv if (a .lt. 1.d-8) then a0 = 1.d-8 else a0 = a end if if (deriv==0) then Funcofw = w0+wa*(1.d0-a0) else if (deriv ==1) then Funcofw = -wa*a0 else if (deriv ==2) then Funcofw = a0**(2.d0 - 3.d0*(1.d0+w0+wa))*exp(3.d0*wa*(a0-1.d0)) end function Funcofw ICG PhD lectures May, 2010

18 Output m open(unit=50,file=‘dL_SN.dat’) do i=1, 1000
In inidriver.F90 open(unit=50,file=‘dL_SN.dat’) do i=1, 1000 zz(i)=1.7d0+dble(i-1)/dble(1000-1) write(50,'(100e15.6)') zz(i), 5*log10((1+zz(i)) & **2*AngularDiameterDistance(zz(i)))+25 end do close(50) ICG PhD lectures May, 2010

19

20 DE perturbation equations
ayprime(EV%w_ix)= -3*adotoa*(cs2_lam-Funcofw(a,0))*(clxq+3*adotoa*& (1+Funcofw(a,0))*vq/k) -(1+Funcofw(a,0))*k*vq -& (1+Funcofw(a,0))*k*z -3*adotoa*adotoa*Funcofw(a,1)*vq/k ayprime(EV%w_ix+1) = -adotoa*(1-3*cs2_lam)*vq + k*cs2_lam*clxq/(1+Funcofw(a,0)) ICG PhD lectures May, 2010

21 ICG PhD lectures May, 2010

22

23 Output Dark Energy perturbation dDE(h), vDE(h) at k=10-3 Mpc-1
Note that in CAMB language dDE = y(EV%w_ix) vDE = y(EV%w_ix+1) Uncomment the stuff in cmbmain.f90, EV%q=1.d-3; EV%q2=EV%q**2 tol1=tol/exp(AccuracyBoost-1) do j=1,6000 tauend = taustart * exp(j/6000._dl*log(CP%tau0/taustart)) call GaugeInterface_EvolveScal(EV,tau,y,tauend,tol1,ind,c,w) write (*,’(4E15.5)') tauend,1/y(1)-1, y(EV%w_ix) ,y(EV%w_ix+1) end do stop ICG PhD lectures May, 2010

24 Weller and Lewis, 2003

25

26 Singularity?! Output CMB Cl’s for the model w0=-1.5, wa=+1.0 to see what happens. This singularity stems from the fact that w crosses -1. Technically, it’s due to the term of dw/dz/(1+w). No-Go Theorem: The w for single fluid (scalar field) cannot cross -1 in GR! For proof, see Appendix of astro- ph/ Solution: astro-ph/ (quintom scenario), or arXiv: (PPF implementation) ICG PhD lectures May, 2010

27 ICG PhD lectures May, 2010

28

29 ICG PhD lectures May, 2010

30 Generalize our hacked code to make it work for an arbitrary w(z).
One further step? Generalize our hacked code to make it work for an arbitrary w(z). Leave it to you guys to play with it for fun!!

31 Hacking 2: TO BE OR NOT TO BE
Hacking 2: TO BE OR NOT TO BE ?? -- MODIFY CAMB TO WORK IN MODIFIED GRAVITY Task Default CAMB only works in GR. Modify it to implement MG. Reproduce the plots on my website. ICG PhD lectures May, 2010

32 Universe is Accelerating
Dark Matter Atoms Scalar-tensor gravity (e.g. Chameleon, f(R)…) DGP, Degravitation Indistinguishable at the background level Need to study the structure growth to break the degeneracy UK COSMOS, 11/18/2009

33 Modified Gravity Linear perturbation in FRW universe
General Relativity UK COSMOS, 11/18/2009

34 What to do technically? Given m(a,k) and g(a,k), we need to solve k2F = -m(a,k) 4pG a2rD F/Y = g(a,k) in the synchronous gauge, which is used in CAMB. Note that ICG PhD lectures May, 2010

35 Finally, we have (for details, see Appendix of 0809.3791),
So we have Finally, we have (for details, see Appendix of ), ICG PhD lectures May, 2010

36 In MG, we need to evolve d and a, and get h from constraint equations.
Note that in default CAMB, d (overdensity for different species) and h (metric perturbation in synchronous gauge) are actually evolved, and other Einstein equations are used as constraint equations (see this slide). In MG, we need to evolve d and a, and get h from constraint equations. To add one more variable to evolve in CAMB, we need to define it, set initial condition for it, and change fderivs and output properly. See how to modify the code in the lecture. ICG PhD lectures May, 2010

37 ICG PhD lectures May, 2010

38 ICG PhD lectures May, 2010

39 Fit your own parameters using CosmoMC
CosmoMC fits your model parameters to data by exploring the parameter space in a smart way (Metropolis-Hastings algorithm). It calls CAMB to calculate the theoretical spectra of a model, and compare to data. ICG PhD lectures May, 2010

40 How to add your own parameter to CosmoMC?
Tell CosmoMC your parameters’ names in CMB_Cls_simple.f90 Define them in cmbtype.f90 Map them in params_CMB.f90 Change the # of parameters in settings.f90 Done!! See the example in the lecture!! ICG PhD lectures May, 2010

41 Astro-ph/ ICG PhD lectures May, 2010

42 Useful references Camb.info; cosmologist.info/cosmomc/
Cosmocoffee.info M+B: astro-ph/ Jussi’s ICG lectures: Numerical Recipe: Plotting software: OriginPro, Matlab, IDL, gnuplot ICG PhD lectures May, 2010

43 Have fun!! ICG PhD lectures May, 2010


Download ppt "Play with CAMB/CosmoMC"

Similar presentations


Ads by Google