In [ ]:
from numpy import matlib as ml
from phys_const import *
execfile('flrw_param.py')
#indices of r
ind = 100
#dist from point to point
ptp=1
r,M,tB,E=np.genfromtxt('model_fun.dat',unpack=True)
t,t1=np.genfromtxt('t.dat',unpack=True)
R_min=np.genfromtxt('R_min.dat');
R_max=np.genfromtxt('R_max.dat');
R_zero=np.genfromtxt('R_zero.dat');
a=ml.repmat(r,R_zero.shape[0],1)
a_min=R_min/a
a_max=R_max/a
a_zero=R_zero/a
clf()
#xlim([0.,t_max*Gyr_per_Gpc])
#ylim([0.,1.])
rc('text', usetex=True)
rc('font', family='serif',size="15")
plot(t[::ptp]*Gyr_per_Gpc,a_min[::ptp,ind],'b-',label="min")
plot(t[::ptp]*Gyr_per_Gpc,a_max[::ptp,ind],'g-',label="max")
plot(t[::ptp]*Gyr_per_Gpc,a_zero[::ptp,ind],'c-',label="zero")
xlabel("t [Gyr]")
ylabel("a",rotation=0,labelpad=15)
legend(loc='upper left')
#plt.savefig('a_{0}.png'.format(Om_m_0), bbox_inches='tight')
In [ ]:
from scipy import integrate
def ft(x):
return 1.0 /( H0*sqrt( (Om_m_0/x) - (Om_m_0 - 1) ) )
a1=1.0
a2=1.0/(1+1e6)
a = linspace(a2,a1,1000)
t_min = []
t_plus = []
t_zero = []
Om_m_0 = 1.0
for ai in a[:]:
tx,ex = integrate.quad(ft,a2,ai)
t_zero.append(tx)
Om_m_0 = 1.1
for ai in a[:]:
tx,ex = integrate.quad(ft,a2,ai)
t_plus.append(tx)
Om_m_0 = 0.9
for ai in a[:]:
tx,ex = integrate.quad(ft,a2,ai)
t_min.append(tx)
t_min=array(t_min)
t_plus=array(t_plus)
t_zero=array(t_zero)
clf()
rc('text', usetex=True)
rc('font', family='serif',size="15")
plot(t_zero[:],a[:],'r-',label="zero")
plot(t_plus[:],a[:],'b-',label="plus")
plot(t_min[:],a[:],'g-',label="min")
xlabel("t [Gyr]")
ylabel("a",rotation=0,labelpad=15)
legend(loc='upper left')