summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hilditch <david.hilditch@tecnico.ulisboa.pt>2023-04-03 19:22:15 +0100
committerDavid Hilditch <david.hilditch@tecnico.ulisboa.pt>2023-04-03 19:22:15 +0100
commitcddec1c40ed1dae73930a729fc3294493d94edc3 (patch)
treeb3d0b0e42094263426f9c1ce783a8e8bf71574c8
parent479bc60e01ffc260bc66397931dd3973da1f03b0 (diff)
Null: Normalize spatial component of momentum.
-rw-r--r--null.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/null.py b/null.py
index c0f08ee..22f1860 100644
--- a/null.py
+++ b/null.py
@@ -62,8 +62,9 @@ def _null_geodesic_axis_rhs(Lambda, f,
gu = np.linalg.inv(g)
# enforce the momentum to be a null vector
- termX = gtX * mom_X
- mom_t = (-termX + np.sqrt(termX * termX - gtt * gXX * mom_X * mom_X)) / gtt
+ # otherwise the curve stops being null rapidly:
+ term_sqrt = np.sqrt(gtX * gtX - gtt * gXX)
+ mom_X = (- gtX + term_sqrt ) * mom_t / gXX
G = np.zeros((4, 4, 4))
G[0, 0, 0] = 0.5 * gtt_dt