The Twin Problem
1. The Twin Problem
Here we implement in Sagemath the computations for the twin problem as discussed in Chapter 2 of Éric Gourgoulhon’s book on special relativity. Our intent is not explain what is in the book, as this is already very good; we just show how to do the computations with Sagemath. When referring to equation (2.1), say, in (the French version of) the book, I write (G.2.1).
1.1. The space
We first need a 2D Minkowski space with coordinates \(t\) and \(x\).
M = Manifold(2, 'M', structure='Lorentzian')
X = M.chart(names=("t", "x"))
t, x = X[:]
# X.<t,x> = M.chart() # the black formatter hangs on this syntax
Next is the metric.
g = M.lorentzian_metric('g', signature='positive')
g[0, 0], g[1, 1] = -1, 1
show(g.disp())
show(g.signature())
\[ g = -\mathrm{d} t\otimes \mathrm{d} t+\mathrm{d} x\otimes \mathrm{d} x \] \[ 0 \]
1.2. The Curve
Here is the \(x\) coordinate of the path \(\mathscr{L}'\).
c, alpha, T = var('c alpha T', domain='positive')
x = c * T / alpha * (sqrt(1 + (alpha * t / T) ^ 2) - 1)
show(x)
\[ \frac{T c {\left(\sqrt{\frac{\alpha^{2} t^{2}}{T^{2}} + 1} - 1\right)}}{\alpha} \]
With this, we build the part of the path \(\mathscr{L}'\) from the point \(A\) at which the twins separate to the point \(C\) at which the twin that is flying hits the brakes to start the way back; we skip the other three parts of \(\mathscr{L}'\).
Lp = M.curve(
[c * t, x],
(t, 0, T / 4),
chart=X,
name='Lp',
)
show(Lp.display())
To plot \(\mathscr{L}'\) we need to choose numerical values for \(T\), \(\alpha\), and the speed of light \(c\). We achieve this by substituting the numerical values in \(x\), and then defining a new curve with these values.
x_of_t = x.subs({alpha: 8, T: 5, c: 1})
Lp_plot = M.curve(
(x_of_t, t),
(t, 0, 5 / 4),
)
p = Lp_plot.plot()
p.save("twins_curve.png", figsize=(3, 3), dpi=300)
The plot1
Worldline of \(x(t)\).
appears on the right. As an aside, the axis labels do not follow the convention of special relativity to have \(t\) pointing upward and \(x\) sideways.
For the moment, and I don’t know how to repair this.
1.3. Proper time
For the infinitesimal proper time \(\d \tau\) we have from (E2.9)
\begin{align*} c \d \tau = \sqrt{- g(\mathbf{v}, \mathbf{v})} \d t, \end{align*}where \(\mathbf{v}\) is a tangent vector of the path parametrized by \(t\). Thus, we need to compute the tangent vector \(\mathbf{v}\) first.
v = Lp.tangent_vector_field(name='v', latex_name='\\mathbf{v}')
show(v.display())
\[ \mathbf{v} = c \frac{\partial}{\partial t } + \left( \frac{\alpha c t}{\sqrt{\alpha^{2} t^{2} + T^{2}}} \right) \frac{\partial}{\partial x } \]
For the dot product \(\mathbf{v} \cdot \mathbf{v}\) we have to pullback the metric from \(M\) to \(\mathscr{L}'\).
d_tau = sqrt(-g.along(Lp)(v, v)) / c
show(d_tau.disp())
The proper time of the first quarter of the total curve from leaving to returning is \(\tau = \int_0^{T/4} \d \tau\):
Tp = integral(d_tau.expr(), t, 0, T / 4)
show(Tp/T)
\[ \frac{\operatorname{arsinh}\left(\frac{1}{4} \, \alpha\right)}{\alpha} \]
1.4. Four vectors
From \(\mathbf{v}\) we compute the \(4\)-velocity \(\mathbf{u} = \mathbf{v} /|| \mathbf{v} ||\).
u = v / v.norm(g.along(Lp))
show(u.disp())
\[ \left( \frac{\sqrt{\alpha^{2} t^{2} + T^{2}}}{T} \right) \frac{\partial}{\partial t } + \frac{\alpha t}{T} \frac{\partial}{\partial x } \]
Note that the next two ways of computing the norm are the same.
show(v.norm(g.along(Lp)) == sqrt(-g.along(Lp)(v, v)))
\[ \mathrm{True} \]
The \(4\)-acceleration is defined as
\begin{align*} \mathbf{a} = \frac{\d \mathbf{u}}{ c \d t'} = \frac{\d \mathbf{u}}{ \d t}\frac{\d t}{c \d t'}. \end{align*}We first compute \(\d \mathbf{u}/\d t\).
du_dt = Lp.tangent_vector_field(latex_name='\\d u/\\d t')
for i in M.irange():
du_dt[i] = diff(u[i].expr(), t)
show(du_dt.disp())
\[ \d u/\d t = \left( \frac{\alpha^{2} t}{\sqrt{\alpha^{2} t^{2} + T^{2}} T} \right) \frac{\partial}{\partial t } + \frac{\alpha}{T} \frac{\partial}{\partial x } \] The \(4\) acceleration now follows simply.
a = du_dt / (c * d_tau)
show(a.disp())
\[ \frac{\alpha^{2} t}{T^{2} c} \frac{\partial}{\partial t } + \left( \frac{\sqrt{\alpha^{2} t^{2} + T^{2}} \alpha}{T^{2} c} \right) \frac{\partial}{\partial x } \]
Here are some further check: \(\mathbf{u}\cdot \mathbf{u}\) should equal \(-1\), and \(\mathbf{u}\cdot \mathbf{a} = 0\). Finally, \(\mathbf{a}\cdot \mathbf{a}\) is also equal to (G.2.42).
show(g.along(Lp)(u, u).disp())
show(g.along(Lp)(u, a).disp())
show(g.along(Lp)(a, a).disp())