import math
# Variable initialisation
Pi=100*math.pow(10,-6) # mean optical power in watt
Po=2*math.pow(10,-6) # output mean power in watt
L=6 # length in km
L1=8 # length in km
asp=10*math.log(Pi/Po)/math.log(10) # signal attenuation in dB
as1=asp/L # signal attenuation per km
Li=as1*L1 # Loss incurred along 8 km
Ls=7 # Loss due to splice in dB
as2=Li+Ls #overall signal attenuation in dB
As2=29.4 #aprox. overall signal attenuation in dB
Pio=math.pow(10,(As2/10)) #i/p o/p power ratio
#Results
print ('%s %.2f %s' %(" The signal attenuation = ",asp,"dB"))
print ('%s %.2f %s' %("\n The signal attenuation per km = ",as1,"dB/km"))
print ('%s %.2f %s' %("\n The trgth = ",Li,"km"))
print ('%s %.2f %s' %("\n The overall signal attenuation = ",as2,"dB"))
print ('%s %.2f' %("\n The i/p o/p power ratio = ", Pio))
import math
# Variable initialisation
Pi=1.5*math.pow(10,-3) # mean optical power in watt
Po=2*math.pow(10,-6) # output mean power in watt
a=0.5 # dB/km
L=(10*math.log(Pi/Po)/math.log(10))/a # max possible link Length in km
print ('%s %.3f %s' %(" The max possible link Length = ",L,"km"))
import math
# Variable Declaration
n=1.46 # core refractive index
p=0.286 # photoelastic coeff
b=7*math.pow(10,-11) # isothermal compressibility
k=1.381*math.pow(10,-23) # boltzmann's constant
tf=1400 # fictive temperature in k
y1=0.85*math.pow(10,-6) # wavelength in m
# Calculations
yr=((8*math.pow(math.pi,3)*math.pow(n,8)*math.pow(p,2)*(b*k*tf)))/(3*math.pow(y1,4))
akm=pow(math.e,(-yr*math.pow(10,3)))
at=10*math.log(1/akm)/math.log(10)# attenuation at y=0.85 um
y2=1.55*math.pow(10,-6) # wavelength in m
yr1=((8*math.pow(math.pi,3)*math.pow(n,8)*math.pow(p,2)*(b*k*tf)))/(3*math.pow(y2,4))
akm1=math.pow(math.e,(-yr1*math.pow(10,3)))
at1=10*math.log(1/akm1)/math.log(10)# attenuation at y=1.55 um
y3=1.30*math.pow(10,-6) # wavelength in m
yr2=((8*math.pow(math.pi,3)*math.pow(n,8)*math.pow(p,2)*(b*k*tf)))/(3*math.pow(y3,4))
akm2=math.pow(math.e,(-yr2*math.pow(10,3)))
at2=10*math.log(1/akm2)/math.log(10)# attenuation at y=1.30 um
# Results
print ('%s %.2f %s' %(" The Loss of an optical fiber = ",at,"dB/km"))
print ('%s %.2f %s' %("\n The Loss of an optical fiber = ",at1,"dB/km"))
print ('%s %.2f %s' %("\n The Loss of an optical fiber = ",at2,"dB/km"))
import math
# Variable declaration
d=6 # core diameter in m
y=1.55 # wavelength in m
a=0.5 # attenuation in dB/km
v=0.4
Pb=4.4*math.pow(10,-3)*math.pow(d,2)*math.pow(y,2)*a*v # threshold power for SBS
Pr=5.9*math.pow(10,-2)*math.pow(d,2)*y*a # threshold power for SRS
# Results
print ('%s %.2f %s' %(" The threshold power for SBS = ",Pb*pow(10,3),"mw"))
print ('%s %.2f %s' %("\n The threshold power for SRS = ",Pr,"W"))
import math
# Variable declaration
n1=1.46 # core refractive index
dl=0.03 # relative refractive index difference
y=0.85*math.pow(10,-6) #operating wavelength in m
a=4*math.pow(10,-6) # core radous in m
# Calculations
n2=math.sqrt(math.pow(n1,2)-2*dl*math.pow(n1,2)) #cladding refractive index
Rc=(3*math.pow(n1,2)*y)/(4*math.pi*math.pow((math.pow(n1,2)-math.pow(n2,2)),1.5)) # critical radius of curvature for multimode fiber
Dl=0.003 # relative refractive index difference
N2=math.sqrt(math.pow(n1,2)-2*Dl*math.pow(n1,2))
yc=math.pow(2*math.pi*a*n1*(2*Dl),0.5)/2.405 # cut off wavelength in m
y1=1.55*math.pow(10,-6) # operating wavelength in m
Rcs=(20*y1*math.pow((2.748-0.996*(y1/yc)),-3))/math.pow((0.005),1.5) # critical radius of curvature for a single mode fiber
# Results
print '%s %.4f %s' %(" The critical radius of curvature for multimode fiber = ",Rc*math.pow(10,6),"um")
print '%s %.4f %s' %("\n The critical radius of curvature for a single mode fiber = ",Rcs*math.pow(10,3),"um")
print "\nThe answer is wrong in the textbook for single mode fiber"
import math
# variable declaration
x=2.0 # index profile
dl=0.0126 #index difference
a=(85.0/2.0)*math.pow(10,-6) # core radius
R=2.0*math.pow(10,-3) # curve of radius
n1=1.45 # core refractive index
k=6.28
# Calculations
y=850.0*math.pow(10,-9) # wavelength in m
A=(x+2)/(2*x*dl)
B=(2*a/R)
C=math.pow((3*y/(2*k*R*n1)),(2.0/3.0))
D=B+C
E=A*D
F=1-E
Lm=-10*math.log(-F)/math.log(10) # macrobend loss in dB
print ('%s %.2f %s' %(" The macrobend loss = ",Lm,"dB"))
print ("\n The answer is wrong in the textbook ")
import math
# Variable initialisation
Pi=15 # optical power in uw
Po=7 # ouput power in uw
L=0.15 # length in km
Ls=(10*math.log(Pi/Po)/math.log(10))/L # Loss of an optical fiber in dB
# Results
print ('%s %.2f %s' %(" The Loss of an optical fiber = ",Ls,"dB"))
import math
# Variable initialisation
Pi=200*math.pow(10,-6) # average optical power in watt
Po=5*math.pow(10,-6) # average output power in watt
L=20 # in km
L1=12 # in km
ns=5 # number of attenuation
a=0.9 # attenuation in dB
# Calculations
sa=10*math.log(Pi/Po)/math.log(10) # signal attenuation
sp=sa/L # signal attenuation per km
sn=sp*L1 # signal attenuation for 12 km
sn1=ns*a # attenuation in dB
sn2=sn+sn1 # overall signal attenuation in dB
# Results
print ('%s %.2f %s' %(" The signal attenuation per km = ",sp,"dB/km"))
print ('%s %.2f %s' %("\n The overall signal attenuation= ",sn2,"dB "))
import math
# Variable initialisation
Pi=100*math.pow(10,-6) # average optical power in watt
Po=4*math.pow(10,-6) # average output power in watt
L=6 # in km
L1=10 # in km
# Calculations
sa=10*math.log(Pi/Po)/math.log(10) # signal attenuation
sp=sa/L # signal attenuation per km
sn=sp*L1 # signal attenuation for 12 km
sn1=sn+9 # overall signal attenuation in dB
# Results
print ('%s %.2f %s' %(" The signal attenuation= ",sa,"dB"))
print ('%s %.2f %s' %("\n The signal attenuation per km = ",sp,"dB/km"))
print ('%s %.2f %s' %("\n The overall signal attenuation= ",sn1,"dB"))
import math
# variable initialisation
Pi=20*math.pow(10,-6) #average optical power in watt
Po=7.5*math.pow(10,-6) # average output power in watt
sl=10*math.log(Pi/Po)/math.log(10) # signal Loss in dB
L=15 #in km
L1=30 # in km
ns=29 # number of attenuation
sp=sl/L # signal Loss per km
sn=sp*L1 # signal attenuation for 30 km
sn1=sn+ns # overall signal attenuation in dB
i_o=math.pow(10,(sn1/20)) # input output power ratio
# Results
print ('%s %.2f %s' %(" The signal Loss = ",sl,"dB"))
print ('%s %.2f %s' %("\n The signal Loss per km= ",sp,"dB/km"))
print ('%s %.2f %s' %("\n The overall signal attenuation= ",sn1,"dB"))
print ('%s %.2f' %("\n The input output power ratio= ",i_o))
import math
# Variable initialisation
Tf=1400 # temperature in k
Bc=7*math.pow(10,-11) # in m^2/N
n=1.38
P=0.29 # Photoelastic coefficient
y=0.9*math.pow(10,-6) # wavelength in m
K=1.38*math.pow(10,-23) # boltzman's constant
# Calculations
Rrs=((8*math.pow(math.pi,3)*math.pow(n,8)*math.pow(P,2)*(Bc*Tf*K))/(3*math.pow(y,4)))
Rrs1=Rrs/math.pow(10,-3) # per km
Lkm=math.pow(math.e,(-Rrs1)) # transmission loss facter
At=10*math.log(1/Lkm)/math.log(10) # Attenuation in dB/km
# results
print ('%s %.2f %s' %(" The Attenuation= ",At,"dB/km"))
import math
# Variable initialisation
y=1.35 # wavelength in um
d=5 # core diamater in um
a=0.75 # attenuation in dB/km
v=0.45 # bandwidth in GHz
# calculations
Pb=4.4*math.pow(10,-3)*math.pow(d,2)*math.pow(y,2)*(a*v) #threshold optical power for sbs
Pr=5.9*math.pow(10,-2)*math.pow(d,2)*(y)*(a) #threshold optical power for sbr
Pbr=Pb/Pr # the ratio of threshold power level
print ('%s %.2f %s' %(" The ratio of threshold power level= ",Pbr*100,"%"))
import math
# Variable initialisation
n1=1.5 #core refractive index
y=0.85*math.pow(10,-6) # wavelength in m
dl=0.024 # relative refractive index difference
N2=math.sqrt(math.pow(n1,2)-2*dl*math.pow(n1,2)) # cladding refractive index
n2=1.46
Rcs=(3*math.pow(n1,2)*y)/((4*math.pi)*math.pow((math.pow(n1,2)-math.pow(n2,2)),1.5)) # critical radius of curvature for multimode fiber
# Results
print ('%s %.3f %s' %(" The critical radius of curvature = ",Rcs*pow(10,6),"um"))
import math
# Variable initialisation
n1=1.45 # core refractive index
y=1.5*math.pow(10,-6) # wavelength in m
dl=0.03 # relative refractive index difference
a=5.0*math.pow(10,-6) # core radius
n2=math.sqrt(math.pow(n1,2)-2*dl*math.pow(n1,2)) # cladding refractive index
yc=(2*math.pi*a*n1*math.sqrt(2*dl))/(2.405)
Rcs=(20.0*y*(2.748-0.996*math.pow((y/yc),-3)))/math.pow((math.pow(n1,2)-math.pow(n2,2)),1.5)#critical radius of curvature for single mode fiber
Rcs1=(3*math.pow(n1,2)*y)/((4*math.pi)*math.pow(math.pow(n1,2)-math.pow(n2,2),1.5)) # critical radius of curvature for multimode fiber
# Results
print ('%s %.2f %s' %(" The critical radius of curvature for single mode fiber = ",Rcs*pow(10,6),"um"))
print ("\n The answer is wrong in the textbook ")
print ('%s %.2f %s' %("\n The critical radius of curvature for multimode fiber = ",Rcs1*pow(10,6),"um"))
import math
# variable declaration
L=500.0/1000.0 # distance in km
Pio=(1/(1-0.75))
Ls=10*math.log(Pio)/math.log(10)/L # Loss in dB/km
# Results
print ('%s %.3f %s' %(" The Loss = ",Ls,"dB/km"))
import math
# Variable initialisation
L=5 # length in km
a=0.5 # attenuaion loss in dB/km
# Calculations
Po=math.pow(10,-3)*math.pow(10,(-(a*L)/10)) # power level in mW
# Results
print ('%s %.3f %s' %(" The power level = ",Po*pow(10,3),"mW"))
import math
# Variable initialisation
L=1 #distance in km
Pio=(1/(1-0.40))
# Calculations
Ls=10*math.log(Pio)/math.log(10)/L # Loss in dB/km
# Results
print ('%s %.3f %s' %(" The Loss = ",Ls,"dB/km"))
import math
# Initialisation of variables
Pi=1*math.pow(10,-3) # input power in watt
Po=0.75*math.pow(10,-3) # output power in watt
a=0.5 #in dB/km
L=(10*math.log(Pi/Po)/math.log(10))/a # transmission length in km
print ('%s %.1f %s'%(" The transmission length = ",L,"km"))
import math
# variable initialisation
y=1300.0*math.pow(10,-9) # wavelemgth in m
yc=1200.0*math.pow(10,-9) # cut off wavelength in m
rc=5.0*math.pow(10,-6) #core diameter in m
n=1.5 #refractive index
R=1.2/100.0 # curve of radius in m
# Calculations
dmf=2*rc*((0.65)+0.434*math.pow((y/yc),1.5)+0.0149*math.pow((y/yc),6)) # mode field diameter
K=(2.0*math.pi)/y
Lm=-10*math.log(-1*(1-math.pow(K,4)*math.pow(n,4)*math.pow(((3.95*math.pow(10,-6))/(8*math.pow(R,2))),6)))/math.log(10) # macrobend loss
# Results
print ('%s %.2f %s' %(" The mode field diameter = ",dmf*pow(10,6),"um"))
print ('%s %.2f %s' %("\n The macrobend loss = ",Lm,"dB"))
print ("\n The answer is wrong in the textbook")
import math
#Variable initialisation
Pi=10*math.pow(10,-3) # input power in watt
Po=8*math.pow(10,-3) # output power in watt
L=0.150 # length in km
Ls=(10*math.log(Po/Pi)/math.log(10))/L
print ('%s %.2f %s' %(" The transmission length = ",Ls,"km"))