summaryrefslogtreecommitdiff
path: root/setup.mac
diff options
context:
space:
mode:
Diffstat (limited to 'setup.mac')
-rw-r--r--setup.mac105
1 files changed, 105 insertions, 0 deletions
diff --git a/setup.mac b/setup.mac
new file mode 100644
index 0000000..becfdc3
--- /dev/null
+++ b/setup.mac
@@ -0,0 +1,105 @@
+/*
+ * Setup
+ */
+linel: 120;
+
+derivabbrev: true;
+
+load("ctensor");
+
+dim: 4;
+cframe_flag: false;
+ct_coords: [u, r, θ, ϕ];
+
+/* Original Bondi U and V are replaced by A and B; V is reserved for potential */
+depends([A, B, β, γ], [u, r, θ]);
+
+/*
+Bondi metric ansatz
+NOTE: Signature is different than original Bondi paper
+*/
+bondi_ansatz() := block([m],
+ m: zeromatrix(4, 4),
+ /* du du */
+ m[1, 1] : -B * r^-1 * exp(2 * β) + A^2 * r^2 * exp(2 * γ),
+ /* du dr */
+ m[1, 2] : -exp(2 * β),
+ m[2, 1] : -exp(2 * β),
+ /* du dθ */
+ m[1, 3] : -A * r^2 * exp(2 * γ),
+ m[3, 1] : -A * r^2 * exp(2 * γ),
+ /* dθ dθ */
+ m[3, 3] : r^2 * exp(2 * γ),
+ /* dϕ dϕ */
+ m[4, 4] : r^2 * exp(- 2 * γ) * sin(θ)^2,
+ m)$
+
+lg: bondi_ansatz()$
+
+/* Load metric and compute inverse */
+cmetric()$
+
+/* Force simplification of some expressions */
+ug[2,2] : expand(ug[2,2]),simp;
+
+/* mcs[i, j, k]: Christoffel symbols of the second kind (one upper index - k) */
+christof(false);
+
+/* ric[i, j]: R_ab Ricci tensor*/
+ricci(false);
+
+/* uric[i, j]: R^a_b Ricci tensor */
+uricci(false);
+
+/* Ricci scalar */
+ric_s : expand(scurvature());
+
+
+/* 2-sphere submanifold */
+
+/* 2-sphere submanifold metric */
+h_AB[3,3] : exp(2*γ)$
+h_AB[4,4] : exp(-2*γ)*sin(θ)^2$
+h_AB[3,4] : 0$
+h_AB[4,3] : 0$
+
+/* 2-sphere submanifold inverse metric */
+uh_AB[3,3] : exp(-2*γ)$
+uh_AB[4,4] : exp(2*γ)*sin(θ)^-2$
+uh_AB[3,4] : 0$
+uh_AB[4,3] : 0$
+
+/* 2-sphere metric */
+q_AB[3,3] : 1$
+q_AB[4,4] : sin(θ)^2$
+q_AB[3,4] : 0$
+q_AB[4,3] : 0$
+
+/* 2-sphere inverse metric */
+uq_AB[3,3] : 1$
+uq_AB[4,4] : sin(θ)^-2$
+uq_AB[3,4] : 0$
+uq_AB[4,3] : 0$
+
+/* Christoffel symbols of 2-sphere */
+for i : 3 thru 4 do for j : 3 thru 4 do for k : 3 thru 4 do (
+ h_mcs[i, j, k] : sum(uh_AB[k,C]*(
+ cdiff(h_AB[j, C], i)
+ + cdiff(h_AB[i, C], j)
+ + cdiff(h_AB[i, j], C))/2, C, 3, 4));
+
+/* Riemann tensor of 2-sphere */
+for i : 3 thru 4 do for j : 3 thru 4 do for k : 3 thru 4 do for l : 3 thru 4 do (
+ h_riem[i,j,k,l] : expand(
+ cdiff(h_mcs[i,k,l], j)
+ - cdiff(h_mcs[j,k,l], i)
+ + sum(h_mcs[i,k,n]*h_mcs[l,n,j] - h_mcs[j,k,n]*h_mcs[n,i,l], n, 3, 4)));
+
+/* Ricci tensor of 2-sphere */
+for i : 3 thru 4 do for j : 3 thru 4 do (
+ h_ric[i,j] : expand(sum(h_riem[i,k,j,k], k, 3, 4)));
+
+/* Ricci scalar of 2-sphere */
+h_ric_s : expand(sum(sum(uh_AB[i,j]*h_ric[i,j], i, 3, 4), j, 3, 4));
+
+print("Setup done!");