from __future__ import division
from math import pi, sqrt
#normalised frequency,propagation constants and phase velocity
print "part (a)"
n1=1.46#core refrative index
di=7.2#core diameter
n=1.46#core refrative index
d=1#relative differnce
h=1.55 # in micro meter
v=((2*pi*(di*10**-6)/2)*n*sqrt(2*(d/100)))/(h*10**-6)#normalised frequency parameter
print "normalised frequency parameter = %0.2f"%v
print "part (b)"
b1=(2*pi*n1)/(h*10**-6)# in m**-1
n2=n1-(d/100)#cladding refrative index
b2=(2*pi*n2)/(h*10**-6)# in m**-1
bo1=0.82#
b11=0.18#
B01=(b2**2+(bo1*(b1**2-b2**2)))**(1/2)#
B11=(b2**2+(b11*(b1**2-b2**2)))**(1/2)#
print "propogation constants are Bo1 = %0.3e"%(B01)," and B11 = %0.3e"%(B11)
#propogation constants are calculated wrong in the text bOOK
print "part (c)"
c=3*10**8# in ms**-1
vp1=(2*pi*c)/(h*10**-6*B01)#IN MS**-1
vp2=(2*pi*c)/(h*10**-6*B11)#IN MS**-1
print "phase velocity are (Vp)01 = %0.2e "%(vp1)," ms**-1 and (Vp)11 = %0.2e"%(vp2)," ms**-1 "
#frational power
p01=0.11#from the graph
p11=0.347#from the graph
print "power for LP01 mode is = %0.f %%"%(p01*100)
print "power for LP11 mode is = %0.f %%" %(p11*100)
from math import sqrt,pi
#Number of the modes
h= 0.85# Wavelenght in micrometers
a= 50# Core radius in micrometers
NA=0.17#
v1=(2*pi*a*NA)/h#
m2= round((v1**2)/2)#
print "Number of modes : %d"%m2
from __future__ import division
from math import sqrt,pi
#core diameter
d=0.02#difference
n1=1.5#core refrative index
m=1000# number of modes
h= 1.3# Wavelenght in micrometers
a=((h/(pi*n1))*(m/d)**(1/2))#core diamter in micro meter
print "core diameter = %0.f micro meter"%a
from __future__ import division
#core diameter
d=0.02#difference
a1=75#in micro meter
n1=1.45#core refrative index
m=700# number of modes
v=sqrt(4*m)#
h=((2*pi*(a1/2)*n1*sqrt(2*(d/100)))/v)#in micro meter
vc=2.405*sqrt(2)#for single mode fiber
a=((vc*h)/(pi*n1*sqrt(2*(d/100))))#core diamter in micro meter
print "maximum core diameter = %0.2f micro meter"%a