Escolar Documentos
Profissional Documentos
Cultura Documentos
import numpy as np
import matplotlib
# Some constants
h = H0/100.0
# do a little calculation
zage = 0.0
for i in range(n):
a = delta_a*(i + 0.5)
_a = 1.0/a
for i in range(n):
a = az+delta_a*(i + 0.5)
_a = 1.0/a
dtt = delta_a*dtt
ratio = 1.0
if x > 0.1:
if w_k > 0:
ratio = math.sinh(x)/x
else:
ratio = math.sin(x)/x
else:
y = x*x
if w_k < 0: y = -y
ratio = 1.0 + y/6.0 + y*y/120.0 # series expansion for sin(x) and sinh(x)
da = az*dcmt
dl = dcmt/az
# # human-readable
zage_Gyr = HtoGyr/H0*zage
age_Gyr = (HtoGyr/H0)*age
dcmr_Mpc = (c/H0)*dcmr
dtt_Gyr = (HtoGyr/H0)*dtt
da_mpc = (c/H0)*da
dl_mpc = (c/H0)*dl
print('It is now ' + str(age_Gyr) + ' Gyr since the Big Bang')
dcmrlist, dptelist, dalist, dllist, dttlist, zagelist, agelist = [], [], [], [], [], [], []
for zi in z:
dcmr, dpte, da, dl, dtt, zage, age = cosmos_at_z(zi, H0, w_r, w_m, w_v, n)
dcmrlist.append(dcmr)
dptelist.append(dpte)
dalist.append(da)
dllist.append(dl)
dttlist.append(dtt)
zagelist.append(zage)
agelist.append(age)
return dcmrlist, dptelist, dalist, dllist, dttlist, zagelist, agelist
def plot_proper_dist():
plt.xscale('log')
plt.yscale('log')
plt.xlabel(r'$z$', fontsize=20)
plt.show()
plt.savefig('fahmi2.png')
plt.xscale('log')
plt.yscale('log')
plt.xlabel(r'$z$', fontsize=20)
plt.show()
plt.savefig('fahmi3.png')
if __name__ == "__main__":
plot_proper_dist()