Presentation is loading. Please wait.

Presentation is loading. Please wait.

Gong-Bo Zhao ICG, Portsmouth May, 2010 Play with CAMB/CosmoMC.

Similar presentations


Presentation on theme: "Gong-Bo Zhao ICG, Portsmouth May, 2010 Play with CAMB/CosmoMC."— Presentation transcript:

1 Gong-Bo Zhao ICG, Portsmouth May, 2010 Play with CAMB/CosmoMC

2 Why CAMB/CosmoMC? 2 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

3 This 4.5-hr course is to … 3 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

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

5 Warming-ups 5 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

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

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

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

9 Structure of CAMB_GetResults 9 ICG PhD lectures May, 2010

10 Structure of CMBmain 10 ICG PhD lectures May, 2010

11 Structure of CMBmain 11 ICG PhD lectures May, 2010

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

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

14 Hacking 1: Dynamical DE 14 Task: Default CAMB only works for constant w. Modify it to implement the CPL parametrisa-tion, i.e. w(a)=w 0 +w a (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! 15 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 16 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 if end function Funcofw 17 ICG PhD lectures May, 2010

18 Output m 18 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 20 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 21 ICG PhD lectures May, 2010

22

23 Output Dark Energy perturbation d DE ( h ), v DE ( h ) at k=10 -3 Mpc Note that in CAMB language d DE = y(EV%w_ix) v DE = 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?! 26 Output CMB Cl’s for the model w 0 =-1.5, w a =+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 27 ICG PhD lectures May, 2010

28

29 29 ICG PhD lectures May, 2010

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

31 Hacking 2: TO BE OR NOT TO BE ?? -- MODIFY CAMB TO WORK IN MODIFIED GRAVITY 31 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 Scalar-tensor gravity (e.g. Chameleon, f(R)…) DGP, Degravitation … 32 Dark Matter Atoms Indistinguishable at the background level Need to study the structure growth to break the degeneracy

33 Linear perturbation in FRW universe 33 General Relativity Modified Gravity

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

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

36 36 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).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 37 ICG PhD lectures May, 2010

38 38 ICG PhD lectures May, 2010

39 Fit your own parameters using CosmoMC 39 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? 40 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 41 ICG PhD lectures May, 2010 Astro-ph/

42 Useful references 42 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!! 43 ICG PhD lectures May, 2010


Download ppt "Gong-Bo Zhao ICG, Portsmouth May, 2010 Play with CAMB/CosmoMC."

Similar presentations


Ads by Google