# Chapter 2:The Special Theory of Relativity¶

## Example 2.1, Page 22¶

In :
#initiation of varible
v1=60.0; v2=40.0      #Velocities of cars wrt to observer in km/hr

#calculation
vr=v1-v2;         #relative velocity

#result
print"The value of relative velocity in km/h. is",round(vr,3);

The value of relative velocity in km/h. is 20.0


## Example 2.2, Page 22¶

In :
#initiation of variable
from math import atan, pi
import numpy as np
Va_w=[320.0,0.0]; Vw_g=[0.0, 65.0];            #Vp/q=[X Y]=>velocity of object p wrt q along X(east) and Y(north) directions.

#calculation
Va_g=Va_w + Vw_g;                    #net velocity
k=np.linalg.norm(Va_g)                       #magnitude
s=atan(Va_g/Va_g)*180.0/pi;    #angle in rad*180/pi for conversion to degrees

#result
print "the velocity in x direction in Km/h is", Va_w,"in y direction in km/h is",Vw_g
print"The magnitude of velocity Va/g(airplane wrt ground) in Km/h is",round(k,3)," at ",round(s,3)," degrees north of east."

The magnitude of velocity Va/g(airplane wrt ground) in Km/h is 326.535  at  11.482  degrees north of east.


## Example 2.4, Page 28¶

In :
#initiation of variable
from math import sqrt
Lo=100.0*(10**3);c=3.0*(10**8); #Given values//all the quantities are converted to SI units
d=2.2*(10**-6);      #time between its birth and decay

#calculation
t=Lo/c             #where Lo is the distance from top of atmosphere to the Earth. c is the velocity of light. t is the time taken
u=sqrt(1-((d/t)**2));   # using time dilation fromula for finding u where u is the minimum velocity in terms of c;

#result
print"Hence the minimum speed required in c is",round(u,6);

Hence the minimum speed required in c is 0.999978


## Example 2.5, Page 30¶

In :
#intiation of variable
from math import sqrt
Lo=100.0*(10**3);  #Lo is converted to Km
u=0.999978;      #//u/c is taken as u since u is represented in terms of c.

#calculation
L=Lo*(sqrt(1-u**2)); # from the length contraction formula

#result
print"Hence the apparent thickness of the Earth's surface in metres. is",round(L,3)
print"answer is slightly different in the book"

Hence the apparent thickness of the Earth's surface in metres. is 663.321
answer is slightly different in the book


## Example 2.6, Page 32¶

In :
#initiation of variable
from math import sqrt
L=65.0; c=3*10**8;u=0.8*c;

#calculation
t=L/u ;          #The value of time taken as measured by the observer

#result
print"The time for rocket to pass a point as measured by O in musec is ",round(t*10**6,3);         #The value of time taken as measured by the observer

#partb
Do=65.0;                             #given length
Lo= L/sqrt(1-(u/c)**2);                 #contracted length of rocket

#result
print"Actual length according to O is ",round(Lo,3);

#partc
D=Do*(sqrt(1-(u/c)**2));       #contracted length of platform.

#result
print"Contracted length according to O'' is",round(D,3);

#partd
t1=Lo/u;                    #time needed to pass according to O'.
print "Time taken according to O is ",t1

#part 3
t2=(Lo-D)/u;                   #time intervals between the two instances
print"Time taken according to O'' is ",t2;
print'The value of t1 and t2 does not match with textbook exactly';

The time for rocket to pass a point as measured by O in musec is  0.271
Actual length according to O is  108.333
Contracted length according to O'' is 39.0
Time taken according to O is  4.51388888889e-07
Time taken according to O'' is  2.88888888889e-07
The value of t1 and t2 did not match


## Example 2.7, Page 35¶

In :
#initiation of variable
v1=0.6; u=0.8; c=1.0; # all the values are measured in terms of c hence c=1

#calculation
v= (v1+u)/(1+(v1*u/c**2));

#result
print "The speed of missile as measured by an observer on earth in c is",round(v,3);

The speed of missile as measured by an observer on earth in c is 0.946


## Example 2.8, Page 37¶

In :
#initiation of variable
w1=600.0;w2=434.0;  # w1=recorded wavelength;w2=actual wavelength
# c/w1 = c/w2 *(sqrt(1-u/c)/(1+u/c))

#calculation
k=w2/w1;
x=(1-k**2)/(1+k**2);         #solving for u/c

#result
print"The speed of galaxy wrt earth in c is",round(x,3);

The speed of galaxy wrt earth in c is 0.313


## Example 2.9, Page 39¶

In :
#initiation of variable
from math import sqrt
v1x=0.6;v1y=0.0;v2x=0.0;v2y=.8;c=1.0;     # all the velocities are taken wrt c
v21x=(v2x-v1x)/(1-(v1x*v2x/c**2));   #using lorentz velocity transformation
v21y=(v2y*(sqrt(1-(v1x*c)**2)/c**2))/(1-v1y*v2y/c**2)

#result
print"The velocity of rocket 2 wrt rocket 1 along x and y directions is",round(v21x,3)," c &", round(v21y,3),"c respectively"

The velocity of rocket 2 wrt rocket 1 along x and y directions is -0.6  c & 0.64 c respectively


## Example 2.10, Page 40¶

