# 13: Fiber Optics¶

## Example number 13.1, Page number 13.5¶

In [2]:
#importing modules
import math
from __future__ import division

#Variable declaration
n1=1.55;     #refractive index of core

#Calculation
NA=math.sqrt(n1**2-n2**2);    #numerical aperture

#Result
print "numerical aperture is",round(NA,3)

numerical aperture is 0.391


## Example number 13.2, Page number 13.6¶

In [8]:
#importing modules
import math
from __future__ import division

#Variable declaration
n1=1.563;     #refractive index of core

#Calculation
NA=math.sqrt(n1**2-n2**2);    #numerical aperture
alpha_i=(alpha_i*180/math.pi);    #angle(degrees)
alpha_id=int(alpha_i);
alpha_im=60*(alpha_i-alpha_id);

#Result
print "angle of acceptance is",alpha_id,"degrees",round(alpha_im,1),"minutes"
print "answer varies due to rounding off errors"

angle of acceptance is 26 degrees 29.5 minutes
answer varies due to rounding off errors


## Example number 13.3, Page number 13.6¶

In [13]:
#importing modules
import math
from __future__ import division

#Variable declaration
NA=0.39;       #numerical aperture
delta=0.05;    #difference of indices

#Calculation
n1=NA/math.sqrt(2*delta);     #refractive index of core

#Result
print "refractive index of core is",round(n1,4)
print "answer varies due to rounding off errors"

refractive index of core is 1.2333
answer varies due to rounding off errors


## Example number 13.4, Page number 13.7¶

In [15]:
#importing modules
import math
from __future__ import division

#Variable declaration
n1=1.563;     #refractive index of core

#Calculation
delta=(n1-n2)/n1;    #fractional index change

#Result
print "fractional index change is",round(delta,4)

fractional index change is 0.0416


## Example number 13.5, Page number 13.7¶

In [19]:
#importing modules
import math
from __future__ import division

#Variable declaration
n1=1.48;     #refractive index of core

#Calculation
NA=math.sqrt(n1**2-n2**2);    #numerical aperture
alpha_i=(alpha_i*180/math.pi);    #angle(degrees)
alpha_id=int(alpha_i);
alpha_im=60*(alpha_i-alpha_id);

#Result
print "numerical aperture is",round(NA,4)
print "angle of acceptance is",alpha_id,"degrees",round(alpha_im),"minutes"

numerical aperture is 0.2965
angle of acceptance is 17 degrees 15.0 minutes


## Example number 13.6, Page number 13.14¶

In [22]:
#importing modules
import math
from __future__ import division

#Variable declaration
Pout=40;    #power(mW)
Pin=100;    #power(mW)

#Calculation
al=-10*math.log10(Pout/Pin);    #attenuation loss(dB)

#Result
print "attenuation loss is",round(al,2),"dB"

attenuation loss is 3.98 dB