import math
from __future__ import division
#initialisation of variables
ncore=1.46; #refractive index of core
nclad=1; #refractive index of cladding
c=3e5; #velocity of light in Km/s
L=1; #length of path in Km
#CALCULATIONS
NA=math.sqrt(ncore**2-nclad**2); #Numerical aperture
delt_tau_by_L=(NA**2)/(2*c*ncore); #multipath pulse broadening in s/Km
delt_tau=delt_tau_by_L*L; #bandwidth distance product Hz
BL=(1/delt_tau)*L; #bandwidth distance product Hz
#case-2
ncore1=1.465; #refractive index of core
nclad1=1.45; #refractive index of cladding
NA1=math.sqrt(ncore1**2-nclad1**2); #Numerical aperture
delt_tau_by_L1=(NA1**2)/(2*c*ncore1); #multipath pulse broadening in s/m
BL1=(1/delt_tau_by_L1)*L; #bandwidth distance product Hz
#RESULTS
print"Numerical aperture=",round(NA,5); #The answers vary due to round off error
print"\nMultipath pulse broadening=",round(delt_tau_by_L*1e9,5),"ns/Km"; #The answer provided in the textbook is wrong//multiplication by 1e9 to convert s/Km to ns/Km
print"\nBandwidth distance product=",round(BL*1e-6,5),"GHz "; #The answer provided in the textbook is wrong//multiplication by 1e-6 to convert Hz to MHz
print"\n\nNumerical aperture=",round(NA1,5);
print"\nMultipath pulse broadening=",round(delt_tau_by_L1*1e9,5),"ns/Km"; #The answer provided in the textbook is wrong//multiplication by 1e9 to convert s/Km to ns/Km
print"\nBandwidth distance product=",round(BL1*1e-9,5),"GHz "; #The answer provided in the textbook is wrong//multiplication by 1e-6 to convert Hz to GHz
import math
from __future__ import division
#initialisation of variables
lamda1=0.7; #wavelength in um
lamda2=1.3; #wavelength in um
lamda3=2; #wavelength in um
#CALCULATIONS
f_lambda1=(303.33*(lamda1**-1)-233.33); #equation for lambda1
f_lambda2=(303.33*(lamda2**-1)-233.33); #equation for lambda2
f_lambda3=(303.33*(lamda3**-1)-233.33); #equation for lambda3
#RESULTS
print"Material dispersion at Lambda 0.7um=",round(f_lambda1,5);
print"\nMaterial dispersion at Lambda 1.3um=",round(f_lambda2,5); #The answers vary due to round off error
print"\nMaterial dispersion at Lambda 2um=",round(f_lambda3,5); #The answers vary due to round off error
print"\nIts is a standard silica fiber";
import math
from __future__ import division
#initialisation of variables
ncore=1.505; #refractive index of core
nclad=1.502; #refractive index of cladding
V=2.4; #v no. for single mode
lambda1=1300e-9; #operating wavelength in m
#CALCULATIONS
NA=math.sqrt(ncore**2-nclad**2); #numerical aperture
a=V*(lambda1)/(2*3.14*NA); #dimension of fiber core in m
#RESULTS
print"The numarical aperture =",round(NA,5);
print"\n Dimension of fiber core =",round(a*1e6,5),"um"; #multiplication by 1e6 to convert unit from m to um
import math
from __future__ import division
#initialisation of variables
V=2; #v no. for single mode
a=4; #radius of fiber in um
#CALCULATIONS
w=a*(0.65+1.619*V**(-3/2)+2.87*V**-6); #effective mode radius in um
#RESULTS
print"Effective mode radius =",round(w,5),"um";
import math
from __future__ import division
#initialisation of variables
m=0; #for dominant mode
v=0; #for dominant mode
n1=1.5; #refractive index of core
delta=0.01; #core clad index difference
a=5; #fiber radius in um
lambda1=1.3; #wavelength of operation in um
#CALCULATIONS
k0=(2*3.14/lambda1); #constant in /m
beta=math.sqrt((k0**2)*(n1**2)-(2*k0*n1*math.sqrt(2*delta)/a)); #propagation constant in rad/um
#RESULTS
print"Propagation constant=",round(beta,5),"rad/um"; #The answers vary due to round off error
import math
from __future__ import division
#initialisation of variables
M=1000; #modes supported
lambda1=1.3; #operating wavelength in um
n1=1.5; #refractive index of core
n2=1.48; #refractive index of cladding
#CALCULATIONS
V=math.sqrt(2*M); #normalised frequency V no.
NA=math.sqrt(n1**2-n2**2); #numerical apperture
R=lambda1*V/(2*3.14*NA); #radius of fiber in um
#RESULTS
print"Core Radius=",round(R,5),"um"; #The answer provided in the textbook is wrong
import math
from __future__ import division
#initialisation of variables
lambda1=1.3; #wavelength of operation in um
n1=1.5; #refractive index of core
n2=1.48; #refractive index of cladding
k0=2*3.14/lambda1; #constant in /m
#CALCULATIONS
#case-1
b=0.5; #normalized propagation constant
k0=2*3.14/lambda1; #constant
beta=k0*math.sqrt(n2**2+b*(n1**2-n2**2)); #propagation constant
#case-2
#given
lambda1=1.3; #wavelength of operation in um
n1=1.5; #refractive index of core
n2=1.48; #refractive index of cladding
k0=2*3.14/lambda1; #constant in /m
b=0.5; #normalized propagation constant
k0=2*3.14/lambda1; #constant
b1=(((n1+n2)/2)**2-n2**2)/(n1**2-n2**2); #normalized propagation constant
#case-3
#given
lambda1=1.3; #wavelength of operation in um
n1=1.5; #refractive index of core
n21=1.0; #refractive index of cladding
k0=2*3.14/lambda1; #constant in /m
b=0.5; #normalized propagation constant
k0=2*3.14/lambda1; #constant
beta1=k0*math.sqrt(n21**2+b*(n1**2-n21**2)); #propagation constant
#RESULTS
print"Propagation constant=",round(beta,5),"rad/um"; #The answers vary due to round off error
print"\nPropagation constant=",round(b1,5); #The answers vary due to round off error
print"\nPropagation constant=",round(beta1,5),"rad/um"; #The answers vary due to round off error
import math
from __future__ import division
#initialisation of variables
#case-1
n1=1.49; #refractive index of core
n2=1.46; #refractive index of cladding
c=3*10**5; #speed of light in Km/s
t1=n1/c; #time delay for one traveling along axis in s/Km
t2=(n1**2/n2)/c; #time delay for one traveling along path that is totally reflecting at the first interface in s/km
#case-2
n11=1.47; #refractive index of core
n21=1.46; #refractive index of cladding
c1=3*10**5; #speed of light in Km/s
t11=n11/c1; #time delay for one traveling along axis in
t22=(n11**2/n21)/c1; #time delay for one traveling along path that is totally reflecting at the first interface
print"time delay for traveling along axis =",round(t1*1e6,5),"us/Km"; #multiplication by 1e6 to convert the unit from s/Km to us/Km
print"\ntime delay for traveling along path that is totally reflecting at the first interface =",round(t2*1e6,5),"us/Km"; #multiplication by 1e6 to convert the unit from s/Km to us/Km
print"\ntime delay for traveling along axis =",round(t11*1e6,5),"us/Km"; #multiplication by 1e6 to convert the unit from s/Km to us/Km
print"\ntime delay for traveling along path that is totally reflecting at the first interface =",round(t22*1e6,5),"us/Km"; #multiplication by 1e6 to convert the unit from s/Km to us/Km
#The answer provided in the textbook is wrong it has got wrong unit