Chapter 7, Superposition of harmonic waves : Interference, Beats, Stationary waves, Phase and group velocities

Example 1, page 272

In [1]:
from __future__ import division
from numpy import sqrt
#  ratio
ri=9/16 #ratio of intensities
ra=sqrt(ri) #ratio of amplitude
a1=1 #assume
a2=ra*a1 #
rim=(a1+a2)**2/(a1-a2)**2 #
print "Ratio of maximum intensity and minimum intensity in fringe system is %d"%rim,":",a1
Ratio of maximum intensity and minimum intensity in fringe system is 49 : 1

Example 2, page 272

In [3]:
from math import cos, pi
#  intensity
I=1 #assume
a1=1*I #
a2=4*I #
ph1=0 #degree
i1=(a1+a2)+a2*cos(ph1*pi/180) #
print "Intensity where phase difference is zero =",i1,"*I"
ph2=90 #degree
i2=(a1+a2)+a2*cos(ph2*pi/180) #
print "Intensity where phase difference is pi/2 =",i2,"*I"
ph3=180 #degree
i3=(a1+a2)+a2*cos(ph3*pi/180) #
print "Intensity where phase difference is pi is =",i3,"*I"
Intensity where phase difference is zero = 9.0 *I
Intensity where phase difference is pi/2 = 5.0 *I
Intensity where phase difference is pi is = 1.0 *I

Example 3, page 273

In [4]:
#  Wavelength and frequency
#given data :
d=30 # in cm
lamda=2*d*10**-2 
v=330 # in m/s
print "The wavelength = %0.2f m " %lamda
n=v/lamda 
print "The frequency, n = %0.2f vibrations/s " %n
The wavelength = 0.60 m 
The frequency, n = 550.00 vibrations/s 

Example 4, page 281

In [11]:
#  number of beats and time interval
from fractions import Fraction
n1=300 #Hz
n2=303 #Hz
bfs=n2-n1 #
print "Beat frequency = %0.2f per second " %bfs
ti=Fraction(1/bfs).limit_denominator(3) #second
print "Time interval =",ti,"second  "
 Beat frequency = 3.00 per second 
Time interval = 1/3 second  

Example 5, page 281

In [12]:
#  Frequency
#given data :
n1=256 # in Hz
x=4 # in beats per sec
n2a=n1+x 
n2b=n1-x 
print "The frequency, n2a = %0.2f Hz " %n2a
print "The frequency, n2b = %0.2f Hz  "% n2b 
The frequency, n2a = 260.00 Hz 
The frequency, n2b = 252.00 Hz  

Example 6, page 282

In [15]:
#  Frequency
#given data :
nA=256 # in Hz
x=5 # in beats per sec
nB1=nA+x 
nB2=nA-x 
print "The frequency, nB = %0.f Hz or %0.f Hz" %(nB1, nB2)
The frequency, nB = 261 Hz or 251 Hz

Example 7, page 283

In [17]:
#  Frequency
#given data :
nB=512 # in Hz
x=5 # in beats per sec
nA1=nB+x 
nA2=nB-x 
print "The frequency of A, nA = %0.f Hz or %0.f Hz" %(nA1, nA2)
The frequency of A, nA = 517 Hz or 507 Hz

Example 8, page 283

In [19]:
#  Velocity of sound
#given data :
lamda1=1 # in m
lamda2=1.01 # in m
a=10/3 # in beats/sec
v=a/((lamda2-lamda1)/(lamda1*lamda2)) 
print "The velocity of sound, v = %0.1f m/s " %v
The velocity of sound, v = 336.7 m/s 

Example 9, page 284

In [20]:
#  Frequency
n=273 #
b1=4 #beats per second
b2=b1-1 #
t1=15 #degree celsius
t2=10 #degree celsius
v1510=sqrt((n+t1)/(n+t2)) #
n=((b2*v1510-b1)/(1-v1510)) #
print "Frequency = %0.2f Hz " %n
Frequency = 110.70 Hz 

Example 10, page 284

In [21]:
#  Frequency
b1=10 #beats per second
f1=300 #Hz
b2=15 #beats per second
f2=325 #Hz
n1=f1-b1 #Hz
n2=f1+b1 #Hz
n3=f2-b2 #Hz
n4=f2+b2 #Hz
print "Frequency = %0.2f Hz " %n2
Frequency = 310.00 Hz 

Example 11, page 285

In [22]:
#  Velocity of sound
#given data :
lamda1=5 # in m
lamda2=5.5 # in m
a=6 # beats/sec
v=a/((lamda2-lamda1)/(lamda1*lamda2)) 
print "The velocity of sound, v = %0.2f m/s  " %v
The velocity of sound, v = 330.00 m/s  

Example 12, page 285

In [23]:
#  Frequency
b1=5 #beats per second
fr=384 #Hz
fo=fr-b1 #Hz
print "Frequency = %0.2f Hz  " %fo
Frequency = 379.00 Hz  

Example 13, page 285

In [25]:
#  Frequency
b1=4 #beats per second
fr=256 #Hz
fo1=fr+b1 #Hz
fo2=fr-b1 #Hz
print "Frequency = %0.f Hz or %0.f Hz" %(fo1,fo2)
Frequency = 260 Hz or 252 Hz

Example 18, page 297

In [26]:
#Frequency,wavelength, velocity and amplitude
#given data :
a=6 # in cm
lamda=10 # in cm
T=1/10 # in sec
print "Wavelength of progressive wave = %0.2f cm " %lamda
n=1/T 
print "Frequency of progressive wave, n = %0.2f per sec " %n
v=n*lamda 
print "The velocity, v = %0.2f cm/s " %v
print "The amplitude, a = %0.2f cm " %a
Wavelength of progressive wave = 10.00 cm 
Frequency of progressive wave, n = 10.00 per sec 
The velocity, v = 100.00 cm/s 
The amplitude, a = 6.00 cm 

Example 24, page 309

In [28]:
#Velocity
#given data :
c=3*10**8 # in m/s
lamda1=4000 # in Angustrom
lamda2=5000 # in Aungustrom
mu1=1.540 
mu2=1.530 
vg=c*((mu1*lamda1)-(mu2*lamda2))/(mu1*mu2*(lamda1-lamda2)) 
print "The velocity, vg = %0.3e m/s " %vg
The velocity, vg = 1.897e+08 m/s 

Example 25, page 310

In [29]:
#Velocity
#given data :
v=1.8*10**8 # in m/s
lamda=3.6*10**-7 # in m
dv_dlamda=3.8*10**13 # in per sec
vg=v-(lamda*dv_dlamda) 
print "The group velocity, vg = %0.2e m/s " %vg
The group velocity, vg = 1.66e+08 m/s