In [1]:

```
import math
#Variable declaration
ly = 9.46e+015; # Distance travelled by light in an year, m
c = 3e+008; # Speed of light, m/s
L = 4.30*ly; # Distance of Alpha Centauri from earth, m
T0 = 16*365.25*24*60*60; # Proper time in system K_prime, s
#Calculations
# As time measured on earth, T = 2*L/v = T0_prime/sqrt(1-(v/c)^2), solving for v
v = math.sqrt(4*L**2/(T0**2+4*L**2/c**2)); # Speed of the aircraft, m/s
gama = 1/math.sqrt(1-(v/c)**2); # Relativistic factor
T = gama*T0/(365.25*24*60*60); # Time interval as measured on Earth, y
#Results
print "The speed of the aircraft = %4.2e m/s" %v
print "The time interval as measured on earth = %4.1f y"%T
```

In [3]:

```
import math
#Variable declaration
L0 = 4.30; # Distance of Alpha Centauri from earth, ly
c = 3e+008; # Speed of light, m/s
T = 8; # Proper time in system K_prime, y
#Calculations
# As v/c = L0*sqrt(1-(v/c)^2)/(c*T) or bita = L0*sqrt(1-bita^2)/(c*T), solving for bita
bita = math.sqrt(L0**2/(T**2 + L0**2)); # Boost parameter
v = L0*math.sqrt(1-bita**2)/T; # Speed of the aircraft, c units
#Results
print "The boost parameter = %5.3f"%bita
print "The speed of the aircraft = %5.3fc units"%v
```

In [4]:

```
import math
#Variable declaration
c = 1; # For simplicity assume speed of light to be unity, m/s
bita = 0.600; # Boost parameter
gama = 1/math.sqrt(1-bita**2); # Relativistic factor
u_x_prime = 0; # Speed of the protons in spaceship frame along x-axis, m/s
u_y_prime = 0.99*c; # Speed of the protons in spaceship frame along y-axis, m/s
u_z_prime = 0; # Speed of the protons in spaceship frame along z-axis, m/s
v = 0.60*c; # Speed of the spaceship w.r.t. space station, m/s
#Calculations
u_x = (u_x_prime + v)/(1 + v/c**2*u_x_prime); # Speed of protons in space station frame along x-axis, m/s
u_y = u_y_prime/(gama*(1 + v/c**2*u_x_prime)); # Speed of protons in space station frame along y-axis, m/s
u_z = u_z_prime/(gama*(1 + v/c**2*u_x_prime)); # Speed of protons in space station frame along y-axis, m/s
u = math.sqrt(u_x**2 + u_y**2 + u_z**2); # The speed of the protons measured by an observer in the space station, m/s
#Result
print "The speed of the protons measured by an observer in the space station = %5.3fc units"%u
```

In [5]:

```
#Variable declaration
c = 2.998e+008; # Speed of light in free space, m/s
v = 7712; # Speed of the space shuttle, m/s
bita = v/c; # Boost parameter
T_loss = 295.02; # Total measured loss in time, ps/sec
Add_T_loss = 35.0; # Additional time loss for moving clock from general relativity prediction, ps/s
#Calculations
# From time dilation relation, T0_prime = T*sqrt(1 - bita^2), solving for (T - T0_prime)/T
Calc_T_loss = bita**2/2*1e+012; # Expected time lost per sec by the moving clock, ps/sec
Measured_T_loss = T_loss + Add_T_loss; # Total measured loss in time per sec as per special relativity, ps/s
percent_T_loss = (Calc_T_loss - Measured_T_loss)/Calc_T_loss*100; # Percentage deviation of measured and the calculated time loss per sec
T = 6.05e+05; # Total time of the seven-day mission, s
delta_T = Calc_T_loss*1e-012*T; # The total time difference between the moving and stationary clocks during the entire shuttle flight, s
#Results
print "The expected time lost per second for the moving clock = %6.2f ps"%Calc_T_loss
print "The percentage deviation of measured and the calculated time loss per sec for moving clock = %3.1f percent"%percent_T_loss #answer differs due to rounding errors
print "The total time difference between the moving and stationary clocks during the entire shuttle flight = %3.1f ms"%(delta_T/1e-003)
```

In [7]:

```
import math
#Variable declaration
f0 = 1; # For simplicity assume frequency of the signals sent by Frank, Hz
# Outbound trip
bita = -0.8; # Boost parameter for receding frames
#Calculations&Results
f = math.sqrt(1+bita)/math.sqrt(1-bita)*f0; # The frequency of the signals received by Mary in outbound trip, Hz
print "The frequency of the signals received by Mary in outbound trip = f0/%d", math.ceil(f*9)
# Return trip
bita = +0.8; # Boost parameter for approaching frames
f = math.sqrt(1+bita)/math.sqrt(1-bita)*f0; # The frequency of the signals received by Mary in return trip, Hz
print "The frequency of the signals received by Mary in return trip = %df0"%f
```

In [8]:

