Chapter 1: Elements of Optics And Quantum Physics

Example 1.1,Page number 5

In [4]:
import math

#Given

print"(i)  t1=d/c";
print"(ii) t2=[(d-5)/c]+[5/v2]";
print"     v2=c/n2";
print"     t2=(d+2.5)/c";
print"(iii)delta_t=t2-t1=(d+2.5-d)/c";
c=3*10**8;                       #Speed of light in m/s
delta_t=2.5*10**-2/c;            #converted 2.5 cm into meters
print"The time difference","{0:.3e}".format(delta_t),"s" ;
print"Arrival time difference of two monochromatic beams is",delta_t*10**12,"ps";
# Answer misprinted in the book
(i)  t1=d/c
(ii) t2=[(d-5)/c]+[5/v2]
     v2=c/n2
     t2=(d+2.5)/c
(iii)delta_t=t2-t1=(d+2.5-d)/c
The time difference 8.333e-11 s
Arrival time difference of two monochromatic beams is 83.3333333333 ps

Example 1.2,Page number 5

In [7]:
import math

#given 

#Applying Snell's law
a=1*math.sin(428)/1.333;      #a=sin(w2)
print"Angle of refraction is",round(math.degrees(math.asin(a)),3),"degree";

c=3*10**8;          #speed of light in m/s
n2=1.333;           #refractive index of 2nd medium
v2=c/n2;            #velocity in second medium in m/s
n1=1;               #refractive index of 1st medium
l1=620;             #in nm   wavelength

print"Velocity of optical ray through medium second","{0:.3e}".format(v2),"m/s";

l2= (n1*l1)/n2;     #wavelength in 2nd medium in nm
print"Wavelenght of optical ray through medium second",round(l2,4),"nm";       #Result
Angle of refraction is 30.512 degree
Velocity of optical ray through medium second 2.251e+08 m/s
Wavelenght of optical ray through medium second 465.1163 nm

Example 1.3,Page number 5

In [12]:
import math

#given 

n1=1;                   #refractive index of air
n2=1.56;                #refractive index of medium
w1=60;                  #in deg C
#using snell's law
a= n1*sin(w1*math.pi/180)/n2;             #a=sin(w1)
w2=math.degrees(math.asin(a));            #in degree
print"Angle of refraction is",round(w2,4),"degree";
B=w1-w2;                                  #in degree
print"Angle of deviation is",round(B,4),"degree";
# The answer doesn't match because of priting errorsin calculation as sin(608)
Angle of refraction is 33.7207 degree
Angle of deviation is 26.2793 degree

Example 1.4,Page number 6

In [22]:
import math

#given 

print"Solution (i)";
w=5/12.5;                     #tan(w)=5/12.5;
print"The value of tan(w2) is",w;
w2=math.atan(w)*180/math.pi;

print"The value of w2 is",round(w2,4),"degree";
print"The value of sin(w2) is",round(math.sin(w2*math.pi/180),4);

print"Solution (ii)";
#Applying snell's law
n1=1.05;
n2=1.5;
w1=(n2*sin(w2*math.pi/180))/n1;  #a=sin(w1)
print"The value of sin(w1) is",round(w1,4);
print"The value of w1 is",round(math.degrees(math.asin(w1)),4),"degree";
#value of w1
#tan(w1)=(p-x)12.5;
k=0.62*12.5;
d=1.05*((12.5)**2+(k)**2)**0.5 +1.5*(12.5**2+5**2)**0.5;       #d=1.05[(h1)^2+(k)^2]^0.5 +n2(h2**2+x**2)^0.5;
print"The optical distance is",round(d,4),"cm";
Solution (i)
The value of tan(w2) is 0.4
The value of w2 is 21.8014 degree
The value of sin(w2) is 0.3714
Solution (ii)
The value of sin(w1) is 0.5306
The value of w1 is 32.0432 degree
The optical distance is 35.6373 cm

Example 1.5,Page number 11

