Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
growth_lowz_bm.py
Go to the documentation of this file.
1 import numpy as np
2 import matplotlib.pyplot as plt
3 import py_cosmo_mad as csm
4 
5 TCMB=2.725
6 PLOT_STUFF=0
7 WRITE_STUFF=1
8 FS=16
9 
10 def do_all(z_arr,cpar,prefix) :
11  pcs=csm.PcsPar()
12  pcs.background_set(cpar['om'],cpar['ol'],cpar['ob'],cpar['w0'],cpar['wa'],cpar['hh'],TCMB)
13 
14  a_arr=1./(z_arr+1)
15  gf_arr=np.array([pcs.growth_factor(a) for a in a_arr])
16 
17  if PLOT_STUFF==1 :
18  plt.plot(a_arr,gf_arr); plt.xlabel('$a$',fontsize=FS); plt.ylabel('$D(z)$',fontsize=FS); plt.show()
19 
20  if WRITE_STUFF==1 :
21  np.savetxt(prefix+"_gf.txt",np.transpose([z_arr,gf_arr]),header="[1] z, [2] D(z)")
22 
23 z_arr=np.array([0.,1.,2.,3.,4.,5.])
24 
25 cpar_model1={'om': 0.3,'ol': 0.7 ,'ob':0.05,'hh': 0.7,'s8': 0.8,'ns': 0.96,'w0': -1.0, 'wa': 0.0}
26 cpar_model2={'om': 0.3,'ol': 0.7 ,'ob':0.05,'hh': 0.7,'s8': 0.8,'ns': 0.96,'w0': -0.9, 'wa': 0.0}
27 cpar_model3={'om': 0.3,'ol': 0.7 ,'ob':0.05,'hh': 0.7,'s8': 0.8,'ns': 0.96,'w0': -0.9, 'wa': 0.1}
28 cpar_model4={'om': 0.3,'ol': 0.75,'ob':0.05,'hh': 0.7,'s8': 0.8,'ns': 0.96,'w0': -0.9, 'wa': 0.1}
29 cpar_model5={'om': 0.3,'ol': 0.65,'ob':0.05,'hh': 0.7,'s8': 0.8,'ns': 0.96,'w0': -0.9, 'wa': 0.1}
30 
31 do_all(z_arr,cpar_model1,"model1")
32 do_all(z_arr,cpar_model2,"model2")
33 do_all(z_arr,cpar_model3,"model3")
34 do_all(z_arr,cpar_model3,"model4")
35 do_all(z_arr,cpar_model3,"model5")
def do_all(z_arr, cpar, prefix)