Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

SageMath notebooks associated to the Black Hole Lectures (https://luth.obspm.fr/~luthier/gourgoulhon/bh16)

Project: BHLectures
Views: 20113
Kernel: SageMath 7.5.beta3
%display latex
M = Manifold(4, 'M') print(M)
4-dimensional differentiable manifold M
X.<t,x,th,ph> = M.chart(r't:\tau x:(0,+oo):\chi th:(0,pi):\theta ph:(0,2*pi):\phi') X
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.display_comp()
Ric = g.ricci() print(Ric)
Field of symmetric bilinear forms Ric(g) on the 4-dimensional differentiable manifold M
Ric.display_comp()
Ric.display()
Ric[0,0]
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
G.display_comp()
u = M.vector_field('u') u[0] = 1 u.display()
g(u,u).display()
u_form = u.down(g) print(u_form)
1-form on the 4-dimensional differentiable manifold M
u_form.display()
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
T.display()
E = G - 8*pi*T E.set_name('E') print(E)
Field of symmetric bilinear forms E on the 4-dimensional differentiable manifold M
E.display()
E.display_comp()
E[0,0]
eq = (-E[0,0]/4).expr().numerator() == 0 eq
solve(eq, rho(t,x))