$H_0$


In [1]:
from numpy import matlib as ml
from scipy import integrate
from scipy.optimize import curve_fit
from plot_conf import *
execfile('phys_const.py')
execfile('flrw_param.py')

print "k={0}".format(k)
print "Om_0={0}".format(Om_m_0)
#indices of r
ind = 100
#dist from point to point
ptp=20

def ft(x):
    return 1.0 /( H0*sqrt( (Om_m_0/x) - (Om_m_0 - 1) ) )

r,M,tB,E=np.genfromtxt('model_fun.dat',unpack=True)
t,t1=np.genfromtxt('t.dat',unpack=True)
H=np.genfromtxt('exp_a.dat')
H=H/Gyr_per_Gpc
R=np.genfromtxt('R.dat')
a=ml.repmat(r,R.shape[0],1)
a=R/a


a1=1.0
a2=1.0/(1+1e6)
t_result = []
t_error = []
a_in = []
for ai in a[:,ind]:
    tx,ex = integrate.quad(ft,a2,ai)
    t_result.append(tx)
    t_error.append(ex)
    a_in.append(ai)

t_result=array(t_result)
a_in=array(a_in)

H_in = sqrt(Om_m_0*a_in**-3 + Om_k_0*a_in**-2)*H0
H_in = H_in/Gyr_per_Gpc
H_from_a  = sqrt(Om_m_0*a**-3 + Om_k_0*a**-2)*H0
H_from_a  = H_from_a/Gyr_per_Gpc
#ploting
clf()
xlim([0.,t_max*Gyr_per_Gpc])
rc('text', usetex=True)
rc('font', family='serif',size=font_size)
print "H_0={0}".format(H[:,ind].min()*(299792.458/1000)*Gyr_per_Gpc)
plot(t[::ptp]*Gyr_per_Gpc,H[::ptp,ind]*(299792.458/1000)*Gyr_per_Gpc,'r+',label="LTB")
plot(t_result[:]*Gyr_per_Gpc,H_in[:]*(299792.458/1000)*Gyr_per_Gpc,'b-',label="FLRW")

gca().set_yscale('log')

xlabel(r'$t [Gyr]$',size=label_size)
ylabel(r'$H(t,r) \left[ h\,km\,s^{-1}\,Mpc^{-1}\right] $',size=label_size)
legend(loc='upper right',prop={'size':legend_size})

plt.savefig('H_{0}.png'.format(Om_m_0), bbox_inches='tight')


k=0.0556325
Om_0=1.5
H_0=99.9998395516

In [12]:
from phys_const import *

ro = 3*H0*H0/8*pi*G

print "ro={0}".format(ro)

G2=6.673e-11/c**2
H2=H0_kmsMpc/c**2

ro2 = 3*H2


ro=6.27315278072e-11

$\rho$


In [11]:
from numpy import matlib as ml
from scipy import integrate
from scipy.optimize import curve_fit
from plot_conf import *
#from phys_const import *
execfile('phys_const.py')
execfile('flrw_param.py')
print "Om_m_0={0}".format(Om_m_0)
#indices of r
ind = 100
#dist from point to point
ptp=20

def ft(x):
    return 1.0 /( H0*sqrt( (Om_m_0/x) - (Om_m_0 - 1) ) )

r,M,tB,E=np.genfromtxt('model_fun.dat',unpack=True)
t,t1=np.genfromtxt('t.dat',unpack=True)
rho=np.genfromtxt('rho_a.dat');
R=np.genfromtxt('R.dat');
a=ml.repmat(r,R.shape[0],1)
a=R/a
rho_from_a = ro_0/(a**3)

a1=1.0
a2=1.0/(1+1e6)
t_result = []
t_error = []
a_in = []
for ai in a[:,ind]:
    tx,ex = integrate.quad(ft,a2,ai)
    t_result.append(tx)
    t_error.append(ex)
    a_in.append(ai)

t_result=array(t_result)
a_in=array(a_in)
rho_in = ro_0/(a_in**3)

print "rho_0 = {0}".format(ro_0)

