#importing modules
import math
from __future__ import division
#Variable declaration
n1=1.50; #Core refractive index
n2=1.47; #Cladding refractive index
#Calculation
phic=math.asin(n2/n1); #critical angle(radian)
phic=phic*180/math.pi; #critical angle(degrees)
NA=math.sqrt(n1**2-n2**2); #numerical aperture
phimax=math.asin(NA); #acceptance angle(radian)
phimax=math.asin(NA)*180/math.pi; #acceptance angle(degrees)
#Result
print "critical angle is",round(phic,1),"degrees"
print "numerical aperture is",round(NA,1)
print "acceptance angle is",round(phimax,1),"degrees"
#importing modules
import math
from __future__ import division
#Variable declaration
n1=1.46; #Core refractive index
delta=0.05; #relative refractive index difference
#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
NA=0.3; #numerical aperture
gama=45*math.pi/180; #angle(radian)
#Calculation
thetaa1=math.asin(NA); #acceptance angle for meridional rays(radian)
thetaa1=thetaa1*180/math.pi; #acceptance angle for meridional rays(degrees)
thetaa2=math.asin(NA/math.cos(gama))*180/math.pi; #acceptance angle for skew rays(degrees)
#Result
print "acceptance angle for meridional rays is",round(thetaa1,2),"degrees"
print "acceptance angle for skew rays is",round(thetaa2,3),"degrees"
print "answer for acceptance angle for skew rays given in the textbook varies due to rounding off errors"
#importing modules
import math
from __future__ import division
#Variable declaration
n1=1.53; #Core refractive index
delta=0.0196; #relative refractive index difference
#Calculation
NA=n1*math.sqrt(2*delta); #numerical aperture
thetaa=math.asin(NA)*180/math.pi; #acceptance angle(degrees)
#Result
print "numerical aperture is",round(NA,3)
print "acceptance angle is",round(thetaa,3),"degrees"
print "answer for acceptance angle given in the textbook varies due to rounding off errors"
#importing modules
import math
from __future__ import division
#Variable declaration
n1=1.5; #Core refractive index
n2=1.49; #Cladding refractive index
a=25*10**-6; #radius of core(m)
L=1; #distance(m)
#Calculation
phic=round(math.asin(n2/n1)*180/math.pi,2); #critical angle(degrees)
phicr=phic*math.pi/180; #critical angle(radian)
l=2*a*math.tan(phicr); #fibre length(m)
r=1/l; #number of reflections
od=L/math.sin(phicr); #total distance travelled by light(m)
#Result
print "critical angle is",phic,"degrees"
print "fibre length is",round(l*10**6,2),"micro m"
print "answer for fibre length given in the book is wrong"
print "number of reflections is",int(r)
print "total distance travelled by light is",round(od,4),"m"
#importing modules
import math
from __future__ import division
#Variable declaration
Pi=100; #input power(micro W)
Po=2; #output power(micro W)
L=10; #length(m)
#Calculation
sa=(10/L)*math.log10(Pi/Po); #signal attenuation per unit length(dB km-1)
osa=sa*L; #overall signal attenuation(dB)
#Result
print "signal attenuation per unit length is",round(sa,1),"dB km-1"
print "overall signal attenuation is",int(round(osa)),"dB"
#importing modules
import math
from __future__ import division
#Variable declaration
n=1.55; #Core refractive index
L=10; #length(m)
delta=0.026; #relative refractive index difference
C=3*10**5;
#Calculation
deltaT=L*n*delta/C; #total dispersion(s)
blp=L/(2*deltaT); #bandwidth length product(Hz km)
#Result
print "total dispersion is",round(deltaT*10**9,1),"ns"
print "bandwidth length product is",round(blp/10**5,2),"*10**5 Hz km"
print "answer for bandwidth length product given in the book is wrong"
#importing modules
import math
from __future__ import division
#Variable declaration
n1=1.55; #Core refractive index
n2=1.50; #Cladding refractive index
#Calculation
NA=math.sqrt(n1**2-n2**2); #numerical aperture
#Result
print "numerical aperture is",round(NA,3)
#importing modules
import math
from __future__ import division
#Variable declaration
n1=1.563; #Core refractive index
n2=1.498; #Cladding refractive index
#Calculation
NA=math.sqrt(n1**2-n2**2); #numerical aperture
phimax=math.asin(NA); #acceptance angle(radian)
phimax=math.asin(NA)*180/math.pi;
phimaxd=int(phimax); #acceptance angle(degrees)
phimaxm=60*(phimax-phimaxd); #acceptance angle(minutes)
#Result
print "numerical aperture is",round(NA,4)
print "acceptance angle is",phimaxd,"degrees",round(phimaxm,1),"minutes"
print "answer for acceptance angle in minutes given in the book varies due to rounding off errors"
#importing modules
import math
from __future__ import division
#Variable declaration
NA=0.39; #numerical aperture
delta=0.05; #relative refractive index difference
#Calculation
n1=NA/math.sqrt(2*delta); #Core refractive index
#Result
print "Core refractive index is",round(n1,4)
print "answer given in the book varies due to rounding off errors"
#importing modules
import math
from __future__ import division
#Variable declaration
n1=1.563; #Core refractive index
n2=1.498; #Cladding refractive index
#Calculation
delta=(n1-n2)/n1; #fractional index change
#Result
print "fractional index change is",round(delta,4)
#importing modules
import math
from __future__ import division
#Variable declaration
n1=1.48; #Core refractive index
n2=1.45; #Cladding refractive index
#Calculation
NA=math.sqrt(n1**2-n2**2); #numerical aperture
thetamax=math.asin(NA)*180/math.pi;
thetamaxd=int(thetamax); #angle of acceptance(degrees)
thetamaxm=60*(thetamax-thetamaxd); #angle of acceptance(minutes)
#Result
print "numerical aperture is",round(NA,4)
print "angle of acceptance is",thetamaxd,"degrees",int(round(thetamaxm)),"minutes"
#importing modules
import math
from __future__ import division
#Variable declaration
NA=0.39; #numerical aperture
delta=0.05; #fractional index change
#Calculation
n1=NA/math.sqrt(2*delta); #refractive index of core
#Result
print "refractive index of core is",round(n1,3)
#importing modules
import math
from __future__ import division
#Variable declaration
n1=1.563; #Core refractive index
n2=1.498; #Cladding refractive index
#Calculation
delta=(n1-n2)/n1; #fractional index change
#Result
print "fractional index change is",round(delta,5)
#importing modules
import math
from __future__ import division
#Variable declaration
n1=1.55; #Core refractive index
n2=1.50; #Cladding refractive index
#Calculation
NA=math.sqrt(n1**2-n2**2); #numerical aperture
#Result
print "numerical aperture is",round(NA,2)
#importing modules
import math
from __future__ import division
#Variable declaration
n1=1.563; #Core refractive index
n2=1.498; #Cladding refractive index
#Calculation
NA=math.sqrt(n1**2-n2**2); #numerical aperture
theta0=math.asin(NA)*180/math.pi; #acceptance angle(degrees)
#Result
print "numerical aperture is",round(NA,4)
print "acceptance angle is",round(theta0,2),"degrees"
#importing modules
import math
from __future__ import division
#Variable declaration
n1=1.53; #Core refractive index
n2=1.42; #Cladding refractive index
#Calculation
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
n1=1.6; #Core refractive index
n2=1.4; #Cladding refractive index
n0=1.33; #water refractive index
#Calculation
NA=math.sqrt(n1**2-n2**2)/n0; #numerical aperture
theta0=math.asin(NA)*180/math.pi; #acceptance angle(degrees)
#Result
print "numerical aperture is",round(NA,3)
print "acceptance angle is",round(theta0,4),"degrees"
#importing modules
import math
from __future__ import division
#Variable declaration
n1=1.5; #Core refractive index
n2=1.3; #Cladding refractive index
#Calculation
delta=(n1-n2)/n1; #fractional index change
#Result
print "fractional index change is",round(delta,3)
#importing modules
import math
from __future__ import division
#Variable declaration
n1=1.55; #Core refractive index
n2=1.6; #Cladding refractive index
theta1=60*math.pi/180; #angle of incidence(radian)
#Calculation
x=n1*math.sin(theta1)/n2;
theta2=math.asin(x)*180/math.pi; #angle of reflection(degrees)
#Result
print "angle of reflection is",round(theta2,2),"degrees"
#importing modules
import math
from __future__ import division
#Variable declaration
n2=1.3; #Cladding refractive index
delta=0.14; #fractional index change
#Calculation
n1=n2/(1-delta); #Core refractive index
#Result
print "Core refractive index is",round(n1,2)
#importing modules
import math
from __future__ import division
#Variable declaration
theta0=26.80*math.pi/180; #acceptance angle(radian)
#Calculation
NA=math.sin(theta0); #numerical aperture
#Result
print "numerical aperture is",round(NA,5)