| Hosted by CoCalc | Download
Kernel: SageMath 7.1

Solving Einstein equation to get Kottler solution

This Jupyter/SageMath worksheet is relative to the lectures Geometry and physics of black holes

These computations are based on SageManifolds (v0.9)

Click here to download the worksheet file (ipynb format). To run it, you must start SageMath with the Jupyter notebook, with the command sage -n jupyter

First we set up the notebook to display mathematical objects using LaTeX formatting:

%display latex

Spacetime

We declare the spacetime manifold MM:

M = Manifold(4, 'M') print(M)
4-dimensional differentiable manifold M

We declare the chart of spherical coordinates (t,r,θ,ϕ)(t,r,\theta,\phi):

X.<t,r,th,ph> = M.chart(r't r:(0,+oo) th:(0,pi):\theta ph:(0,2*pi):\phi') X

The static and spherically symmetric metric ansatz, with the unknown functions A(r)A(r) and B(r)B(r):

g = M.lorentzian_metric('g') A = function('A') B = function('B') g[0,0] = -A(r) g[1,1] = B(r) g[2,2] = r^2 g[3,3] = (r*sin(th))^2 g.display()

The Christoffel symbols of gg, with respect to the default chart:

g.christoffel_symbols_display()

Einstein equation

The cosmological constant:

var('Lamb', latex_name='\Lambda')

The Einstein equation:

EE = g.ricci() - 1/2*g.ricci_scalar()*g + Lamb*g EE.set_name('E') print(EE)
Field of symmetric bilinear forms E on the 4-dimensional differentiable manifold M
EE.display_comp()

Simplifying and rearranging the equations

eq0 = EE[0,0]*r^2*B(r)^2/A(r); eq0
eq1 = EE[1,1]*r^2*A(r); eq1
eq2 = EE[2,2]*4*A(r)^2*B(r)^2; eq2
eq3 = EE[3,3]*4*A(r)^2*B(r)^2/sin(th)^2; eq3
eq3 == eq2

Solving Einstein equation

The following combination of eq0 and eq1 is particularly simple:

eq4 = (eq0*A(r) + eq1*B(r))/r; eq4

The solution is A(r)B(r)=CA(r)B(r)=C, where CC is a constant:

s = desolve(eq4.expr() == 0, B(r), ivar=r) s

Let us rename the constant to α\alpha:

var('alpha', latex_name=r'\alpha') B_sol(r) = s.subs(_C=alpha); B_sol

We replace B(r)B(r) by the above value in the remaining equations:

eq5 = X.function(eq1.expr().substitute_function(B, B_sol)); eq5
eq6 = X.function(eq2.expr().substitute_function(B, B_sol)); eq6

Let us solve eq5 for A(r)A(r). Note that we are using eq5.expr() to get a symbolic expression, as expected by the function desolve, while eq5 is a coordinate function.

s = desolve(eq5.expr() == 0, A(r), ivar=r) s.expand()

We rename the constant CC to 2m-2m and set the value of constant α\alpha to 11:

var('m') A_sol(r) = s.subs(_C=-2*m, alpha=1).expand() A_sol

Let us check that eq6 is fulfilled by the found value of A(r)A(r):

eq6.expr().substitute_function(A, A_sol).subs(alpha=1).simplify_full()

Final expression of the metric

We have got the Kottler metric:

g[0,0] = -A_sol(r) g[1,1] = 1/A_sol(r) g.display()

which reduces to Schwarzschild metric as soons as the cosmological constant vanishes.

g.christoffel_symbols_display()

Let us check that Einstein equation is satisfied by the above metric:

EE = g.ricci() - 1/2*g.ricci_scalar()*g + Lamb*g EE.set_name('E') EE.display()

The Ricci scalar is constant for this solution:

g.ricci_scalar().display()

The Ricci tensor is proportional to the metric tensor:

g.ricci().display()
g.ricci() == Lamb * g