Skip to content

Commit 0d19d66

Browse files
Update solutions.py
1 parent d13b3e2 commit 0d19d66

1 file changed

Lines changed: 40 additions & 1 deletion

File tree

spacetimeengine/src/solutions.py

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,45 @@
33

44
class Solution:
55

6+
def inverse_schwarzschild(self):
7+
"""
8+
Description
9+
===========
10+
Returns the classic black hole solution. Uncharged and rotationally stationary.
11+
Examples
12+
========
13+
>>> print(Solution().schwarzschild())
14+
>>>
15+
LaTeX representation
16+
====================
17+
"""
18+
19+
# Index configuration for the metric
20+
index_config = "dd"
21+
# Physical constants.
22+
G, M, c = symbols('G M c')
23+
# Assigns meaning to the coordinates.
24+
tau = symbols('tau')
25+
x0 = Symbol('t')
26+
x1 = Symbol('r')
27+
x2 = Symbol('theta')
28+
x3 = Symbol('phi')
29+
# Reference to the coordiante system.
30+
coordinate_set = [x0, x1, x2, x3]
31+
# Cosmological constant.
32+
cosmological_constant = 0
33+
# Metric solution.
34+
metric = Matrix([
35+
[ (1-(2*G*M)/(x1*c**2))**(-1), 0, 0, 0 ],
36+
[ 0, - (1-(2*G*M)/(x1*c**2)), 0, 0 ],
37+
[ 0, 0, - x1**2, 0 ],
38+
[ 0, 0, 0, - x1**2*sin(x2)**2 ]
39+
])
40+
41+
# An array detailing the solution.
42+
solution_array = [ metric, coordinate_set, index_config, cosmological_constant ]
43+
return solution_array
44+
645
def minkowski(self, version = "euclidian"):
746
"""
847
Description
@@ -709,4 +748,4 @@ def hypersphere_II(self):
709748

710749
# An array detailing the solution.
711750
solution_array = [ metric, coordinate_set, index_config, cosmological_constant ]
712-
return solution_array
751+
return solution_array

0 commit comments

Comments
 (0)