import math
#Variable declaration
h=1.3*10**-6 #wavlength
d=25*10**-6 #distance between the electrodes
n1=2.1 #refractive index
r=30.8*10**-12 #electro-optic coefficient
l=2*10**-2 #length
#Calculation
V=(h*d)/(n1**3*r*l) #voltage
#Result
print'Voltage = %.1f V'%V
import math
#Variable declaration
n1=3.1 #refractive index
thet=1 #angle in degree
h=1.52*10**-6 #wavelength
l=10**-2 #length
#Calculation
ne=n1*math.sin(2*thet*math.pi/180) #effective refractive index
D=h/(2*ne) #Corrugation period
s=D*h/l #filter bandwidth
#Result
print'Corrugation period = %.1f um'%(D*10**6)
print'Filter 3 dB bandwidth = %.1f Å '%(s*10**10)
import math
#Variable declaration
n1=8 #no of bands
N1=0 #no of channels between any two bands
N2=1 #no of channels between any two bands
N3=2 #no of channels between any two bands
M=4 #no of channels in each band
#Calculation
Cs1=(n1-1)*N1 #total number of channels skipped
Ct1=(n1*M)+Cs1 #total number of channels for 4 skip-0 scheme
Cs2=(n1-1)*N2 #total number of channels skipped
Ct2=(n1*M)+Cs2 #total number of channels for 4 skip-1 scheme
Cs3=(n1-1)*N3 #total number of channels skipped
Ct3=(n1*M)+Cs3 #total number of channels for 4 skip-2 scheme
#Result
print'Total number ofchannels required for each interleaver band filter'
print'(i) 4-skip-0:'
print' Ctotal = %d'%Ct1
print'(ii) 4-skip-1:'
print' Ctotal = %d'%Ct2
print'(iii) 4-skip-2:'
print' Ctotal = %d'%Ct3