clf()
xlim([0.,t_max*Gyr_per_Gpc])
rc('text', usetex=True)
rc('font', family='serif',size=font_size)
plot(t[::ptp]*Gyr_per_Gpc,rho[::ptp,ind],'r+',label="LTB")
plot(t_result[:]*Gyr_per_Gpc,rho_in[:],'b-',label="FLRW")

gca().set_yscale('log')
legend(loc='upper right',prop={'size':legend_size})
xlabel(r'$t [Gyr]$',size=label_size)
ylabel(r'$\rho\,\left[10^{10}M_\odot Gpc^{-3}h^3$]\right]$',size=label_size)
legend(loc='upper right')
plt.savefig('rho_{0}.png'.format(Om_m_0),bbox_inches='tight')


Om_m_0=1
rho_0 = 27752000.0

a(t)


In [13]:
from numpy import matlib as ml
from scipy import integrate
from scipy.optimize import curve_fit
from plot_conf import *
#from phys_const import *
execfile('phys_const.py')
execfile('flrw_param.py')

print "Om_m_0={0}".format(Om_m_0)
#indices of r
ind = 50
#dist from point to point
ptp=20

def ft(x):
    return 1.0 /( H0*sqrt( (Om_m_0/x) - (Om_m_0 - 1) ) )

R=np.genfromtxt('R.dat');
r,M,tB,E=np.genfromtxt('model_fun.dat',unpack=True)
t,t1=np.genfromtxt('t.dat',unpack=True)
a=ml.repmat(r,R.shape[0],1)
a=R/a


a1=1.0
a2=1.0/(1+1e6)
t_result = []
t_error = []
a_in = []
#print "a_delta= {0}".format(a_delta)
for ai in a[:,ind]:
    tx,ex = integrate.quad(ft,a2,ai)
    t_result.append(tx)
    t_error.append(ex)
    a_in.append(ai)
#t0_result = integrate.quad(ft,a2,a1)[0]
#print "t0 from integration = {0}".format(t0_result)
t_result=array(t_result)
a_in=array(a_in)

print "a_0={0}".format(a[:,ind].max())
print "G={0}".format(G)

clf()
xlim([0.,t_max*Gyr_per_Gpc])
rc('text', usetex=True)
rc('font', family='serif',size=font_size)
plot(t[::ptp]*Gyr_per_Gpc,a[::ptp,ind],'r+',label="LTB")
plot(t_result[:]*Gyr_per_Gpc,a_in[:],'b-',label="FLRW")
xlabel(r'$t [Gyr]$',size=label_size)
ylabel(r'$a$',size=label_size)
legend(loc='upper left',prop={'size':legend_size})
plt.savefig('a_{0}.png'.format(Om_m_0), bbox_inches='tight')


Om_m_0=1
a_0=1.000001025
G=4.78571e-13

a(r)


In [11]:
from numpy import matlib as ml
R=np.genfromtxt('R.dat');
r,M,tB,E=np.genfromtxt('model_fun.dat',unpack=True)
rr=ml.repmat(r,R.shape[0],1)
ind=3
S=R/rr
#S=R
clf()
plot(r[1:-1],S[0,1:-1],'r')
plot(r[1:-1],S[1,1:-1],'g')
plot(r[1:-1],S[2,1:-1],'b')
plot(r[1:-1],S[3,1:-1],'c')


Out[11]:
[<matplotlib.lines.Line2D at 0xc132b8c>]

In [27]:
from numpy import matlib as ml
R=np.genfromtxt('R.dat');
R_r=np.genfromtxt('R_r_a.dat');
R_t=np.genfromtxt('R_t_a.dat');
r,M,tB,E=np.genfromtxt('model_fun.dat',unpack=True)
t,t1=np.genfromtxt('t.dat',unpack=True)
ind=3
clf()
plot(r[:],R_t[0,:],'ro')
plot(r[:],R_t[1,:],'g--')
plot(r[:],R_t[2,:],'b--')
plot(r[:],R_t[3,:],'y.')


Out[27]:
[<matplotlib.lines.Line2D at 0xcf04f6c>]

In [25]:
from numpy import matlib as ml
R_r=np.genfromtxt('R_r_a.dat');
r,M,tB,E=np.genfromtxt('model_fun.dat',unpack=True)
t,t1=np.genfromtxt('t.dat',unpack=True)
ind=3
clf()
plot(r[:],R_r[0,:],'ro')
plot(r[:],R_r[1,:],'g--')
plot(r[:],R_r[2,:],'b--')
plot(r[:],R_r[3,:],'y.')


Out[25]:
[<matplotlib.lines.Line2D at 0xe1e678c>]

In [33]:
from astropy import cosmology as cosmo
c=cosmo.FlatLambdaCDM(H0=100.0,Om0=1,Tcmb0=0.0,Neff=0.0,name="simple flat")
from numpy import matlib as ml
R=np.genfromtxt('R.dat');
exp=np.genfromtxt('exp_a.dat');
r,M,tB,E=np.genfromtxt('model_fun.dat',unpack=True)
t,t1=np.genfromtxt('t.dat',unpack=True)
ind=1
clf()
plot(t[:],exp[:,1],'r')
plot(t[:],exp[:,3],'b.')
plot(t[:],exp[:,4],'y.')


Out[33]:
[<matplotlib.lines.Line2D at 0xa6b5b8c>]

H(a)


In [37]:
from numpy import matlib as ml
R=np.genfromtxt('R.dat');
exp=np.genfromtxt('exp_a.dat');
r,M,tB,E=np.genfromtxt('model_fun.dat',unpack=True)
ind=4
#scale factors
a=ml.repmat(r,R.shape[0],1)
a = R / a
#Hubble
H0=100.0 / 299792.458 * 1000
a1 = H0/ a**1.5
z1=a1[:,ind]
#z1=z1/z1.max()
z2=exp[:,ind]
#z2=z2/z2.max()
clf()
plot(a[:,ind],z1,'r')
plot(a[:,ind],z2,'b--')


Out[37]:
[<matplotlib.lines.Line2D at 0xcfa08ec>]

In [98]:
from numpy import matlib as ml
R=np.genfromtxt('R.dat');
grr=np.genfromtxt('grr.dat');
r,M,tB,E=np.genfromtxt('model_fun.dat',unpack=True)
t,t1=np.genfromtxt('t.dat',unpack=True)
ind=1
clf()
#plot(t[:],c.H(t))
#print r[0],r[1],r[2],r[3]
#plot(t[:],exp[:,0],'c--')
plot(t[:],grr[:,1],'r')
plot(t[:],grr[:,2],'b--')
plot(t[:],grr[:,0],'y+')
#plot(t[:],grr[:,4],'g.')


Out[98]:
[<matplotlib.lines.Line2D at 0x11196d2c>]

In [36]:
from numpy import matlib as ml
R=np.genfromtxt('R.dat');
rho=np.genfromtxt('rho_a.dat')
r,M,tB,E=np.genfromtxt('model_fun.dat',unpack=True)
t,t1=np.genfromtxt('t.dat',unpack=True)
ind = 3
Gyr_per_Gpc=3.08568025e16 / 299792458.0 / (365.25*24.0*3600.0)
t_0=5.976859613/Gyr_per_Gpc
t=(t-t_0)*Gyr_per_Gpc
clf()
plot(t[:],rho[:,ind],'r')


Out[36]:
[<matplotlib.lines.Line2D at 0xaef68ac>]

In [35]:
from numpy import matlib as ml
R=np.genfromtxt('R.dat');
exp=np.genfromtxt('exp_a.dat');
r,M,tB,E=np.genfromtxt('model_fun.dat',unpack=True)
t,t1=np.genfromtxt('t.dat',unpack=True)
ind = 3
Gyr_per_Gpc=3.08568025e16 / 299792458.0 / (365.25*24.0*3600.0)
t_0=5.976859613/Gyr_per_Gpc
t=(t-t_0)*Gyr_per_Gpc
clf()
plot(t[:],exp[:,ind],'r')


Out[35]:
[<matplotlib.lines.Line2D at 0xbca492c>]