import math
# variable declaration
n1=1.50 # core refractive index
n2=1.48 # cladding refractive index
y=1.3*math.pow(10,(-6))
m=1000 # the no. of models
# Calculations
v=math.sqrt(2*m)
a=(v*y)/(2*math.pi*(math.sqrt(pow(n1,2)-math.pow(n2,2)))*math.pow(10,6)) # core radius in micrometer
# Results
print ('%s %.2e %s' %(" core radius= ",a ,"micrometer"))
import math
# Variable declaration
n1=1.505 # core refractive index
n2=1.502 # cladding refractive index
# Calculations
n_m=math.sqrt(math.pow(n1,2)-math.pow(n2,2)) # numerical aperture
y=1.3*math.pow(10,(-6))
v=2.4
a=(v*y)/(2*math.pi*(math.sqrt(math.pow(n1,2)-math.pow(n2,2))))*math.pow(10,6)# core radius in micrometer
# Results
print ('%s %.2f'%(" numerical aperture= ",n_m))
print ('%s %.3f %s' %("\n core radius= ",a,"micrometer"))
import math
# Variable declaration
n1=1.5 # core refractive index
dl=0.01 # index difference
m=0 # for the dominant mode
v=0 # for the dominant mode
y=1.3 # in micrometer
a=5.0 # radius in micrometer
# Calculations
k=(2*math.pi)/y
b=math.pow(k,2)*math.pow(n1,2)-(2*k*n1*math.sqrt(2*dl))/a
B=math.sqrt(b) # propagation constant in rad/um
# Results
print ('%s %.3f %s' %(" propagation constant= ",B,"rad/um"))
# Printing the results
b=1/2 # propagtion constant
print (" normalised propagtion constant")
print ("\n B=(pow((b/k),2)-pow(n2,2))/(pow(n1,2)-pow(n2,2))")
print ("\n thus when b=1/2")
print ("\n B=k*sqrt(pow(n2,2)+b*(pow(n1,2)-pow(n2,2))")
print ("\n B=k*sqrt(pow(n1,2)-pow(n2,2)/2)")
print ("\n which gives its rms value")
import math
# Variable declaration
n1=3.6 #core refractive index
n2=3.3 # cladding refractive index
d=2.0 # thickness in um
y=0.8 # wavelength in um
# Calculations
m=(2*d*math.sqrt(math.pow(n1,2)-math.pow(n2,2))/y) # total no. of models allowed
M=math.ceil(m) # total no. of models allowed
print " Total no. of models allowed= ",int(M)
import math
# Initialisation of variables
n1=1.48 # core refractive index
a=40*(math.pow(10,-6)) #core radius in meter
dl=0.015 # index difference
y=0.85*(math.pow(10,-6)) # wavelength in um
# Calculations
v=(2*math.pi*a*n1*math.sqrt(2*dl))/y # normalised frequency
M=math.pow(v,2)/2
m=math.ceil(M) # the total no. of guided modes
# Results
print ('%s %.2f' %(" normalised frequency= ",v))
print "\n The total no. of guided modess = ",int(m)
import math
# Initialisation of variables
n1=1.46 # core refractive index
dl=0.015 # index difference
a=30*(math.pow(10,-6))# core radius in meter
y=0.85*(math.pow(10,-6)) #wavelength in um
# calcualtions
n2=n1-(n1*dl)# cladding refractive index
v=(2*math.pi*a*n1*math.sqrt(2*dl))/y # normalised frequency
M=math.pow(v,2)/2 # the total no. of guided modes
# Results
print ('%s %.2f' %(" Cladding refractive index= ",n2))
print ('%s %.3f'%("\n Normalised frequency= ",v))
print "\n The total no. of guided modes = ",int(M)
import math
# Initialisation of variables
n1=1.5 # core refractive index
dl=0.01 # index difference
M=1100 # the total no. of guided modes
y=1.3*(math.pow(10,-6)) # wavelength in um
v=math.sqrt(2*M)# normalised frequency
# Calculations
a=(v*y)/(2*math.pi*n1*math.sqrt(2*dl))*math.pow(10,6) #core radius in meter
# Results
print ('%s %.2f' %(" Normalised frequency= ",v))
print ('%s %.2f %s' %("\n The diameter of the fiber core = ",2*a,"um"))
import math
# Initialisation of variables
n1=1.45 # core refractive index
n_m=0.16 # numerical aperture
# Calculations
a=30*math.pow(10,-6) # core radius in micrometer
y=0.5*(math.pow(10,-6)) # wavelength in um
v=(2*math.pi*a*n_m)/y #normalised frequency
# Results
print ('%s %.2f' %(" Normalised frequency= ",v))
import math
# Initialisation of variables
n1=3.6 # core refractive index
n2=3.56 # cladding refractive index
y=0.85*(math.pow(10,-6))# wavelength in um
m=1
n=0
v_c=2.405 # for planner guide
# Calculations
a=(v_c*y)/(2*math.pi*math.sqrt(math.pow(n1,2)-math.pow(n2,2)))# core radius in micrometer
print ('%s %.2f %s' %("The max thickness= ",a*pow(10,6),"um"))
import math
# variable declaration
n1=1.5 #core refractive index
y=1.3*(math.pow(10,-6)) # wavelength in um
M=1100 # total no. of models
dl=0.01 # index difference
# Calculations
v=math.sqrt(2*M)
V=math.ceil(v)
a=(V*y)/(2*math.pi*n1*math.sqrt(2*dl))*math.pow(10,6) # core radius in micrometer
a1=math.ceil(a)# core radius in micrometer
# Results
print ('%s %.2f %s' %("The core diameter= ",2*a1,"um"))
import math
# Initialisation of variables
n1=1.45 # core refractive index
dl=0.015 # index difference
# Calculations
y=0.85*(math.pow(10,-6)) # wavelength in meter
v=2.4*math.pow((1+(2/2)),(0.5))# Max normalised frequency
a=(v*y)/(2*math.pi*n1*math.pow((2*dl),(0.5))) # Max core radius in m
d=2*a # The max core diameter in meter
# Results
print ('%s %.3f %s'%(" The max core diameter in meter= ",d*pow(10,6),"um"))
import math
# Variable Initialisation
n1=1.48 #core refractive index
n2=1.46 # cladding refractive index
a=2.5 # radius in um
y=0.85 # wavelength in um
dl=(n1-n2)/n1 # index difference
v=(2*math.pi*a*n1*math.pow((2*dl),(0.5)))/y #the normaised frequency
M=(v*v)/2 # number of modes
print " The number of modes= ",int(M)
import math
# Initialisation of variables
a=25 # radius in um
y=1.3 # wavelength in um
v=26.6 # the normaised frequency
NA=(v*y)/(2*math.pi*a) #Numerical aperture
a_c=math.pi*math.pow((NA),2)
M=(v*v)/2
# Results
print ('%s %.3f' %(" The number of modes= ", NA))
print ('%s %.3f' %("\n The number of modes= ", a_c))
print ("\n Answer in textbook is wrong")
print "\n The number of modes= ",int(M)
import math
# Declaration of variables
n1=1.49 # core refractive index
n2=1.47 # cladding refractive index
a=2 # radius in um
dl=(n1-n2)/n1 # index difference
v_c=2.405
# calculations
y_c=(2*math.pi*a*n1*math.pow((2*dl),(0.5)))/v_c # cut off wavelength in um
Y=1.31 # wavelength in um
A=(v_c*Y)/(2*math.pi*n1*math.pow((2*dl),(0.5))) # min core radius in um
# Results
print ('%s %.3f %s' %(" The cut off wavelength = ",y_c,"um"))
print ('%s %.3f %s' %("\n The min core radius = ",A,"um"))
import math
# Initialisation of variables
a=25 # radius in um
NA=0.3 # Numerical aperture
y=1 # wavelength in um
v=(2*math.pi*a*NA)/y # the normalised frequency
V=47.1 # the normalised frequency
M=(V*V)/4 # The mode volume
# Results
print ('%s %.2f' %(" The normalised frequency = ",v))
print "\n The mode volume = ",int(M),"guided modes"
import math
# variable declaration
n1=1.46 # core refractive index
a=4.5 # radius in um
dl=0.0025 # relative index difference
v_c=2.405
# calculations
y_c=(2*math.pi*a*n1*math.pow((2*dl),(0.5)))/v_c # cut off wavelength in um
print ('%s %.3f %s' %(" The cut off wavelength = ",y_c,"um"))
import math
# Initialisation of variables
n1=1.5 #core refractive index
n2=1.45 # cladding refractive index
a=50 # radius in um
y=1.3 #operating wavelength in um
# calculations
NA=math.sqrt(math.pow(n1,2)-math.pow(n2,2)) # numerical aperture
N_A=0.38
v=(2*math.pi*a*N_A)/y # cut of numbers
M=math.pow(v,2)/2 # number of modes
print ('%s %.2f'%(" The cut of numbers = ",v))
print "\n The number of modes = ",int(M)
import math
# Variable initialisation
n1=1.53 # core refractive index
n2=1.5 # cladding refractive index
y=1.5 # operating wavelength in um
# calculation
NA=math.sqrt(math.pow(n1,2)-math.pow(n2,2)) # numerical aperture
a=(2.405*y)/(2*math.pi*NA)# max radius in um
print ('%s %.2f %s' %(" The max core radius = ",a,"um"))
import math
# variable declaration
a=25 # max radius in um
y=0.8 # operating wavelength in um
NA=0.343 # numerical aperture
v=(2*math.pi*a*NA)/y # v-number
M=math.pow(v,2)/2 #number of modes
print ('%s %.6f' %(" The v-number = ",v))
print "\n The number of modes = ",int(M)
import math
# Initialisation of variables
n1=1.5 #core refractive index
NA=0.38 # numerical aperture
v=75 # v-number
y=1.3 # operating wavelength in um
a=(v*y)/(2*math.pi*NA) # core radius in um
n2=math.sqrt(math.pow(n1,2)-math.pow(NA,2))# cladding refractive index
# Results
print ('%s %.2f %s' %(" The core radius = ",a,"um"))
print ('%s %.2f' %("\n The cladding refractive index = ", n2))
print ("\n answer in textbook is wrong ")
import math
#Initialisation of variables
y=1.2 # operating wavelength in um
w=5 # spot size in um
x=(2*y)/(math.pi*w) # the divergence angle in degree
# results
print ('%s %.3f %s' %(" The divergence angle = ",x,"degree"))
import math
# Initialisation of variables
n1=1.46 # core refractive index
a=4.5 # core radius in um
dl=0.0025 # relative index difference
NA=n1*(math.sqrt(2*dl)) # numerical aperture
v=2.405
y=(2*math.pi*a*NA)/(v) # cut off wavelength in um
print ('%s %.3f %s' %(" The cut off wavelength = ",y,"um"))
import math
# variable declaration
n1=1.5 # core refractive index
n2=1.47 # cladding refractive index
y1=0.87 # operating wavelength in um
y2=1.5 # operating wavelength in um
a=25.0 # max radius in um
# Calculations
NA=math.sqrt(math.pow(n1,2)-math.pow(n2,2)) # numerical aperture
v1=(2*math.pi*a*NA)/y1
v2=(2*math.pi*a*NA)/y2
al=2.0 # parabolic index profile for GRIN
M1=(al/(al+2))*(math.pow(v1,2)/2)# number of modes
M2=(al/(al+2))*(math.pow(v2,2)/2)# number of modes
# Results
print " The number of modes at 870 nm = ",int(M1),"um"
print "\n The number of modes = ",int(M2),"um"
import math
# Initialisation of variables
n1=1.5 # core refractive index
n2=1.46 # cladding refractive index
v=2.4 # cut off parameter
y=0.85 # operating wavelength in um
# Calculations
NA=math.sqrt(math.pow(n1,2)-math.pow(n2,2)) # numerical aperture
a=(v*y)/(2*math.pi*NA)# max radius in um
w=v*a # spot size
x=(2*y)/(3.4*w) # divergence angle in degree
d=50 # distance in meter
w_s=(y*d)/(math.pi*w) # spot size at 50 meter
# Results
print ('%s %.2f %s' %(" The numerical aperture = ",NA,"um"))
print ('%s %.2f %s' %("\n The max core radius = ",a,"um"))
print ('%s %.2f %s' %("\n The spot size = ",w,"um"))
print ('%s %.3f %s' %("\n The divergence angle = ",x,"degree"))
print ('%s %.2f %s' %("\n The spot size at 50 meter = ",w_s,"m"))
import math
# Initialisation of variables
n1=1.53 # core refractive index
n2=1.50 # cladding refractive index
y=1.2 # wavelength in um
v=2.405
a=(v*y)/(2*math.pi*(math.sqrt(math.pow(n1,2)-math.pow(n2,2)))) #core radius in micrometer
print ('%s %.3f %s' %(" The max diameter= ",2*a,"um"))
import math
# Initialisation of variables
n1=1.47 # core refractive index
n2=1.46 # cladding refractive index
y=1.3 # wavelength in um
dl=(n1-n2)/n1 # fractional refractive index diff
# calculations
NA=math.sqrt(math.pow(n1,2)-math.pow(n2,2))
v=2.405
a=(v*y)/(2*math.pi*(math.sqrt(math.pow(n1,2)-math.pow(n2,2))))# largest core radius in micrometer
n_eff=n1-(NA/(2*math.pi*(a/y))) # fractional refractive index
# Results
print ('%s %.2f %s' %(" The largest core radius = ",a,"um"))
print ('%s %.2f' %("\n The fractional refractive index= ",n_eff))
import math
# initialisation of variables
n1=1.50 # core refractive index
n2=1.48 # cladding refractive index
NA=math.sqrt(math.pow(n1,2)-math.pow(n2,2)) # numerical aperture
a=25 # core radius in um
y=0.85 # wavelength in um
v=(2*math.pi*a*NA)/y #cut off parameter
M=math.pow(v,2)/2 # number of modes
# Results
print ('%s %.3f' %(" The cut off parameter = ",v))
print "\n The number of modes = ",int(M)
import math
# initialisation of variables
n1=1.50 # core refractive index
a=25 # core radius in um
y=1.5 # wavelength in um
v=2.405
# Calculations
NA=(v*y)/(2*math.pi*a) # numerical aperture
D=math.pow((NA/n1),2)/(2) # max value of D
n2=n1-(D*n1) # cladding refractive index
# Results
print ('%s %.6f' %(" The max value of D = ",D))
print ('%s %.2f' %("\n The cladding refractive index = ",n2))
import math
# variable declaration
n1=1.52 #core refractive index
n2=1.48 #cladding refractive index
a=45 # core radius in um
y=0.85 # wavelength in um
# Calculations
dl=(n1-n2)/n1 # relative refractive index
x=(math.asin(n2/n1))*(180/math.pi) # critical angle in degree
NA=math.sqrt(math.pow(n1,2)-math.pow(n2,2)) #numerical aperture
a_c=(math.asin(NA))*(180/math.pi) #acceptance angle in degree
a_s=math.pi*(math.pow(n1,2)-math.pow(n2,2))# solid acceptance angle
v=(2*math.pi*a*0.34)/y # normalise v-number
M=math.pow(v,2)/2 # number of guided modes
a1=5 # for single mode step fiber
v1=(2*math.pi*a1*0.34)/y
M1=math.pow(v1,2)/2
R=int(M)-int(M1)# reduction in modes
# Results
print ('%s %.4f' %(" The max value of D = ",dl))
print ('%s %.2f %s' %("\n The critical angle = ",x,"degree"))
print ('%s %.2f %s' %("\n The acceptance angle = ",2*a_c,"degree"))
print ('%s %.2f %s' %("\n The solid acceptance angle = ",a_s,"degree"))
print ('%s %.2f ' %("\n The numerical aperture = ",NA))
print ('%s %.2f ' %("\n The normalise v-number = ",v))
print "\n The number of guided modes = ",int(M)
print "\n The reduction in modes = ",R
import math
# Initialisation of variables
n1=1.46 #core refractive index
a=45/2 #max radius in um
y=0.85 # operating wavelength in um
NA=0.17 # numerical aperture
v=(2*math.pi*a*NA)/y #normalised frequency
M=math.pow(v,2)/2 # number of modes
# Results
print ('%s %.2f' %(" The normalised frequency = ",v))
print "\n The number of modes = ",int(M)