CoCalc Public FilesBHLectures / sage / Oppenheimer_Snyder.ipynb
Author: Eric Gourgoulhon
Views : 100
Compute Environment: Ubuntu 18.04 (Deprecated)
In [4]:
%display latex

In [5]:
M = Manifold(4, 'M')
print(M)

4-dimensional differentiable manifold M
In [6]:
X.<t,x,th,ph> = M.chart(r't:\tau x:(0,+oo):\chi th:(0,pi):\theta ph:(0,2*pi):\phi')
X

$\left(M,({\tau}, {\chi}, {\theta}, {\phi})\right)$
In [8]:
g = M.lorentzian_metric('g')
m0 = var('m_0', domain='real'); assume(m0>0)
xs = var('xs', latex_name=r'\chi_{\rm s}', domain='real'); assume(xs>0)
a = (1 - 3*sqrt(m0/(2*xs^3)) * t)^(2/3)
g[0,0] = -1
g[1,1] = a^2
g[2,2] = (a*x)^2
g[3,3] = (a*x*sin(th))^2
g.display()

$g = -\mathrm{d} {\tau}\otimes \mathrm{d} {\tau} + {\left(-3 \, \sqrt{\frac{1}{2}} {\tau} \sqrt{\frac{m_{0}}{{\chi_{\rm s}}^{3}}} + 1\right)}^{\frac{4}{3}} \mathrm{d} {\chi}\otimes \mathrm{d} {\chi} + {\left(-3 \, \sqrt{\frac{1}{2}} {\tau} \sqrt{\frac{m_{0}}{{\chi_{\rm s}}^{3}}} + 1\right)}^{\frac{4}{3}} {\chi}^{2} \mathrm{d} {\theta}\otimes \mathrm{d} {\theta} + {\left(-3 \, \sqrt{\frac{1}{2}} {\tau} \sqrt{\frac{m_{0}}{{\chi_{\rm s}}^{3}}} + 1\right)}^{\frac{4}{3}} {\chi}^{2} \sin\left({\theta}\right)^{2} \mathrm{d} {\phi}\otimes \mathrm{d} {\phi}$
In [9]:
g.display_comp()

$\begin{array}{lcl} g_{ \, {\tau} \, {\tau} }^{ \phantom{\, {\tau}}\phantom{\, {\tau}} } & = & -1 \\ g_{ \, {\chi} \, {\chi} }^{ \phantom{\, {\chi}}\phantom{\, {\chi}} } & = & {\left(-3 \, \sqrt{\frac{1}{2}} {\tau} \sqrt{\frac{m_{0}}{{\chi_{\rm s}}^{3}}} + 1\right)}^{\frac{4}{3}} \\ g_{ \, {\theta} \, {\theta} }^{ \phantom{\, {\theta}}\phantom{\, {\theta}} } & = & {\left(-3 \, \sqrt{\frac{1}{2}} {\tau} \sqrt{\frac{m_{0}}{{\chi_{\rm s}}^{3}}} + 1\right)}^{\frac{4}{3}} {\chi}^{2} \\ g_{ \, {\phi} \, {\phi} }^{ \phantom{\, {\phi}}\phantom{\, {\phi}} } & = & {\left(-3 \, \sqrt{\frac{1}{2}} {\tau} \sqrt{\frac{m_{0}}{{\chi_{\rm s}}^{3}}} + 1\right)}^{\frac{4}{3}} {\chi}^{2} \sin\left({\theta}\right)^{2} \end{array}$
In [10]:
Ric = g.ricci()
print(Ric)

Field of symmetric bilinear forms Ric(g) on the 4-dimensional differentiable manifold M
In [11]:
Ric.display_comp()

