In [ ]:
r,M,tB,E=np.genfromtxt('../model_fun.dat',unpack=True)

Plotting R


In [30]:
from numpy import matlib as ml
from phys_const import *
#from tm import ttf
execfile("tm.py")
r,M,tB,E=np.genfromtxt('model_fun.dat',unpack=True)
R = np.genfromtxt('R.dat')
rr=ml.repmat(r,R.shape[0],1)
t,t1=np.genfromtxt('t.dat',unpack=True)
t=t*Gyr_per_Gpc
S = R / rr
clf()
rc('text', usetex=True)
rc('font', family='serif',size="15")
xlim([-9,9])
plot(r[1:-1],R[0,1:-1],'b-',label=ttf(t[0]))
plot(r[1:-1],R[1,1:-1],'r-',label=ttf(t[1]))
plot(r[1:-1],R[2,1:-1],'c-',label=ttf(t[2]))
plot(r[1:-1],R[3,1:-1],'g-',label=ttf(t[3]))
plot(r[1:-1],R[4,1:-1],'y-',label=ttf(t[4]))
gca().set_yscale('log')
xlabel(r'$r$')
ylabel(r'$R(t,\phi) \left[ h^{-1}Gpc\right]$')
legend(loc='lower right',prop={'size':14})


Out[30]:
<matplotlib.legend.Legend at 0xd2b75cc>

Comparing R_t from analytic formula, central derivative and octave code derivative


In [11]:
r,M,tB,E=np.genfromtxt('../model_fun.dat',unpack=True)
Rt = np.genfromtxt('../R_t.dat');
Rta = np.genfromtxt('../R_t_a.dat');
Rtc = np.genfromtxt('../R_t_central.dat');
ind=2
clf()
plot(r[1:-1],Rt[ind,1:-1],'b.')
plot(r[1:-1],Rta[ind,1:-1],'g-',label='analytic')
plot(r[1:-1],Rtc[ind,1:-1],'r+',label='central')


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

In [114]:
from numpy import matlib as ml
G_grav = 6.67300e-11 * 1.98892e40 / 3.08568025e22 / (299792458.0*299792458.0)
r,M,tB,E=np.genfromtxt('../model_fun.dat',unpack=True)
R = np.genfromtxt('../R.dat')
R_r = np.genfromtxt('../R_r_a.dat')
R_t = np.genfromtxt('../R_t_a.dat')
r,E_r = np.genfromtxt('../E_r_a.dat',unpack=True)
r,M_r = np.genfromtxt('../M_r_a.dat',unpack=True)
R_rt = np.genfromtxt('../R_rt_a.dat');
E_r = ml.repmat(E_r,5,1)
M_r = ml.repmat(M_r,5,1)
M = ml.repmat(M,5,1)
R_rt2 = ( G_grav*( (M_r/R) - M*R_r/(R*R) ) + E_r)/R_t
ind=0
plot(r[1:-1],R_rt2[ind,1:-1],'g+')
plot(r[1:-1],R_rt[ind,1:-1],'b')
#ml.repmat([0,1,2,3],4,1)


Out[114]:
[<matplotlib.lines.Line2D at 0xf4bc56c>]

Comparing R_r from analytic formula, central derivative and octave code derivative


In [15]:
r,M,tB,E=np.genfromtxt('../model_fun.dat',unpack=True)
Rr = np.genfromtxt('../R_r.dat');
Rra = np.genfromtxt('../R_r_a.dat');
Rrc = np.genfromtxt('../R_r_central.dat');
ind=1
clf()
plot(r[1:-1],Rr[ind,1:-1],'b.')
plot(r[1:-1],Rra[ind,1:-1],'g-',label='analytic')
plot(r[1:-1],Rrc[ind,1:-1],'r+',label='central')


Out[15]:
[<matplotlib.lines.Line2D at 0xc02bc0c>]

Comparing R_2r from analytic formula, central derivative and octave code derivative


In [11]:
r,M,tB,E=np.genfromtxt('../model_fun.dat',unpack=True)
R2r = np.genfromtxt('../R_2r.dat');
R2ra = np.genfromtxt('../R_2r_a.dat');
R2rc = np.genfromtxt('../R_2r_central.dat');
ind=3
clf()
plot(r[1:-1],R2r[ind,1:-1],'b-')
plot(r[1:-1],R2ra[ind,1:-1],'g-',label='analytic')
plot(r[1:-1],R2rc[ind,1:-1],'r+',label='central')


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

Comparing R_rt from analytic formula, central derivative and octave code derivative


In [17]:
r,M,tB,E=np.genfromtxt('../model_fun.dat',unpack=True)
Rrt = np.genfromtxt('../R_rt.dat');
Rrta = np.genfromtxt('../R_rt_a.dat');
Rrtc = np.genfromtxt('../R_rt_central.dat');
ind=0
clf()
plot(r[1:-1],Rrt[ind,1:-1],'b.')
plot(r[1:-1],Rrta[ind,1:-1],'g-',label='analytic')
plot(r[1:-1],Rrtc[ind,1:-1],'r-',label='central')


Out[17]:
[<matplotlib.lines.Line2D at 0xb71a5ec>]

Comparing $$\rho$$ from analytic formula, central derivative and octave code derivative


In [19]:
r,M,tB,E=np.genfromtxt('../model_fun.dat',unpack=True)
ro = np.genfromtxt('../rho.dat');
roa = np.genfromtxt('../rho_a.dat');
roc = np.genfromtxt('../rho_central.dat');
ind=4
clf()
plot(r[1:-1],ro[ind,1:-1],'b.')
plot(r[1:-1],roa[ind,1:-1],'g-',label='analytic')
plot(r[1:-1],roc[ind,1:-1],'r+',label='central')


Out[19]:
[<matplotlib.lines.Line2D at 0xc8d1a2c>]

Comparing H from analytic formula, central derivative and octave code derivative


In [5]:
r,M,tB,E=np.genfromtxt('../model_fun.dat',unpack=True)
H = np.genfromtxt('../exp.dat');
Ha = np.genfromtxt('../exp_a.dat');
Hc = np.genfromtxt('../exp_central.dat');
ind=3
clf()
plot(r[1:-1],H[ind,1:-1],'b.')
plot(r[1:-1],Ha[ind,1:-1],'g-',label='analytic')
plot(r[1:-1],Hc[ind,1:-1],'r+',label='central')


Out[5]:
[<matplotlib.lines.Line2D at 0xb84cc8c>]

Comparing Ricci Tensor from analytic formula, central derivative and octave code derivative


In [4]:
r,M,tB,E=np.genfromtxt('../model_fun.dat',unpack=True)
Ric = np.genfromtxt('../ric.dat');
Rica = np.genfromtxt('../ric_a.dat');
#Hc = np.genfromtxt('../exp_central.dat');
ind=4
clf()
plot(r[1:-1],Ric[ind,1:-1],'b.')
plot(r[1:-1],Rica[ind,1:-1],'g-',label='analytic')
#plot(r[1:-1],Hc[ind,1:-1],'r+',label='central')


Out[4]:
[<matplotlib.lines.Line2D at 0xb312f6c>]

In [ ]: