A special relativity demo
Written on July 6th, 2021 by Ben LansdellHere we imagine we are in control of a powerful spaceship, navigating flat spacetime (i.e. away from any massive objects which could curve spacetime). We can provide thrust in only one spatial dimension, either forwards or backwards.
The force we can apply, at a time measured on the ship \(\tau\), accelerates the ship accordingly. What does our navigation look like from an outside observer? Let’s call this outside reference frame R.
Special relativity dictates that when the relative velocity of our ship approaches the speed of light, the kinematics of our flight, as observed by an outside observer, deviate those given by Newtonian mechanics. This post lets us explore how the kinematics do play out in special relativity.
Einstein’s theories of relativity generally require spelling out the setup more explicitly than in a Galilean setting – we have to explicitly say how a concept is to be operationalized for it to be fair game. To that end, let’s elaborate a bit more before diving into the simulation.
This will assume some knowledge of special relativity. Some introductory material can be found in my earlier post (here). Otherwise, you can consult the Feynman Lectures on Physics, for example.
The setup
First, throughout we’ll assume units in which the speed of light is 1, so there will be no \(c\)s anywhere thoughout this post. They could always be put back in any expression in whatever way makes the units work out.
Second, from our earlier post, we recall that moving clocks run slowly. So, we’ll denote time measured by the outside observer as \(t\). In frame R, \(\tau\) runs slow compared to \(t\) for high relative velocities.
Now, how should we think about acceleration in moving frames? Dealing with measurements made in an accelerating frame is most satisfactorily studied with the general theory of relavity. But even absent this more general theory we can make sense of this question. The idea is to define all kinematic quantities, including acceleration, as 4dimensional objects that are parameterized by the spaceship’s clock, \(\tau\). By doing so these quantities possess certain invariances to undergoing a Lorentz transformation – their properties are independent of our way of observing, or parameterizing, them. (These derivations will be provided in a followup post.) This is useful here, and indispensible in more complicated cases.
The socalled 4acceleration is the rate of change of the 4velocity as a function of proper time, \(\tau\):
\begin{aligned} A = dU/d\tau = [a^0, a^1, a^2, a^3] \end{aligned}
In our reduced dimension case, we only need consider 1 spatial component. We can show that \(A\) is of the form: \(a^0 = a\gamma v\), \(a^1 = a\gamma\) and \(a^2 = a^3 = 0\), for some parameter \(a\). In fact, in Minkowsky space, with the metric signature (1,1,1,1), we have \(A\cdot A = a^2\). Further, in an inertial frame that is at some moment \(t\) moving along with the ship at exactly its velocity, \(v(t)\), we see that \(a^0 = 0\) and \(a^1 = a\). This means that in the inertial frame that is momentarily moving along with the ship, there are no relativistic effects and the ship has acceleration \(a\) – thus \(a\) can be thought of as the acceleration as experienced by those on the ship, and what we have control over by adjusting the thrusters.
The kinematic equations
From an outside observer, it is quite straightforward to derive the following relations:
\[\begin{aligned} dx/d\tau = \sinh\left(\int_0^{\tau(t)} a(s)\,ds\right)\\ dt/d\tau = \cosh\left(\int_0^{\tau(t)} a(s)\,ds\right) \end{aligned}\]And thus we have
\begin{aligned} v(t) = dx/dt = \tanh\left(\int_0^{\tau(t)} a(s)\,ds\right) \end{aligned}
The quantity \(\phi = \int_0^\tau a(s)\,ds\) is known as the rapidity. Note that it has the form simply of the integrated ‘local’ acceleration – it is the velocity occupants on the ship would be moving at if relativistic effects were absent.
This equation for velocity as a function of rapidity can be integrated by time to give the ship’s position in frame R.
The simulation
The simulation below computes rapidity as a function of force applied to the ship, from which it can compute \(v\) and thus \(x\). It also tracks the ship’s mass, proper time, momentum and Lorentz factor, all assuming the ship has unit mass. You can change the force with the slider below.
First we plot things for an outside observer, frame R.
Denote by R’(t) the inertial frame that, at time \(t\), is moving with speed \(v(t)\) relative to R, with the origin shifted to be the location of the ship. We can then plot the worldline from R’(t).
Some things to note:

In frame R’(t), the acceleration vector points entirely in the \(x\) axis and the velocity vector coincides with the time axis \(t'\) – this makes sense since in this frame it has, at this instance, zero velocity. It’s clear in this frame that the acceleration vector is always perpendicular to the velocity vector – acceleration is the curvature of the worldline.

The velocity and acceleration vectors in the rest frame R are simply those same vectors in R’, Lorentz transformed accordingly – their Lorentz invariance means that they have the same magnitude and stay orthogonal to one another – acceleration is still the curvature of the worldline.

The worldline drawn in R’(t) is, in my opinion at least, not the most intuitive thing to interpret, as the reference frame always changes velocity as the ship does. You can see, however, that once no force is applied, the ship moves with constant velocity and the worldline drags straight behind the ship. More generally, in this frame the trajectory appears, basically, as the turning point of a parabola which is up or down depending on the sign of the acceleration.

If you turn on the Show Galilean Motion option, it shows the trajectory a ship will follow in R under normal, Newtonian mechanics. A key difference you can notice is that it can move faster than the speed of light, as evidenced by being able to move outside of the origin’s lightcone.

A final note is an admission of some subtley that comes with the way this simulation was described and setup. Our simulation clock counts ticks of rest time \(t\), and yet we’re imagining that we’re on board the ship, changing its thrusters. The relative rate at which proper time, \(\tau\), ticks over can be, depending on \(\gamma\), significantly slower. The temporal resolution at which we’re able to issue commands to the ship and respond to changes in its motion thus increases as time dilation increases. This isn’t so realistic. Is it better to instead run the simulation with a fixed proper time stepsize? The issue with that is that I think its easier to get a sense for the motion from a single inertial frame R, which dictates using an external clock. A fixed step size in \(\tau\) could become arbitrarily large in \(t\), so we would lose numerical precision in our external view of things.
Hopefully this simulation gives a bit more intuition about how kinematics work in special relativity – basically: constant acceleration is a hyperbola instead of a parabola, with the extra momentum going into the object’s mass and not its velocity. For our next post, we will incorporate gravity into the picture with Einstein’s general theory of relativity.