$\begin{array}{lcl} \mathrm{Ric}\left(g\right)_{ \, {\tau} \, {\tau} }^{ \phantom{\, {\tau}}\phantom{\, {\tau}} } & = & -\frac{6 \, m_{0}}{6 \, \sqrt{2} \sqrt{m_{0}} {\tau} {\chi_{\rm s}}^{\frac{3}{2}} - 9 \, m_{0} {\tau}^{2} - 2 \, {\chi_{\rm s}}^{3}} \\ \mathrm{Ric}\left(g\right)_{ \, {\chi} \, {\chi} }^{ \phantom{\, {\chi}}\phantom{\, {\chi}} } & = & \frac{3 \cdot 2^{\frac{2}{3}} m_{0}}{{\left(-3 \, \sqrt{2} \sqrt{m_{0}} {\tau} + 2 \, {\chi_{\rm s}}^{\frac{3}{2}}\right)}^{\frac{2}{3}} {\chi_{\rm s}}^{2}} \\ \mathrm{Ric}\left(g\right)_{ \, {\theta} \, {\theta} }^{ \phantom{\, {\theta}}\phantom{\, {\theta}} } & = & \frac{3 \cdot 2^{\frac{2}{3}} m_{0} {\chi}^{2}}{{\left(-3 \, \sqrt{2} \sqrt{m_{0}} {\tau} + 2 \, {\chi_{\rm s}}^{\frac{3}{2}}\right)}^{\frac{2}{3}} {\chi_{\rm s}}^{2}} \\ \mathrm{Ric}\left(g\right)_{ \, {\phi} \, {\phi} }^{ \phantom{\, {\phi}}\phantom{\, {\phi}} } & = & \frac{3 \cdot 2^{\frac{2}{3}} m_{0} {\chi}^{2} \sin\left({\theta}\right)^{2}}{{\left(-3 \, \sqrt{2} \sqrt{m_{0}} {\tau} + 2 \, {\chi_{\rm s}}^{\frac{3}{2}}\right)}^{\frac{2}{3}} {\chi_{\rm s}}^{2}} \end{array}$
In [12]:
Ric.display()

$\mathrm{Ric}\left(g\right) = \left( -\frac{6 \, m_{0}}{6 \, \sqrt{2} \sqrt{m_{0}} {\tau} {\chi_{\rm s}}^{\frac{3}{2}} - 9 \, m_{0} {\tau}^{2} - 2 \, {\chi_{\rm s}}^{3}} \right) \mathrm{d} {\tau}\otimes \mathrm{d} {\tau} + \frac{3 \cdot 2^{\frac{2}{3}} m_{0}}{{\left(-3 \, \sqrt{2} \sqrt{m_{0}} {\tau} + 2 \, {\chi_{\rm s}}^{\frac{3}{2}}\right)}^{\frac{2}{3}} {\chi_{\rm s}}^{2}} \mathrm{d} {\chi}\otimes \mathrm{d} {\chi} + \frac{3 \cdot 2^{\frac{2}{3}} m_{0} {\chi}^{2}}{{\left(-3 \, \sqrt{2} \sqrt{m_{0}} {\tau} + 2 \, {\chi_{\rm s}}^{\frac{3}{2}}\right)}^{\frac{2}{3}} {\chi_{\rm s}}^{2}} \mathrm{d} {\theta}\otimes \mathrm{d} {\theta} + \frac{3 \cdot 2^{\frac{2}{3}} m_{0} {\chi}^{2} \sin\left({\theta}\right)^{2}}{{\left(-3 \, \sqrt{2} \sqrt{m_{0}} {\tau} + 2 \, {\chi_{\rm s}}^{\frac{3}{2}}\right)}^{\frac{2}{3}} {\chi_{\rm s}}^{2}} \mathrm{d} {\phi}\otimes \mathrm{d} {\phi}$
In [13]:
Ric[0,0]

$-\frac{6 \, m_{0}}{6 \, \sqrt{2} \sqrt{m_{0}} {\tau} {\chi_{\rm s}}^{\frac{3}{2}} - 9 \, m_{0} {\tau}^{2} - 2 \, {\chi_{\rm s}}^{3}}$
In [14]:
G = Ric - 1/2*g.ricci_scalar() * g
G.set_name('G')
print(G)

Field of symmetric bilinear forms G on the 4-dimensional differentiable manifold M
In [15]:
G.display_comp()

$\begin{array}{lcl} G_{ \, {\tau} \, {\tau} }^{ \phantom{\, {\tau}}\phantom{\, {\tau}} } & = & -\frac{12 \, m_{0}}{6 \, \sqrt{2} \sqrt{m_{0}} {\tau} {\chi_{\rm s}}^{\frac{3}{2}} - 9 \, m_{0} {\tau}^{2} - 2 \, {\chi_{\rm s}}^{3}} \end{array}$
In [16]:
u = M.vector_field('u')
u[0] = 1
u.display()

$u = \frac{\partial}{\partial {\tau} }$
In [17]:
g(u,u).display()

