print "---------------------------------------------------------------"
print " Material Linear Electro Optic n+ n- Relative "
print " Coefficient r(pm/V) Permittivity"
print "----------------------------------------------------------------"
print " KDP 10.6 1.51 1.47 42 "
print " KD*P 26.4 1.51 1.47 50 "
print " ADP 8.5 1.52 1.48 43 "
print " CdTe 6.8 2.6 10.6"
print " GaAs 1.6 3.6 11.5"
print " ZnS 2.1 2.32 16"
print "-----------------------------------------------------------------"
print " Table 3.1"
l=10*(10**-3) #width of crystal
V=4000 #Applied Voltage
#From equation 3.1
#Using data in Table 3.1
dn=0.5*26.4*(10**-12)*(1.51**3)*(V/(10**-2)) #where dn is the change in refraction index
print "The Change in Refraction Index due to pockels effect is %.2e "%(dn)
print "---------------------------------------------------------------"
print " Material Linear Electro Optic n+ n- Relative "
print " Coefficient r(pm/V) Permittivity"
print "----------------------------------------------------------------"
print " KDP 10.6 1.51 1.47 42 "
print " KD*P 26.4 1.51 1.47 50 "
print " ADP 8.5 1.52 1.48 43 "
print " CdTe 6.8 2.6 10.6"
print " GaAs 1.6 3.6 11.5"
print " ZnS 2.1 2.32 16"
print "-----------------------------------------------------------------"
print " Table 3.1"
l=1.06*(10**-6) #Wavelength in meter
#Using Data from table 3.1 below
V=l/(2*10.6*(10**-12)*(1.51**3)) #Where V is the half wave voltage
V=round(V,1)
print ""
print "Using Data from table 3.1 "
print "The Half Wave Voltage for KDP is "+str(V)+" Volt"
print "---------------------------------------------------------------"
print " Material Linear Electro Optic n+ n- Relative "
print " Coefficient r(pm/V) Permittivity"
print "----------------------------------------------------------------"
print " KDP 10.6 1.51 1.47 42 "
print " KD*P 26.4 1.51 1.47 50 "
print " ADP 8.5 1.52 1.48 43 "
print " CdTe 6.8 2.6 10.6"
print " GaAs 1.6 3.6 11.5"
print " ZnS 2.1 2.32 16"
print "-----------------------------------------------------------------"
print " Table 3.1"
bw=10**9 #Frequency Bandwidth in Hertz
d=25*(10**-3) #Diameter of circular aperture
l=30*(10**-3) #Length
wl=633*(10**-9) #Given Wavelength
PI=3.14
k=8.85*(10**-12) #Permittivty of free space
#From equation 3.15 & data from table 3.1
P=((PI**2)*(wl**2)*PI*((d/2)**2)*bw*k*50)/(4*PI*(30**2)*((26.4*(10**-12))**2)*(1.51**6)*l) #Where P is the power requirements
P=round(P,1)
print ""
print ""
print "The Power Requirements for Modulation using a Pockels cell is "+str(P)+" W"
from math import asin
from math import degrees
from math import cos
from math import sqrt
l=633*(10**-9) #Given Wavelength in meter
bw=5.0*(10**6) #Bandwidth in hertz
l1=50*(10**-3) #Modulation length
de=0.7 #Diffraction Efficiency
al=4.3*(10**-5) #Acoustic Wavelength in meter
av=3500.0 #Acoustic velocity in meter per second
#From equation 3.20
theta=asin(l/(2*al)) #where theta is the angle of diffraction
theta1=degrees(theta) #Converting it into degrees
theta1=round(theta1,2)
#From equation 3.21
phi=2*(asin(sqrt(de))) #where phi is the internal braggs angle
phi1=degrees(phi) #Converting it into degrees
phi1=round(phi1,1)
e=cos(theta1)
dn=(phi*l*e)/(3.14*2*l1) #where dn is the maximum change in refraction index
B=av/bw
print "The angle of diffraction is "+str(theta1)+" Degree"
print "The Internal Braggs Angle is "+str(phi1)+" Degree"
print "The Maximum Change in Refraction index is %.2e"%(dn)
print "The Maximum Optical Beam Width is "+str(B)+" meter"
#Answer Number 3 is Misprinted in the book
from math import asin
from math import degrees
print "-----------------------------------------------"
print " Wavelength no nc "
print "(Micrometer) "
print "------------------------------------------------"
print " 1.06 1.4943 1.4603 "
print " 0.53 1.5132 1.4712"
print "-------------------------------------------------"
print ""
#from problem 3.10
t2=((1.4943**-2)-(1.5132**-2))/((1.4712**-2)-(0.4367))
theta1=asin(t2)
theta1=degrees(theta1) #Where theta is the phase matching angle
theta1=round(theta1,1)
print "The Phase matching angle is "+str(theta1)+" degrees"
nw=1.5019 #Refraction index at 0.8 micrometer
n2w=1.4802 #Refraction index at 0.4 micrometer
l=0.8*(10**-6) #Vaccum wavelength at the fundamental frequency
lc=l/(4*(nw-n2w)) #Where lc is the coherance length
print "The Coherance Length is %.e meter"%(lc)