In [1]:
from scipy import integrate
from math import *
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
In [2]:
z=np.arange(0.01,10000)
Ezo = lambda x: 1/(x*sqrt(0.01*(x)**3+0.99*(x)**2))
np.vectorize(Ezo)
#Calculate comoving distance of a data point using the Redshift - This definition is based on the cosmology model we take. Here the distance for E-dS universe is considered. Also note that c/H0 ratio is cancelled in the equations and hence not taken.
Hzo = lambda x: 1/(sqrt(0.01*(x)**3+0.99*(x)**2))
np.vectorize(Hzo)
def t_OU(x):
return integrate.quad(Ezo, 0, 1/(1+x))
t_OU=np.vectorize(t_OU)
def a_OU(x):
return integrate.quad(Ezo, 0, x)
a_OU=np.vectorize(a_OU)
#sp.exp(
#print t_OU(z)
#plt.plot(z,t_OU(z)[1])
#print z
#print 1/(1+z)
print t_OU(z)[0]
print np.exp(a_OU(z)[0])
#plt.plot(t_OU(z)[0],1/(1+z))
plt.plot(t_OU(z)[0],np.exp(a_OU(z)[0]))
Out[2]:
In [5]:
a=np.arange(0.01,1,0.01)
sc = lambda x: 5/(4*sqrt(1+1/(2*x)))
def t_OU(x):
return integrate.quad(sc, 0, x)
t_OU=np.vectorize(t_OU)
print a
print t_OU(a)[0]
plt.plot(t_OU(a)[0],a)
#plt.plot(t_OU(a)[0],t_OU(a)[0]+0.18)
#plt.plot(t_OU(a)[0],1.1*t_OU(a)[0]+0.12)
#plt.plot(t_OU(a)[0],np.power(t_OU(a)[0],2.0/3.0))
Out[5]:
In [3]: