"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"'''\n",
"A step-index fiber has a core diameter of 80 micro m, a core refractive index \n",
"of 1.62, and a numerical aperture of 0.21. Calculate: \n",
"(a) the acceptance angle, (b) the refractive index that the fiber can \n",
"propagate at a wavelength of 0.8 micro m, (c) the number of modes that the\n",
"fiber can propagate at a wavelength of 0.8 micro m.'''\n",
"\n",
"import scipy\n",
"\n",
"#Variable Declaration\n",
"\n",
"d=80*(10)**-6 #diameter in m\n",
"n1=1.62 #core refractive index\n",
"NA=0.21 #numerical aperture\n",
"L=8*(10)**-7 #wavelength in m\n",
"\n",
"#Calculations\n",
"\n",
"P=scipy.arcsin(NA)*180/scipy.pi #acceptance angle\n",
"n2=scipy.sqrt(n1**2-NA**2) #refractive index\n",
"V=(scipy.pi*d/L)*scipy.sqrt(n1**2-n2**2)\n",
"N=V**2/2 #number of modes\n",
"\n",
"#Results\n",
"\n",
"print 'Acceptance angle =',round(P,2),'degrees'\n",
"print 'Refractive index =',round(n2,3)\n",
"print 'No. of modes =',round(N,0)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Acceptance angle = 12.12 degrees\n",
"Refractive index = 1.606\n",
"No. of modes = 2176.0\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 14.3, Page number: 655
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"'''\n",
"Light pulses propagate through a fiber cable with an attenuation of 0.25 dB/km.\n",
"Determine the distance through which the power of pulses is reduced by 40%. '''\n",
"\n",
"import scipy\n",
"\n",
"#Variable Declaration\n",
"\n",
"a=0.25 #in dB/km\n",
"P=1-0.4 #strength of pulse im %\n",
"\n",
"#Calculation\n",
"\n",
"l=(10/a)*scipy.log(1/P)/scipy.log(10) #distance in km\n",
"\n",
"#Result\n",
"\n",
"print 'distance through which the power is reduced by 40% =',round(l,3),'km'"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"distance through which the power is reduced by 40% = 8.874 km\n"
]
}
],
"prompt_number": 3
}
],
"metadata": {}
}
]
}