Time Dilation in Special Relativity

Problem

One of the key predictions of Special Relativity is time dilation, where a moving clock runs slower compared to a stationary one.
The time dilation formula is given by:

$$
\Delta t’ = \frac{\Delta t}{\gamma}
$$

  • $ \Delta t’ $ = Time interval in the moving frame
  • $ \Delta t $ = Time interval in the stationary frame
  • $ \gamma $ = Lorentz factor
    $$
    \gamma = \frac{1}{\sqrt{1 - v^2/c^2}}
    $$

Here, we will calculate how time dilation changes with velocity and plot it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import numpy as np
import matplotlib.pyplot as plt

# Constants
c = 3.0e8 # Speed of light in m/s

# Velocity range from 0 to 99.9% of the speed of light
v = np.linspace(0, 0.999 * c, 500)

# Lorentz factor calculation
gamma = 1 / np.sqrt(1 - (v / c) ** 2)

# Plotting
plt.figure(figsize=(10, 6))
plt.plot(v / c, gamma, color='blue', linewidth=2)
plt.title('Time Dilation in Special Relativity', fontsize=16)
plt.xlabel('Velocity as a fraction of the speed of light (v/c)', fontsize=14)
plt.ylabel('Time Dilation Factor (γ)', fontsize=14)
plt.ylim(1, 10)
plt.grid(True)
plt.show()

Explanation of the Code

  1. Constants:

    • c = 3.0e8: Speed of light in meters per second.
  2. Velocity Range:

    • v = np.linspace(0, 0.999 * c, 500): Generates velocities from $0$ to $99.9$ % of ( c ).
  3. Lorentz Factor Calculation:

    • gamma = 1 / np.sqrt(1 - (v / c) ** 2): Computes relativistic time dilation.
  4. Plotting:

    • X-axis: Velocity as a fraction of speed of light.
    • Y-axis: Time dilation factor $ \gamma $.
    • Time dilation grows dramatically as velocity approaches $ c $.

Interpreting the Graph

  • At low velocities $( v \ll c )$:
    Time dilation is negligible $( \gamma \approx 1 )$.
  • At higher velocities $( v \approx 0.9c )$:
    Time dilation becomes significant.
  • As $ v \to c $:
    $ \gamma \to \infty $, meaning time nearly stops for the moving observer.

This explains why astronauts traveling near light speed would age much slower compared to people on Earth.