In [24]:
import math

#given 

c=3*10**8;
print"Solution (i)";
ri=1.5;          #refractive index
u=830;           # in nm
l=u/ri;          #in nm
print"Wavelength is",round(l,4),"nm\n";

print"Solution (ii)";
l=round(l);                 # rounding to nearest integer
f=c/(l*10**-9)*10**-12;     #in THz
print"frequency is",round(f,4),"THz\n";

print"Solution (iii)";
f=round(f);                 #rounding to nearest integer
v=l*10**-9*f*10**12;        #in m/s
print"phase velocity is","{0:.3e}".format(v),"m/s";

#answer is getting rounding off due to larger calculation
Solution (i)
Wavelength is 553.3333 nm

Solution (ii)
frequency is 542.4955 THz

Solution (iii)
phase velocity is 2.997e+08 m/s

Example 1.6,Page number 12

In [26]:
import math

#given 

print"Solution (i)";
l=720;          #wavelength in nm
n=1.5;          #refractive index
lm=l/n;
print"Wavelenth is",lm,"nm";       #result

print"Solution (ii)";
c=3*10**8;      #in m/s speed of light
u=c/n;
print"Velocity  is","{0:.3e}".format(u),"m/s";       #result
Solution (i)
Wavelenth is 480.0 nm
Solution (ii)
Velocity  is 2.000e+08 m/s

Example 1.7,Page number 12

In [29]:
import math

#given 

print"Solution (i)";
c=3*10**8;       #in m/s speed of light
l=640;           #in nm
u=2.2*10**8;     #in m/s
lm=u*l/c;        #wavelenth in medium
print"The wavelength is",round(lm,4),"nm";       #The answer in the book is misprinted

print"Solution (ii)";
n=l/lm;         #refractive index
print"Refractive Index is",round(n,4);        #The answer in the book is misprinted
Solution (i)
The wavelength is 469.3333 nm
Solution (ii)
Refractive Index is 1.3636

Example 1.8,Page number 12

In [30]:
import math

#given 

#k=aa+as=6.3;
#Given values from research
k=6.3;      #combined attenuation due to absorption and scattering
d=25;       #in cm
print"Solution (ii)";
#Io/Ii=exp(-(ao+ai)*d);  d in m
j=math.e**(-(k)*d/100);  #Io/Ii ratio
print"Io is",round(j,4),"of Ii";       #result
Solution (ii)
Io is 0.207 of Ii

Example 1.9,Page number 13

In [32]:
import math

#given 

# Given formula   Io/Ii=exp(-(ao+ai)*d);
# k=aa+as=63.1;
# Io/Ii=1.5
d=log(0.15)/-63.1;       #length of tube
print"Length of tube, d =",round(d*100,4),"cm";      #Result
Length of tube, d = 3.0065 cm

Example 1.10,Page number 26

In [35]:
import math

#given

#p=m/{m+[2*n/(1-n)^2]^2};

m=5;            #no. of reflective plates
n=1.33;         #refractive indices
p=m/(m+(2*n/(1-(n)**2))**2); #degree of polarisation
print"The degree of polarisation is",round(p,1);
The degree of polarisation is 0.3

Example 1.11,Page number 26

In [41]:
import math

#given

#m= p*{m+[2*n/(1-n)^2]^2};

n=1.5;          #refractive indices
p=0.45;         #degree of polarisation
m=(p*(2*n/(1-n**2))**2)/(1-p);
print"Thus it will require",round(m,4),"reflective plate to achive a degree of polarization equal to 0.45";  
Thus it will require 4.7127 reflective plate to achive a degree of polarization equal to 0.45

Example 1.12,Page number 27

In [43]:
import math

#given
#I1/I0=cos(w)^2
#k=I1/I0;

w=30;               #angle bw polarizer and analyser in degee
k=math.cos(w*math.pi/180)**2;
print"The ratio of optical ray intensity ,I1/I0=",k;           #Result
The ratio of optical ray intensity ,I1/I0= 0.75

