#importing modules
import math
from __future__ import division
#Variable declaration
n1=1.54; #Core refractive index
n2=1.50; #Cladding refractive index
#Calculation
NA=math.sqrt(n1**2-n2**2); #numerical aperture
alpha_m=math.asin(NA); #acceptance angle(radian)
alpha_m=alpha_m*180/math.pi; #acceptance angle(degrees)
#Result
print "acceptance angle is",round(alpha_m,2),"degrees"
print "answer in the book varies due to rounding off errors"
#importing modules
import math
from __future__ import division
#Variable declaration
n1=1.5; #Core refractive index
n2=1.45; #Cladding refractive index
#Calculation
delta=(n1-n2)/n1; #fractional index change
NA=n1*math.sqrt(2*delta); #numerical aperture
alpha_m=math.asin(NA); #acceptance angle(radian)
alpha_m=alpha_m*180/math.pi; #acceptance angle(degrees)
thetac=math.asin(n2/n1)*180/math.pi; #critical angle(degrees)
#Result
print "numerical aperture is",round(NA,3)
print "acceptance angle is",round(alpha_m,1),"degrees"
print "critical angle is",int(thetac),"degrees"
#importing modules
import math
from __future__ import division
#Variable declaration
n1=1.53; #Core refractive index
p=2.5; #percentage(%)
#Calculation
n2=n1*(100-p)/100; #Cladding refractive index
thetac=math.asin(n2/n1)*180/math.pi; #critical angle(degrees)
#Result
print "critical angle is",round(thetac,2),"degrees"
#importing modules
import math
from __future__ import division
#Variable declaration
delta=0.018; #fractional difference
n1=1.50; #Core refractive index
#Calculation
NA=round(n1*math.sqrt(2*delta),2); #numerical aperture
alpha_m=math.asin(NA); #acceptance angle(radian)
alpha_m=alpha_m*180/math.pi; #acceptance angle(degrees)
n2=n1-(delta*n1); #Cladding refractive index
thetac=math.asin(n2/n1)*180/math.pi; #critical angle(degrees)
#Result
print "numerical aperture is",NA
print "acceptance angle is",round(alpha_m,2),"degrees"
print "critical angle is",round(thetac,1),"degrees"
#importing modules
import math
from __future__ import division
#Variable declaration
d=50*10**-6; #diameter(m)
lamda=1*10**-6; #wavelength(m)
NA=0.2; #numerical aperture
#Calculation
NSI=4.9*(d*NA/lamda)**2; #total number of guided modes
NGI=NSI/2; #number of modes of graded index fibre
#Result
print "total number of guided modes is",NSI
print "number of modes of graded index fibre is",NGI
#importing modules
import math
from __future__ import division
#Variable declaration
delta=0.05; #fractional difference
n1=1.5; #Core refractive index
#Calculation
NA=n1*math.sqrt(2*delta); #numerical aperture
#Result
print "numerical aperture is",round(NA,2)
#importing modules
import math
from __future__ import division
#Variable declaration
d=5*10**-6; #diameter(m)
lamda=1*10**-6; #wavelength(m)
NA=0.092; #numerical aperture
#Calculation
N=4.9*(d*NA/lamda)**2; #number of modes that can be propagated
#Result
print "number of modes that can be propagated is",int(N)
#importing modules
import math
from __future__ import division
#Variable declaration
n1=1.53; #Core refractive index
n2=1.50; #Cladding refractive index
a=50*10**-6; #radius(m)
lamda=1*10**-6; #wavelength(m)
#Calculation
NA=math.sqrt(n1**2-n2**2); #numerical aperture
Vn=2*math.pi*a*NA/lamda; #V number
N=Vn**2/2; #maximum number of modes
#Result
print "V number is",round(Vn,1)
print "maximum number of modes is",round(N,1)
print "answer in the book varies due to rounding off errors"
#importing modules
import math
from __future__ import division
#Variable declaration
a=100*10**-6; #radius(m)
lamda=0.85*10**-6; #wavelength(m)
NA=0.3; #numerical aperture
#Calculation
N=4*math.pi**2*a**2*NA**2/lamda**2; #number of propagating modes
#Result
print "number of propagating modes is",int(N)
print "answer in the book is wrong"
#importing modules
import math
from __future__ import division
#Variable declaration
NA=0.2; #numerical aperture
n2=1.59; #Cladding refractive index
n0=1.33; #refractive index
#Calculation
n1=round(math.sqrt(NA**2+n2**2),4); #Core refractive index
NA1=math.sqrt(n1**2-n2**2)/n0; #numerical aperture
alpha_m=math.asin(NA1); #acceptance angle(radian)
alpha_m=alpha_m*180/math.pi; #acceptance angle(degrees)
#Result
print "Core refractive index is",n1
print "acceptance angle is",round(alpha_m,3),"degrees"
#importing modules
import math
from __future__ import division
#Variable declaration
c=3*10**8; #velocity of light(m/sec)
h=6.63*10**-34; #plank's constant(Js)
lamda=680*10**-9; #wavelength(m)
P=4*10**-3; #power(W)
#Calculation
delta_E=c*h/lamda; #energy(J)
N=P/delta_E; #number of photons
#Result
print "number of photons is",round(N/10**15,3),"*10**15"
#importing modules
import math
from __future__ import division
#Variable declaration
delta=0.0005; #fractional difference
n1=1.5; #Core refractive index
#Calculation
n2=n1-(delta*n1); #Cladding refractive index
NA=n1*math.sqrt(2*delta); #numerical aperture
thetac=math.asin(n2/n1)*180/math.pi; #critical angle(degrees)
#Result
print "Cladding refractive index is",n2
print "numerical aperture is",round(NA,4)
print "critical angle is",round(thetac,1),"degrees"
#importing modules
import math
from __future__ import division
#Variable declaration
alpha=2.2; #attenuation coefficient(dB/km)
L1=2; #distance(km)
L2=6; #distance(km)
#Calculation
x1=-alpha*L1/10;
x2=-alpha*L2/10;
P1=10**x1; #fraction of initial intensity after 2km
P2=10**x2; #fraction of initial intensity after 5km
#Result
print "fraction of initial intensity after 2km is",round(P1,3)
print "fraction of initial intensity after 5km is",round(P2,3)
#importing modules
import math
from __future__ import division
#Variable declaration
L=0.5; #distance(km)
Pout=1; #output power(W)
Pin=85/100; #input power(W)
#Calculation
alpha=10*math.log10(Pout/Pin)/L; #attenuation coefficient(dB/km)
#Result
print "attenuation coefficient is",round(alpha,2),"dB/km"
#importing modules
import math
from __future__ import division
#Variable declaration
L=10; #distance(km)
Pout=2; #output power(W)
Pin=100; #input power(W)
#Calculation
alpha=10*math.log10(Pin/Pout)/L; #attenuation coefficient(dB/km)
o_alpha=round(alpha,1)*L; #overall signal attenuation
#Result
print "attenuation coefficient is",round(alpha,1),"dB/km"
print "overall signal attenuation is",int(o_alpha),"dB"