from __future__ import division
from math import sqrt
#Given data :
lamda=1.5 #im um
deltaTwg=0.5 #in ns
deltaTmat=2.8 #in ns
Tt=2.5 #in ns
#For single mode fibre, deltaTmod=0 #in ns
deltaTmod=0 #in ns
deltaTtotal=sqrt(deltaTmod**2+deltaTmat**2+deltaTwg**2) #in ns
Tr=sqrt(Tt**2+deltaTtotal**2) #in ns
B=1/(2*Tr*10**-9) #in bits/sec
print "Maximum allowed bit rate for the fibre = %0.2f Mbits/sec " %(B*10**-6)
#Note : Answer in the book s not accurate.
#Given data :
n1=1.55 #unitless
n2=1.50 #unitless
l=15 #in Km
delta=(n1-n2)/n1 #unitless
c=3*10**8 #in m/s
deltaT=n1*delta/c #in s/m
deltaT=(n1*delta*1000/c) #in s/Km
print "Intermodal dispersion per Km of length = %0.2f ns/Km" %(deltaT*10**9)
deltaTtotal=deltaT*l*1000 #in ns
print "Total intermodal dispersion = %0.2f micro second " %(deltaTtotal*1000)
#Note : Answer in the book is not accurate.
#Given data :
#Formula Pulse Broadning per Km : deltaTmat(per Km)=(deltaTAUs*1000/c)*(lamda*d2n/dlamda**2)
deltaTAUs=45 #in nm
deltaTAUs=45*10**-9 #in m
lamda=0.9 #in um
lamda=0.9*10**-6 #in m
#let say, d**2n/dlamda**2=a
a=4*10**-2 #in um**-2
a=a*(10**-6)**-2 #in m**-2
c=3*10**8 #in m/s
deltaTmat_Km=(deltaTAUs*1000/c)*(lamda*a) #in sec/Km
print "Pulse broadning per Km = %0.2f ns/km " %(deltaTmat_Km*10**9)
#Given data :
n1=1.55 #unitless
n2=1.50 #unitless
l=15 #in Km
delta=(n1-n2)/n1 #unitless
c=3*10**8 #in m/s
#Formula Intermodal_dispersion/m : deltaT_perKm=n1*delta**2/(8*c)
#Formula Intermodal_dispersion/Km : deltaT_perKm=n1*delta**2*1000/(8*c)
deltaT_perKm=n1*delta**2*1000/(8*c) #in sec/km
deltaT_perKm=deltaT_perKm*10**9#in nanosec/km
print "Total intermodal dispersion per Km = %0.3f ns/km" %(deltaT_perKm)
deltaTtotal=deltaT_perKm*l #in ns
print "Total intermodal dispersion for 15 Km length = %0.2f nano second" %(deltaTtotal)
#Note : Answer in the book is not accurate.
#Given data :
Tr=6 #in ns/Km
BitRate=10 #in Mbps
#part (a)
BDP=1/(2*Tr*10**-9) #in bps-Km
BDP=BDP/10**6 #in Mbps-Km
print "(a) Bandwidth Distance Product for the fibre = %0.2f Mbps-Km " %BDP
#Part (b)
lmax=BDP/BitRate #in Km
print "(b) Dispersion limited length of the fibre = %0.2f km" %lmax
#Given data :
Tr=0.2 #in us
l=20 #in Km
#part (a)
B=1/(2*Tr*10**-6) #in Hz
B=B/10**6 #in MHz
print "(a) Maximum possible assuming no intersymbol interference = %0.1f MHz " %B
#Part (b)
Dispersion=Tr*10**-6/l #in sec/Km
print "(b) Dispersion = %0.f ns/Km " %(Dispersion*10**9)
#part (c)
BDP=B*l #in MHz-Km
print "(c) Bandwidth Distance product for the fibre = %0.f MHz-Km " %BDP
#Given data :
deltaTau_s=2 #in nm
L=30 #in Km
Dmat=20 #in ps/nm-km
#formula : deltaT_mat=deltaTau_s*L*[(lamda/c)*(d**2*n/d*lamda**2)]
#formula : deltaT_mat=deltaTau_s*L*Dmat
deltaT_mat=deltaTau_s*L*Dmat #in ps
deltaT_mat=deltaT_mat*10**-3 #in ns
print "Pulse broadning due to material dispersion = %0.2f ns " %deltaT_mat
#Given data :
FibreLoss=20 #in dB
#Pat (a)
lamda_a=1.3 #/in um
loss_a=1.5 #in dB/Km
#Repeater spacing
la=FibreLoss/loss_a #in Km
print "(a) At wavelength of 1.3 micro meter, repeter spacing = %0.1f Km " %la
#Pat (b)
lamda_b=1.5 #/in um
loss_b=0.5 #in dB/Km
#Repeater spacing
lb=FibreLoss/loss_b #in Km
print "(b) At wavelength of 1.5 micro meter, repeter spacing = %0.f Km " %lb
#Given data :
Dmat=0.15 #in ns/nm-km
lamda=0.9 #in um
deltaTau_s=1.5 #in nm
#part (a)
#formula : deltaTmat/L=deltaTau_s*Dmat
deltaTmatBYL=deltaTau_s*Dmat #in ns/Km
print "(a) Pulse dispersion per unit length of fibre is",deltaTmatBYL,"ns/Km"
#part (b)
L=15 #in Km
#formula : deltaTmat=deltaTau_s*Dmat*L
deltaTmat=deltaTau_s*Dmat*L #in ns
print "(b) Material dispersion per in a 15 Km length of fibre is",deltaTmat,"ns"
#Given data :
#Let Material Dispersion, lamda**2*(d**2n/dlamda**2)=a
a=0.03 #in ns
deltaTau_s=15 #in nm
lamda=1.3 #in um
lamda=1.3*10**3 #in nm
c=3*10**8 #speed of light in m/s
c=3*10**5 #speed of light in Km/s
#Part (a)
Dmat=a/(lamda*c) #sec/nm-Km
Dmat=Dmat*10**12 #ps/nm-Km
print "(a) Material dispersion coefficient at a wavelength of 1.3 micro meter is",round(Dmat,1),"ps/nm-Km"
#Part (b)
deltaTmat_perKm=deltaTau_s*Dmat #in ps/km
print "(b) Rms pulse broadning per Km due to material dispersion is",round(deltaTmat_perKm*10**-3,2),"ns/km"
#Note : Ans is not accurate in the book.
#Given data :
l=6 #in Km
n1=1.5 #unitless
delta=1#in %
c=3*10**8 #speed of light in m/s
#Part (a)
deltaT=l*10**3*n1*(delta/100)/c #in sec
deltaT=deltaT*10**9 #in ns
print "(a) Delay difference between the slowest and fastest modes at output = %0.f ns" %deltaT
#Part (b)
B=1/(2*deltaT*10**-9) #in bps
B=B*10**-6 #in Mbps
print "(b) Assuming no intersymbol interference, maximum bit rate = %0.2f Mbps" %B
from math import pi
#Given data :
lamda=1.3 #in um
lamda=1.3*10**-6 #in m
n1=1.5 #unitless
delta=3#in %
c=3*10**8 #speed of light in m/s
n2=n1*(1-delta/100) #unitless
Rcm=3*n1**2*lamda/(4*pi*(n1**2-n2**2)**(3/2)) #in meter
Rcm=Rcm*10**6 #in um
print "Critical radius of curvature = %0.1f micro meter " %Rcm
#Given data :
d=8 #in um
a=d/2 #in um
a=a*10**-6 #in meter
n1=1.5 #unitless
n2=1.46 #unitless
lamda=1.55 #in um
lamda=1.55*10**-6 #in meter
c=3*10**8 #speed of light in m/s
lamda_c=(2*pi*a*sqrt(n1**2-n2**2))/2.405 #in meter
Rcs=(20*lamda/(n1-n2)**(3/2))*((2.748*lamda_c-0.996*lamda)/lamda_c)**-3 #in meter
Rcs=Rcs*10**3 #in mm
print "Critical radius of curvature = %0.2f mm" %Rcs
#Note : Answer in the book is wrong.
#Given data :
n1=1.49 #unitless
Rcs=10.4 #in mm
Rcs=Rcs*10**-3 #in meter
lamda=1.3 #in um
lamda=1.3*10**-6 #in meter
c=3*10**8 #speed of light in m/s
lamda_c=1.15 #in um
lamda_c=lamda_c*10**-6 #in meter
#part (a) :
#formula : (n1-n2)**(3/2)=(20*lamda/Rcs)*[(2.748*lamda_c-0.996*lamda)/lamda_c]**-3
n2=n1-(20*lamda/Rcs)**(2/3)*((2.748*lamda_c-0.996*lamda)/lamda_c)**(-3*2/3) #unitless
print "(a) Refractive index of cladding = %0.3f " %n2
#Part (b) :
delta=(n1-n2)/n1 #unitless
print "(b) Relative refractive index diference = %0.2f %% "%(delta*100)
#Given data :
n1=1.46 #unitless
n2=1.45 #unitless
Rcm=84 #in um
Rcm=Rcm*10**-6 #in meter
lamda=Rcm*4*pi*(n1**2-n2**2)**(3/2)/(3*n1**2) #in meter
print "Wavelength of transmitted light = %0.3f micro meter " %(lamda*10**6)