```
import math
#Variable declaration
q = 1.6e-019; # Charge on an electron, C
V = 25e+003; # Accelerating potential, volt
K = q*V; # Kinetic energy of electrons, J
m = 9.11e-031; # Rest mass of an electron, kg
c = 3.00e+08; # Speed of light, m/s
#Calculations
# From relativistic kinetic energy formula, K = (gama - 1)*m*C^2, solving for gama
gama = 1 + K/(m*c**2); # Relativistic factor
bita = math.sqrt((gama**2-1)/gama**2); # Boost parameter
u = bita*c; # Speed of the electrons, m/s
# From non-relativistic expression, K = 1/2*m*u^2, solving for u
u_classical = math.sqrt(2*K/m); # Non-relativistic speed of the electrons, m/s
u_error = (u_classical - u)/u_classical*100; # Percentage error in speed of electrons, m/s
#Results
print "The relativistic speed of the accelerated electrons = %4.2e m/s"%u
print "The classical speed is about %d percent greater than the relativistic speed"%math.ceil(u_error)
```

In [9]:

```
import math
#Variable declaration
c = 1; # For simplicity assume peed of light to be unity, m/s
K = 2.00; # Kinetic energy of protons, GeV
E0 = 0.938; # Rest mass of a proton, GeV
E = K + E0; # Total energy of the proton, GeV
#Calculations
# From relativistic mass energy relation, E^2 = (p*c)^2+E0^2, solving for p
p = math.sqrt(E**2 - E0**2)/c; # Momentum of the protons, GeV/c
# As E = gama*E0, solving for gama
gama = E/E0; # Relativistic factor
bita = math.sqrt((gama**2-1)/gama**2); # Boost parameter
v = bita*3.00e+08; # Speed of 2 GeV proton, m/s
#Results
print "The energy of each initial proton = %5.3f GeV"%E
print "The momentum of each initial proton = %4.2f GeV/c"%p
print "The speed of each initial proton = %3.1e m/s"%v
print "The relativistic factor, gama = %4.2f"%gama
print "The boost parameter, beta = %5.3f"%bita
```

In [9]:

```
#Variable declaration
E_d = 1875.6; # Rest mass energy of the deuterium, MeV
E_pi = 139.6; # Rest mass energy of the pion, MeV
E_p = 938.3; # Rest mass energy of the proton, MeV
#Calculation
K = 1./2*(E_d + E_pi - 2*E_p); # Minimum kinetic energy of the protons, MeV
#Result
print "The minimum kinetic energy of the protons = %2d MeV"%K
```

In [10]:

```
#Variable declaration
u = 931.5; # Energy equivalent of 1 amu, MeV
c = 1; # Speed of light in vacuum, m/s
#Calculations
m_e = 0.000549*u; # Rest mass of an electron, MeV/c^2
m_p = 1.007276*u; # Rest mass of a proton, MeV/c^2
m_n = 1.008665*u; # Rest mass of a neutron, MeV/c^2
m_He = 4.002603*u; # Rest mass of a helium, MeV/c^2
M_He = m_He - 2*m_e; # Mass of He nucleus, MeV/c^2
E_B_He = (2*m_p + 2*m_n - M_He)*c**2; # Binding energy of the He nucleus, MeV
#Result
print "The binding energy of the He nucleus = %4.1f MeV"%E_B_He
```

In [11]:

```
#Variable declaration
u = 931.5; # Energy equivalent of 1 amu, MeV/u
c = 1; # For simplicity assume speed of light in vacuum to be unity, m/s
E_B = 4.24; # The dissociationenergy of the NaCl molecule, MeV
#Calculations
M = 58.44*u; # Energy corresponding to molecular mass of NaCl, MeV
f_r = E_B/M; # The fractional mass increase of the Na and Cl atoms
#Result
print "The fractional mass increase of the Na and Cl atoms when they are not bound together in NaCl = %4.1e"%(f_r/1e+006)
```

In [10]:

```
import math
#Variable declaration
c = 1; # For simplicity assume speed of light in vacuum to be unity, m/s
E0_n = 940; # Rest energy of a neutron, MeV
E0_pi = 140; # Rest energy of a pion, MeV
p_n = 4702; # Momentum of the neutron, MeV/c
p_pi = 169; # Momentum of the pion, MeV/c
#Calculations
E_n = math.sqrt((p_n*c)**2+E0_n**2); # Total energy of the neutron, MeV
E_pi = math.sqrt((p_pi*c)**2+E0_pi**2); # Total energy of the pion, MeV
E = E_n + E_pi; # Total energy of the reaction, MeV
p_sigma = p_n + p_pi; # Momentum of the sigma particle, MeV/c
E0_sigma = math.sqrt(E**2 - (p_sigma*c)**2); # Rest mass energy of the sigma particle, MeV
m_sigma = E0_sigma/c**2; # Rest mass of sigma particle, MeV/c^2;
K = E - E0_sigma; # Kinetic energy of sigma particle, MeV
#Results
print "The rest mass of sigma particle = %4d MeV/c^2"%math.ceil(m_sigma)
print "The kinetic energy of sigma particle = %4d MeV"%math.ceil(K)
#Answers differ due to rounding errors
```