$\begin{array}{llcl} g\left(u,u\right):& M & \longrightarrow & \mathbb{R} \\ & \left({\tau}, {\chi}, {\theta}, {\phi}\right) & \longmapsto & -1 \end{array}$
In [18]:
u_form = u.down(g)
print(u_form)

1-form on the 4-dimensional differentiable manifold M
In [19]:
u_form.display()

$-\mathrm{d} {\tau}$
In [20]:
rho = function('rho')
T = rho(t,x)* (u_form * u_form)
T.set_name('T')
print(T)

Field of symmetric bilinear forms T on the 4-dimensional differentiable manifold M
In [21]:
T.display()

$T = \rho\left({\tau}, {\chi}\right) \mathrm{d} {\tau}\otimes \mathrm{d} {\tau}$
In [22]:
E = G - 8*pi*T
E.set_name('E')
print(E)

Field of symmetric bilinear forms E on the 4-dimensional differentiable manifold M
In [23]:
E.display()

$E = \left( -\frac{4 \, {\left(12 \, \sqrt{2} \pi \sqrt{m_{0}} {\tau} {\chi_{\rm s}}^{\frac{3}{2}} \rho\left({\tau}, {\chi}\right) - 18 \, \pi m_{0} {\tau}^{2} \rho\left({\tau}, {\chi}\right) - 4 \, \pi {\chi_{\rm s}}^{3} \rho\left({\tau}, {\chi}\right) + 3 \, m_{0}\right)}}{6 \, \sqrt{2} \sqrt{m_{0}} {\tau} {\chi_{\rm s}}^{\frac{3}{2}} - 9 \, m_{0} {\tau}^{2} - 2 \, {\chi_{\rm s}}^{3}} \right) \mathrm{d} {\tau}\otimes \mathrm{d} {\tau}$
In [24]:
E.display_comp()

$\begin{array}{lcl} E_{ \, {\tau} \, {\tau} }^{ \phantom{\, {\tau}}\phantom{\, {\tau}} } & = & -\frac{4 \, {\left(12 \, \sqrt{2} \pi \sqrt{m_{0}} {\tau} {\chi_{\rm s}}^{\frac{3}{2}} \rho\left({\tau}, {\chi}\right) - 18 \, \pi m_{0} {\tau}^{2} \rho\left({\tau}, {\chi}\right) - 4 \, \pi {\chi_{\rm s}}^{3} \rho\left({\tau}, {\chi}\right) + 3 \, m_{0}\right)}}{6 \, \sqrt{2} \sqrt{m_{0}} {\tau} {\chi_{\rm s}}^{\frac{3}{2}} - 9 \, m_{0} {\tau}^{2} - 2 \, {\chi_{\rm s}}^{3}} \end{array}$
In [25]:
E[0,0]

$-\frac{4 \, {\left(12 \, \sqrt{2} \pi \sqrt{m_{0}} {\tau} {\chi_{\rm s}}^{\frac{3}{2}} \rho\left({\tau}, {\chi}\right) - 18 \, \pi m_{0} {\tau}^{2} \rho\left({\tau}, {\chi}\right) - 4 \, \pi {\chi_{\rm s}}^{3} \rho\left({\tau}, {\chi}\right) + 3 \, m_{0}\right)}}{6 \, \sqrt{2} \sqrt{m_{0}} {\tau} {\chi_{\rm s}}^{\frac{3}{2}} - 9 \, m_{0} {\tau}^{2} - 2 \, {\chi_{\rm s}}^{3}}$
In [26]:
eq = (-E[0,0]/4).expr().numerator() == 0
eq

$12 \, \sqrt{2} \pi \sqrt{m_{0}} {\tau} {\chi_{\rm s}}^{\frac{3}{2}} \rho\left({\tau}, {\chi}\right) - 18 \, \pi m_{0} {\tau}^{2} \rho\left({\tau}, {\chi}\right) - 4 \, \pi {\chi_{\rm s}}^{3} \rho\left({\tau}, {\chi}\right) + 3 \, m_{0} = 0$
In [27]:
solve(eq, rho(t,x))

$\left[\rho\left({\tau}, {\chi}\right) = -\frac{3 \, m_{0}}{2 \, {\left(6 \, \sqrt{2} \pi \sqrt{m_{0}} {\tau} {\chi_{\rm s}}^{\frac{3}{2}} - 9 \, \pi m_{0} {\tau}^{2} - 2 \, \pi {\chi_{\rm s}}^{3}\right)}}\right]$
In [ ]: