#example 17.1
#calculation of the speed of light in glass
#given data
mu=1.5#refractive index of glass
v0=3.*10.**8.#speed(in m/s) of light in vacuum
#calculation
v=v0/mu#definition of the refractive index
print '%s %.2f %s' %('the speed of light in glass is',v,'m/s')
#example 17.2
#calculation of the separation between successive bright fringes
#given data
d=0.10*10.**-3.#separation(in m) between the slits
lambd=600.*10.**-9.#wavelength(in m) of the light used
D=1.#separation(in m) between the slits and the screen
#calculation
w=D*lambd/d#separation between successive bright fringes
print '%s %3.1e %s %.2f %s' %('the separation between successive bright fringes is',w,'m or',w*10**3,'mm')
#example 17.3
#calculation of the wavelength of light in the water
#given data
lambdan=589.#wavelength(in nm) of light in vacuum
mu=1.33#refractive index of water
#calculation
lambd=lambdan/mu#definition of the refractive index
print '%s %.2f %s' %('the wavelength of light in the water is',round(lambd),'nm')
#example 17.4
#calculation of the minimum thickness of the film
#given data
lambd=589.#wavelength(in nm) of the light used
mu=1.25#refractive index of the material
#calculation
#for strong reflection......2*mu*d = lambda/2
d=lambd/(4.*mu)#minimum thickness
print '%s %.2f %s' %('the minimum thickness of the film is',round(d),'nm')
#example 17.5
#calculation of the angular divergence for most of the light getting diffracted
#given data
lambd=450.*10.**-9.#wavelength(in m) of the light used
b=0.2*10.**-3.#width(in m) of the slit
#calculation
#for theta tends to zero......sin(theta) = theta
theta1=lambd/b#angle of minima
theta2=-lambd/b#angle of minima
theta=theta1-theta2#angular divergence
print '%s %3.1e %s' %('the angular divergence for most of the light getting diffracted is',theta,'radian')
#example 17.6
#calculation of the diameter of the disc image
#given data
lambd=590.*10.**-9.#wavelength(in m) of the light used
b=10.*10.**-2.#diameter(in m) of the converging lens used
d=20.#distance(in m) between the lens and the point of focus
#calculation
sintheta=1.22*lambd/b#angular radius
r=d*sintheta#radius of the disc image
d=2.*r#diameter of the disc image
print '%s %3.1e %s' %('the diameter of the disc image is',d,'cm')
#example 17.1w
#calculation of the limits of wavelengths in the water
#given data
lambda01=400.#mimimum wavelength(in nm) of the light used
lambda02=700.#maximum wavelength(in nm) of the light used
mu=1.33#refractive index of water
#calculation
lambda1=lambda01/mu#definition of the refractive index
lambda2=lambda02/mu#definition of the refractive index
print '%s %.2f %s %.2f %s' %('the limits of wavelengths in the water are',lambda1,'nm and',lambda2,'nm')
#example 17.2w
#calculation of the refractive index of the glass
#given data
x1=2.#distance(in cm)travelled through the glass
x2=2.25#distance(in cm)travelled through the water
muw=1.33#refractive index of water
#calculation
#for 'x' distance travelled through a medium of refractive index 'mu',the optical path is 'mu*x'
mug=muw*x2/x1#refractive index of glass
print '%s %.2f' %('the refractive index of the glass is',mug)
#example 17.3w
#calculation of the wavelengths of the violet and the red light
#given data
D=2.5#separation(in m) between the slit and the screen
d=0.5*10.**-3.#separation(in m) between the slits
yv=2.*10.**-3.#distance(in m) between the central white fringe and the first violet fringe
yr=3.5*10.**-3.#distance(in m) between the central white fringe and the first red fringe
#calculation
lambdav=yv*d/D#wavelength of the violet light
lambdar=yr*d/D#wavelength of the red light
print '%s %.2f %s' %('the wavelength of the violet light is',lambdav*10**9,'nm')
print '%s %.2f %s' %('\nthe wavelength of the red light is',lambdar*10**9,'nm')
#example 17.4w
#calculation of the separation between the slits
#given data
lambd=589.3*10.**-9.#wavelength(in m) of the sodium light
D=100.*10.**-2.#separation(in m) between the slit and the screen
n=10.#number of the bright fringe
x=12.*10.**-3.#distance(in m) between the central maximum and the tenth bright fringe
#calculation
d=n*lambd*D/x#separation between the slits
print '%s %3.1e %s %.2f %s' %('the separation between the slits is',d,'m or',d*10**3,'mm')
#example 17.5w
#calculation of the ratio of maximum intensity to the minimum intensity in the interference fringe pattern
#given data
#intensity of the light coming from one slit in Young's double slit experiment is double the intensity of the light coming from the other slit
n=2.
import math
#calculation
r=((math.sqrt(n)+1.)**2.)/((math.sqrt(n)-1.)**2.)#required ratio
print '%s %.2f' %('the ratio of maximum intensity to the minimum intensity in the interference fringe pattern is',round(r))
#example 17.6w
#calculation of the ratio of maximum intensity to the minimum intensity in the interference pattern
#given data
#width of one slit in Young's double slit experiment is double that of the other
n=2.
#calculation
r=((n+1.)**2.)/((n-1.)**2.)#required ratio
print '%s %.2f' %('the ratio of maximum intensity to the minimum intensity in the interference pattern is',r)
#example 17.7w
#calculation of the maximum and the minimum path difference at the detector
#given data
lambd=600.*10.**-9.#wavelength(in m) of the light
d=1.*10.**-2.*10.**-2.#distance(in m) between the sources
#calculation
pdmax=d#path diffrence maximum
pdmin=0#path diffrence minimum
#farthest minima occurs for path difference lambda/2
#sqrt(D**2 + d**2) - D = lambda/2
D=(d**2./lambd)-(lambd/4.)#distance of the farthest minima
print '%s %3.1e %s' %('the maximum path difference on moving the detector along S1P line is',pdmax*10**2,'m')
print '%s %.2f %s' %('\nthe minimum path difference on moving the detector along S1P line is',pdmin*10**2,'cm')
print '%s %.2f %s' %('\nthe farthest minimum is located at a distance of',D*10**2,'cm from the point S1')
#example 17.8w
#calculation of the distance of bright fringe from the central maximum
#given data
lambda1=6500.*10.**-10.#wavelength(in m) of the light beam1
lambda2=5200.*10.**-10.#wavelength(in m) of the light beam2
d=2.0*10.**-3.#separation(in m) between the slits
D=120.*10.**-2.#separation(in m) between the slits and the screen
n=3.#number of the bright fringe
#calculation
y=n*lambda1*D/d#the distance of bright fringe from the central maximum
#from the equation of the distance of bright fringe from the central maximum.....y=n*lambda*D/d
#let m th bright fringe of beam 1 coincides with n th bright fringe of beam 2
#ym = yn
#m : n = 4 : 5.....is their minimum integral ratio
m=4.
ym=m*lambda1*D/d#least distance from the central maximum where both wavelengths coincides
print '%s %.2f %s' %('the distance of the third bright fringe from the central maximum is',y*10**2,'cm')
print '%s %.2f %s' %('\nthe least distance from the central maximum where both the wavelengths coincides is',ym*10**2,'cm')
#example 17.9w
#calculation of the number of fringes that will shift due to introduction of the sheet
#given data
lambd=600.*10.**-9.#wavelength(in m) of the light used
t=1.8*10.**-5.#thickness(in m) of the transparent sheet
mu=1.6#refractive index of the material
#calculation
n=((mu-1.)*t)/lambd#number of fringes shifted
print '%s %.2f' %('the number of fringes that will shift due to introduction of the sheet is',n)
#example 17.10w
#calculation of the wavelengths in the visible region that are strongly reflected
#given data
d=.5*10.**-6.#thickness(in m) of the glass plate
mu=1.5#refractive index of the medium
lambda1=400.*10.**-9.#minimum wavelength(in m) of the visible region
lambda2=700.*10.**-9.#maximum wavelength(in m) of the visible region
#calculation
#condition for strong reflection of light of wavelength lambda is
#2*mu*d = (n + (1/2))*lambda............(1)
n1=round((2.*mu*d/lambda1)-(1./2.))#integral value of n for lambda1
n2=round((2.*mu*d/lambda2)-(1./2.))#integral value of n for lambda2
lambda1n=(2.*mu*d)/(n1+(1./2.))#from equation (1)
lambda2n=(2.*mu*d)/(n2+(1./2.))#from equation (1)
print '%s %.2f %s %.2f %s' %('the wavelengths in the visible region that are strongly reflected are',round(lambda1n*10**9),'nm and',round(lambda2n*10**9),'nm')
#example 17.11w
#calculation of the distance between the two first order minima
#given data
b=.40*10.**-3.#width(in m) of the slit
D=40.*10.**-2.#separation(in m) between the slit and the screen
lambd=546.*10.**-9.#wavelength(in m) of the light used
#calculation
#linear distances from the central maxima are given by..x = D*tan(theta) = D*sin(theta) = +-lambda*D/b
sep=2.*lambd*D/b#separation between the minima
print '%s %.2f %s' %('the distance between the two first order minima is',sep*10**3,'mm')