Example 1.13,Page number 27

In [48]:
import math

#given data

#I1/I0=cos(w)^2
#Given I1/I0=0.55

k=math.sqrt(0.55);         #from above formulae

print"The angle bw polarizer and analyser , w is",round(math.degrees(math.acos(k)),4),"degree";
The angle bw polarizer and analyser , w is 42.1304 degree

Example 1.14,Page number 29

In [51]:
import math

#given 

print"Solution (i)";
ne=1.4;             #refractive index
no=1.25;            #refractive index
c=3*10**8;                   #in m/s
T=2*10**-5;  #in m
l=740;       #in nm
t=(ne-no)*T/c;      #time difference
print"Time difference, t is",t*10**12,"ps";
print"Solution (ii)";
le=l/ne; 
lo=l/no;
fi=2*math.pi*T*(1/le-1/lo)*10**9;
print"Phase difference is",round(fi,4),"rad"; 
# Answer misprinted in book
Solution (i)
Time difference, t is 0.01 ps
Solution (ii)
Phase difference is 25.4724 rad

Example 1.15,Page number 31

In [53]:
import math

#given 

#E=h*v=h*c/l;

E=3;       #In KeV
#1eV=1.6*10^-19
h=6.63*10**-34;      #plank constant in J/s
c=3*10**8;           # speed of light in m/s
l=h*c/(E*10**3*1.6*10**-19);     #wavelength  in nm
print"wavelength of a electromagnetic radiation is",round(l*10**9,4),"nm";
wavelength of a electromagnetic radiation is 0.4144 nm

Example 1.16,Page number 31

In [62]:
import math

#given

print"Solution (i)";
l=670            #in nm
h=6.63*10**-34;  #plank constant in J/s
c=3*10**17       #speed of light in nm/sec
Ek=0.75          #In eV
phi=(h*c/l)/(1.6*10**-19) -Ek;
phi=round(phi*10)/10;           #round to 1 decimal point
print"Characteristic of material =",phi,"eV";

print"Solution (ii)";
fc=phi*1.6*10**-19/h*10**-12;   #frequency in THz#result
fc=round(fc);
print"Cuttoff frequency is =",fc,"THz";
lc=c/(fc*10**12);       #in nm
print"Cuttoff wavelength is =",round(lc,4),"nm";
Solution (i)
Characteristic of material = 1.1 eV
Solution (ii)
Cuttoff frequency is = 265.0 THz
Cuttoff wavelength is = 1132.0755 nm

Example 1.17,Page number 31

In [59]:
import math

#given

print"Solution (i)";
l=0.045;              #wavelength in nm
h=6.63*10**-34;       #planks constant in J/s
c=3*10**8;            #speed of light in m/s
E=h*c/l/10**-9;       #energy of photon in eV
print"E =","{0:.3e}".format(E),"J";

E1=E/(1.6*10**-19);    # energy in joule
print"E =","{0:.3e}".format(E1),"eV";
        
e=1.6*10**-19;    # charge of electron

print"Solution (ii)";
V=E/e;
print"Required voltage is =",V/1000,"KV";

#Value of wavelenght in problem is .45 but in the solution is .045 
#the value considered above is .045
Solution (i)
E = 4.420e-15 J
E = 2.762e+04 eV
Solution (ii)
Required voltage is = 27.625 KV

Example 1.18,Page number 36

In [61]:
import math

#given

print"Solution (i)";
x=620                 # difference in particle momentum In nm
h=6.63*10**-34        # planks constant In J/s
#p=h/(4*pi*x);
#m*v=h/(4*pi*x);
m=9.11*10**-31        #mass of electron in kg 
v=h /(4*math.pi* x *10**-9*m);   #electron velocity
print"The uncertanity in electron velocity is",round(v,4),"m/s";
Solution (i)
The uncertanity in electron velocity is 93.41 m/s