In :
#initiation of variable
from math import sqrt
u=0.8*c;L=65.0;c=3.0*10**8;            #all values are in terms of c
t=u*L/(c**2*(sqrt(1-((u/c)**2))));  #from the equation 2.31

#result
print"The time interval between the events is",t, "sec which equals",round(t*10**6,3),"musec."

The time interval between the events is 2.88888888889e-07 sec which equals 0.289 musec.


## Example 2.11, Page 41¶

In :
#initiation of variable
from math import sqrt
m=1.67*10**-27;c= 3*10**8;v=0.86*c;      #all the given values and constants

#calculation
p=m*v/(sqrt(1-((v/c)**2)));            # in terms of Kgm/sec

#result
print"The value of momentum was found out to be in Kg-m/sec.\n",p;

#part 2
c=938.0;v=0.86*c;mc2=938.0                 # all the energies in MeV where mc2= value of m*c^2
pc=(mc2*(v/c))/(sqrt(1-((v/c)**2)));    #expressing in terms of Mev

#result
print"The value of momentum was found out to be in Mev.",round(pc,3);

The value of momentum was found out to be in Kg-m/sec.
8.44336739668e-19
The value of momentum was found out to be in Mev. 1580.814


## Example 2.12, Page 47¶

In :
#initiation of variable
from math import sqrt
pc=1580.0; mc2=938.0;E0=938.0;    # all the energies in MeV mc2=m*c^2 and pc=p*c

#result
E=sqrt(pc**2+mc2**2);
K=E-E0;                      #value of possible kinetic energy

#result
print"The relativistic total energy in MeV. is",round(E,3);         #value of Energy E
print"The kinetic energy of the proton in MeV.",round(K,3);

The relativistic total energy in MeV. is 1837.456
The kinetic energy of the proton in MeV. 899.456


## Example 2.13, Page 47¶

In :
#initiation of variable
from math import sqrt
E=10.51; mc2=0.511; #all the values are in MeV

#calculation
p=sqrt(E**2-mc2**2);   #momentum of the electron
v=sqrt(1-(mc2/E)**2);  #velocity in terms of c

#result
print"The momentum of electron in MeV/c is",round(p,3);
print"The velocity of electron in c is",round(v,5);

The momentum of electron in MeV/c is 10.498
The velocity of electron in c is 0.99882


## Example 2.14, Page 47¶

In :
#initiation of variable
from math import sqrt
k=50;mc2=0.511*10**-3;c=3.0*10**8; # all the values of energy are in GeV and c is in SI units

#calculation
v=sqrt(1-(1/(1+(k/mc2))**2));   #speed of the electron in terms of c
k=c-(v*c);                       #difference in velocities

#result
print"Speed of the electron as a fraction of c*10^-12 is.",round(v*10**12,3); # v=(v*10^12)*10^-12; so as to obtain desired accuracy in the result
print"The difference in velocities in cm/s.",round(k*10**2,3);

Speed of the electron as a  fraction of c*10^-12 is. 9.99999999948e+11
The difference in velocities in cm/s. 1.567


## Example 2.15, Page 48¶

In :
#initiation of variable
from math import sqrt, pi
r=1.5*10**11; I=1.4*10**3;     #radius and intensity of sun

#calculation
s=4*pi*r**2                 #surface area of the sun
Pr=s*I                     # Power radiated in J/sec
c=3.0*10**8;                #velocity of light
m=Pr/c**2                  #rate of decrease of mass
m=round(m,2)

#result
print"The rate of decrease in mass of the sun in kg/sec. is %.1e" %m;

The rate of decrease in mass of the sun in kg/sec. is 4.4e+09


## Example 2.16, Page 48¶

In :
#initiation of variable
from math import pi, sqrt
K=325; mkc2=498;  #kinetic energy and rest mass energy of kaons
mpic=140.0; #given value

#calculation
Ek=K+mkc2;
pkc=sqrt(Ek**2-mkc2**2);
#consider the law of conservation of energy which yields Ek=sqrt(p1c^2+mpic^2)+sqrt(p2c^2+mpic^2)
#The above equations (4th degree,hence no direct methods)can be solved by assuming the value of p2c=0.
p1c=sqrt(Ek**2-(2*mpic*Ek));
#consider the law of conservation of momentum. which gives p1c+p2c=pkc implies
p2c=pkc-p1c;
k1=(sqrt(p1c**2+(mpic**2))-mpic); #corresponding kinetic energies
k2=(sqrt((p2c**2)+(mpic**2))-mpic);

#result
print"The corresponding kinetic energies of the pions are", k1," MeV and",round(k2,3)," MeV."

The corresponding kinetic energies of the pions are 543.0  MeV and 0.627  MeV.


## Example 2.17, Page 49¶

In :
#initiation of variable
from math import sqrt
mpc2=938.0;c=3.0*10**8;  #mpc2=mp*c^2,mp=mass of proton

#calculation
Et=4*mpc2;          #final total energy
E1=Et/2;E2=E1;       #applying conservation of momentum and energy
v2=c*sqrt(1-(mpc2/E1)**2);    #lorentz transformation
u=v2;v=(v2+u)/(1+(u*v2/c**2));
E=mpc2/(sqrt(1-(v/c)**2));
K=E-mpc2;

#result
print"The threshold kinetic energy in Gev",round(K/10**3,3);

The threshold kinetic energy in Gev 5.628