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
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
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)
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";
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
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
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
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
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
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);
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";
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
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";
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
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";
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";
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
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";