import math
#Variable declaration
n1 = 1.55 #refractive inde of core
n2 = 1.50 #refractive index of cladding
#Calculation
NA = math.sqrt(n1**2-n2**2)
#Result
print "Numerical Aperture =",round(NA,3)
import math
#Variable declaration
n1 = 1.563 #refractive inde of core
n2 = 1.498 #refractive index of cladding
#Calculation
NA = math.sqrt(n1**2-n2**2)
alpha_i = math.degrees(math.asin(NA))
#Result
print "Angle of acceptance =",round(alpha_i,2),"degrees"
import math
#Variable declaration
NA = 0.39 #numerical aperture
delta_n = 0.05 #differnce between refractive indices of core & cladding
#Calculaations
n1 = NA/math.sqrt(2*delta_n)
#Result
print "Refractive index of core =",round(n1,4)
#Variable declaration
n1 = 1.563 #refractive inde of core
n2 = 1.498 #refractive index of cladding
#Calculation
delta = (n1-n2)/n1
#Result
print "Fractional index change for the given fiber is",round(delta,4)
import math
#Variable declaration
n1 = 1.48 #refractive inde of core
n2 = 1.45 #refractive index of cladding
#Calculations
NA = math.sqrt(n1**2-n2**2)
alpha_i = math.degrees(math.asin(NA))
#Result
print "Numerical aperture =",round(NA,4)
print "Angle of acceptance =",round(alpha_i,2),"degrees"
import math
#Variable declaration
Pout = 40. #output power(mW)
Pin = 100. #input power(mW)
#Calculation
A = -10*math.log10(Pout/Pin) #Attenuation(dB)
#Result
print "Attenuation =",round(A,2),"dB"