#importing modules
import math
from __future__ import division
#Variable declaration
NA=0.16; #numerical aperture of fibre
n1=1.45; #refractive index of core
d=90*10**-6; #diameter of core(m)
n0=1; #refractive index of air
lamda=0.9*10**-6; #wavelength(m)
#Calculation
n2=math.sqrt((n1**2)-(NA**2)); #refractive index of cladding
phi=math.asin(NA/n0); #acceptance angle(radian)
phi=phi*180/math.pi; #acceptance angle(degrees)
phid=int(phi); #acceptance angle(degrees)
t=60*(phi-phid);
phim=int(t); #acceptance angle(minutes)
phis=60*(t-phim); #acceptance angle(seconds)
N=4.9*(d*NA/lamda)**2; #number of nodes propagating through fibre
Nstep=N/2; #number of nodes propagating through graded index fibre
#Result
print "refractive index of cladding is",round(n2,3)
print "acceptance angle is",phid,"degrees",phim,"minutes",round(phis,2),"seconds"
print "number of nodes propagating through fibre is",N
print "number of nodes propagating through graded index fibre is",int(Nstep)
#importing modules
import math
from __future__ import division
#Variable declaration
lamda=1*10**-6; #wavelength of light(m)
n1=1.45; #refractive index of core
n2=1.448; #refractive index of cladding
d=6*10**-6; #diameter of core(m)
#Calculation
NA=math.sqrt((n1**2)-(n2**2)); #numerical aperture
N=4.9*(d*NA/lamda)**2; #number of nodes propagating through fibre
#Result
print "number of nodes allowed to propagate through fibre is",int(N)
print "it is a single mode fibre"