Calculating the Einstein Tensor
Author
Pekka Janhunen
Title
Calculating the Einstein Tensor
Description
Given an N x N matrix, g a metric with lower indices; and x-, and N-vector (coordinates); EinsteinTensor[g,x] computes the Einstein tensor (an N x N matrix) with lower indices. The demonstration Notebook gives examples dealing with the Schwarzschild solution and the Kerr-Newman metric.
Category
Educational Materials
Keywords
URL
http://www.notebookarchive.org/2018-10-10q81ci/
DOI
https://notebookarchive.org/2018-10-10q81ci
Date Added
2018-10-02
Date Last Modified
2018-10-02
File Size
17.71 kilobytes
Supplements
Rights
Redistribution rights reserved




<<einsteintensor.m
{EinsteinTensor}
(* Spherical coordinates: *)
x = {t,r,theta,phi}
x = {t,r,theta,phi}
(* The Schwarzschild metric: *)
(metric =
DiagonalMatrix[{-Exp[2 ny[r]], Exp[2 lambda[r]], r^2,
(r Sin[theta])^2}]) //MatrixForm
(metric =
DiagonalMatrix[{-Exp[2 ny[r]], Exp[2 lambda[r]], r^2,
(r Sin[theta])^2}]) //MatrixForm
(* The following result is found in all textbooks on General
Relativity. When the differential equations Einstein==0
are solved, the Schwarzschild solution emerges. This cannot
(yet) be done using Mathematica's DSolve (one gets the message
DSolve::NotYet!). However, the solution of the equation is
relatively easy to do by hand, the toughest part is to
calculate the Einstein tensor.*)
(Einstein =
Inverse[metric].Simplify[EinsteinTensor[metric,x]])
Relativity. When the differential equations Einstein==0
are solved, the Schwarzschild solution emerges. This cannot
(yet) be done using Mathematica's DSolve (one gets the message
DSolve::NotYet!). However, the solution of the equation is
relatively easy to do by hand, the toughest part is to
calculate the Einstein tensor.*)
(Einstein =
Inverse[metric].Simplify[EinsteinTensor[metric,x]])
(* Confirm that the Einstein tensor of the Schwarzschild
solution vanishes (i.e. that the Schwarzschild solution
satisfies Einstein's vacuum field equations): *)
EinsteinTensor[DiagonalMatrix[{-(1-2M/r),1/(1-2M/r),
r^2, (r Sin[theta])^2}],
{t,r,theta,phi}] // Simplify
solution vanishes (i.e. that the Schwarzschild solution
satisfies Einstein's vacuum field equations): *)
EinsteinTensor[DiagonalMatrix[{-(1-2M/r),1/(1-2M/r),
r^2, (r Sin[theta])^2}],
{t,r,theta,phi}] // Simplify
(* Check that the Einstein tensor of flat spacetime vanishes: *)
EinsteinTensor[DiagonalMatrix[{-1,1,1,1}],{x1,x2,x3,x4}]
EinsteinTensor[DiagonalMatrix[{-1,1,1,1}],{x1,x2,x3,x4}]
(* Then, consider the Kerr-Newman metric (a charged,
rotating black hole): *)
delta:= r^2 - 2M r + a^2 + Q^2;
rho2:= r^2 + a^2 Cos[theta]^2;
ds2 = -(delta/rho2)(d[0]-a Sin[theta]^2 d[3])^2 +
(Sin[theta]^2/rho2)((r^2+a^2)d[3]-a d[0])^2 +
rho2 d[1]^2/delta + rho2 d[2]^2;
rotating black hole): *)
delta:= r^2 - 2M r + a^2 + Q^2;
rho2:= r^2 + a^2 Cos[theta]^2;
ds2 = -(delta/rho2)(d[0]-a Sin[theta]^2 d[3])^2 +
(Sin[theta]^2/rho2)((r^2+a^2)d[3]-a d[0])^2 +
rho2 d[1]^2/delta + rho2 d[2]^2;
ds2 = Collect[ds2,Array[d,4,0]]
KerrNewman =
Simplify[Table[Coefficient[ds2,d[alpha]d[beta]],
{alpha,0,3}, {beta,0,3} ] ]
Simplify[Table[Coefficient[ds2,d[alpha]d[beta]],
{alpha,0,3}, {beta,0,3} ] ]
(* Consider the limiting cases the Kerr-Newman metric:
The Kerr metric is a non-charged Kerr-Newman: *)
Kerr = Simplify[Limit[KerrNewman,Q->0]]
The Kerr metric is a non-charged Kerr-Newman: *)
Kerr = Simplify[Limit[KerrNewman,Q->0]]
(* And the Schwarzschild metric is the same as nonrotating
Kerr: *)
Schwarzschild = Simplify[Limit[Kerr, a->0]]
Kerr: *)
Schwarzschild = Simplify[Limit[Kerr, a->0]]
MaxMemoryUsed[]
(* Warning: This calculation takes very long time and requires
plenty of memory. *)
Einstein = EinsteinTensor[KerrNewman,{t,r,theta,phi}] ;
plenty of memory. *)
Einstein = EinsteinTensor[KerrNewman,{t,r,theta,phi}] ;
MaxMemoryUsed[]
(* The expression Einstein should be zero! It is far too long
to be simplified using Simplify! Even computing numerical
values takes too much time on my computer. By adding
extra Simplify -calls in the intermediate stages of
EinsteinTensor[], I succeeded to verify that EinsteinTensor
vanishes for the Kerr metric (not documented in this file)*)
Einstein//Short
to be simplified using Simplify! Even computing numerical
values takes too much time on my computer. By adding
extra Simplify -calls in the intermediate stages of
EinsteinTensor[], I succeeded to verify that EinsteinTensor
vanishes for the Kerr metric (not documented in this file)*)
Einstein//Short
(* the following calculation was interrupted by user.. *)
Einstein /. {a->1.2,Q->0.001,M->15.34, r->4.5345,theta->0.34}
Einstein /. {a->1.2,Q->0.001,M->15.34, r->4.5345,theta->0.34}


Cite this as: Pekka Janhunen, "Calculating the Einstein Tensor" from the Notebook Archive (2002), https://notebookarchive.org/2018-10-10q81ci

Download

