diff options
author | Trupti Kini | 2016-05-08 23:30:29 +0600 |
---|---|---|
committer | Trupti Kini | 2016-05-08 23:30:29 +0600 |
commit | 319b3ab10ce7ba40b7854a5630f317e318f3721b (patch) | |
tree | 18e365c95a9401c576eb4029c00eeee1c8f29387 /Optical_Fiber_Communication_System_by_Dr._M.K._Raina/chap2.ipynb | |
parent | cf1d6e42383334d18a21bc297720bf52fca2f488 (diff) | |
download | Python-Textbook-Companions-319b3ab10ce7ba40b7854a5630f317e318f3721b.tar.gz Python-Textbook-Companions-319b3ab10ce7ba40b7854a5630f317e318f3721b.tar.bz2 Python-Textbook-Companions-319b3ab10ce7ba40b7854a5630f317e318f3721b.zip |
Added(A)/Deleted(D) following books
A Optical_Fiber_Communication_System_by_Dr._M.K._Raina/chap10.ipynb
A Optical_Fiber_Communication_System_by_Dr._M.K._Raina/chap2.ipynb
A Optical_Fiber_Communication_System_by_Dr._M.K._Raina/chap3.ipynb
A Optical_Fiber_Communication_System_by_Dr._M.K._Raina/chap4.ipynb
A Optical_Fiber_Communication_System_by_Dr._M.K._Raina/chap5.ipynb
A Optical_Fiber_Communication_System_by_Dr._M.K._Raina/chap6.ipynb
A Optical_Fiber_Communication_System_by_Dr._M.K._Raina/chap7.ipynb
A Optical_Fiber_Communication_System_by_Dr._M.K._Raina/chap8.ipynb
A Optical_Fiber_Communication_System_by_Dr._M.K._Raina/chap9.ipynb
A Optical_Fiber_Communication_System_by_Dr._M.K._Raina/screenshots/Sc1.png
A Optical_Fiber_Communication_System_by_Dr._M.K._Raina/screenshots/sc2.png
A Optical_Fiber_Communication_System_by_Dr._M.K._Raina/screenshots/sc3.png
Diffstat (limited to 'Optical_Fiber_Communication_System_by_Dr._M.K._Raina/chap2.ipynb')
-rw-r--r-- | Optical_Fiber_Communication_System_by_Dr._M.K._Raina/chap2.ipynb | 636 |
1 files changed, 636 insertions, 0 deletions
diff --git a/Optical_Fiber_Communication_System_by_Dr._M.K._Raina/chap2.ipynb b/Optical_Fiber_Communication_System_by_Dr._M.K._Raina/chap2.ipynb new file mode 100644 index 00000000..945ece3f --- /dev/null +++ b/Optical_Fiber_Communication_System_by_Dr._M.K._Raina/chap2.ipynb @@ -0,0 +1,636 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Ch-2 : Ray Theory Transmission in Optical Fibers" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:2_1 Pg: 54" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Critical angle in degree= 75.41 degree\n", + "\n", + " Numerical aperture= 0.39 \n", + "\n", + " Acceptance angle in degree= 23.00 degree\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import asin,pi,ceil,sqrt\n", + "n1=1.55## core refractive index\n", + "n2=1.50## cladding refractive index\n", + "x=asin(n2/n1)# # Critical angle in radians\n", + "x1=x*180/(pi)## Critical angle in degree\n", + "n_a=sqrt(n1**2-n2**2)## Numerical aperture\n", + "x_a=asin(n_a)*180/(pi)#\n", + "x_a1=ceil(x_a)## Acceptance angle in Degree\n", + "print \"Critical angle in degree= %0.2f degree\"%(x1)#\n", + "print \"\\n Numerical aperture= %0.2f \"%(n_a)#\n", + "print \"\\n Acceptance angle in degree= %0.2f degree\"%(x_a1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:2.2 Pg: 56" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Numerical aperture = 0.42\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import sin,sqrt\n", + "c=3*10**8## speed of light in m/s\n", + "v=2*10**8## in m/s\n", + "n1=c/v#\n", + "x=75## in degree\n", + "n2=n1*sin((x*3.14/180))#\n", + "n_2=1.44#\n", + "n_a=sqrt(n1**2-n_2**2)## numerical aperture\n", + "print \"Numerical aperture = %0.2f\"%(n_a)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:2.3 Pg: 57" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Numerical aperture = 0.30\n", + "\n", + " acceptance angle in degree = 17.46 degree\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import sqrt,asin,pi\n", + "n1=1.50## core refractive index\n", + "n2=1.47## cladding refractive index\n", + "dl=(n1-n2)/n1#\n", + "n_a=n1*(sqrt(2*dl))## numerical aperture\n", + "x_a=(asin(n_a))*180/pi## acceptance angle in degree\n", + "print \"Numerical aperture = %0.2f\"%(n_a)#\n", + "print \"\\n acceptance angle in degree = %0.2f degree\"%(x_a)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:2.4 Pg: 58" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Numerical aperture = 0.39\n", + "\n", + " acceptance angle in degree = 22.79 degree\n", + "\n", + " critical angle in degree = 75.20 degree\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import sqrt,asin,pi\n", + "n1=1.50## core refractive index\n", + "n2=1.45## cladding refractive index\n", + "dl=(n1-n2)/n1#\n", + "n_a=n1*(sqrt(2*dl))## numerical aperture\n", + "x_a=(asin(n_a))*180/pi## acceptance angle in degree\n", + "x_c=(asin(n2/n1))*180/3.14## critical angle in degree\n", + "print \"Numerical aperture = %0.2f\"%(n_a)#\n", + "print \"\\n acceptance angle in degree = %0.2f degree\"%(x_a)#\n", + "print \"\\n critical angle in degree = %0.2f degree\"%(x_c)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:2.5 Pg: 58" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "core refractive ondex = 1.42\n", + "\n", + " cladding refractive index = 1.40\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import sqrt\n", + "dl=0.012#\n", + "n_a=0.22## numerical aperture\n", + "n1=n_a/(sqrt(2*dl))## core refractive ondex\n", + "n2=n1-(dl*n1)## cladding refractive index\n", + "print \"core refractive ondex = %0.2f\"%(n1)#\n", + "print \"\\n cladding refractive index = %0.2f\"%(n2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:2.6 Pg: 59" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "core refractive ondex = 2.47\n", + "\n", + " cladding refractive index = 2.45\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "from __future__ import division\n", + "dl=0.01#\n", + "n_a=0.35## numerical aperture\n", + "n1=n_a/(sqrt(2*dl))## core refractive ondex\n", + "n2=n1-(dl*n1)## cladding refractive index\n", + "print \"core refractive ondex = %0.2f\"%(n1)#\n", + "print \"\\n cladding refractive index = %0.2f\"%(n2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:2.7 Pg: 59" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "acceptance angle in degree = 7.72 degree\n", + "\n", + " critical angle in degree = 82.83 degree\n", + "\n", + " number of modes transmitted = 288\n" + ] + } + ], + "source": [ + "from math import sqrt,asin,pi,floor\n", + "from __future__ import division\n", + "n2=1.59## cladding refractive index\n", + "n_a=0.2## numerical aperture\n", + "n1=sqrt(n2**2+n_a**2)## core refractive index\n", + "n_1=1.60## core refractive index\n", + "n_o=1.33#\n", + "A=(sqrt(n_1**2-n2**2))/n_o#\n", + "x_a=(asin(A))*180/pi## acceptance angle in degree\n", + "x_c=(asin(n2/n1))*180/pi## critical angle in degree\n", + "y=1300*10**(-9)## in meter\n", + "a=25*10**(-6)## in meter\n", + "v=(2*pi*a*n_a)/y#\n", + "V=floor(v)#\n", + "M=V**2/2## number of modes transmitted\n", + "print \"acceptance angle in degree = %0.2f degree\"%(x_a)#\n", + "print \"\\n critical angle in degree = %0.2f degree\"%(x_c)#\n", + "print \"\\n number of modes transmitted = %d\"%(M)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:2.8 Pg: 60" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Numerical aperture = 0.30\n", + "\n", + " the maximum entrance angle in degree = 17.46 degree\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,asin\n", + "from __future__ import division\n", + "n1=1.50## core refractive index\n", + "n2=1.47## cladding refractive index\n", + "dl=(n1-n2)/n1#\n", + "n_a=n1*(sqrt(2*dl))## numerical aperture\n", + "x_e=(asin(n_a))*180/pi## the maximum entrance angle in degree\n", + "print \"Numerical aperture = %0.2f\"%(n_a)#\n", + "print \"\\n the maximum entrance angle in degree = %0.2f degree\"%(x_e)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:2.9 Pg: 61" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Numerical aperture = 0.29\n", + "\n", + " acceptance angle in degree = 16.74 degree\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,asin\n", + "from __future__ import division\n", + "n1=1.44## core refractive index\n", + "dl=0.02#\n", + "n_a=n1*sqrt(2*dl)#\n", + "n_a=n1*(sqrt(2*dl))## numerical aperture\n", + "x_a=(asin(n_a))*180/pi## acceptance angle in degree\n", + "print \"Numerical aperture = %0.2f\"%(n_a)#\n", + "print \"\\n acceptance angle in degree = %0.2f degree\"%(x_a)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:2.10 Pg: 61" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "critical angle = 81.89 degree\n", + "\n", + " numerical aperture = 0.21\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,asin\n", + "from __future__ import division\n", + "n1=1.50## core refractive index\n", + "n2=(99/100)*1.50## cladding refractive index\n", + "x_c=(asin(n2/n1))*180/pi## critical angle in degree\n", + "n_m=sqrt(n1**2-n2**2)## numerical aperture\n", + "print \"critical angle = %0.2f degree\"%(x_c)#\n", + "print \"\\n numerical aperture = %0.2f\"%(n_m)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:2.11 Pg: 61" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "numerical aperture = 0.38\n", + "\n", + " fractional difference = 0.03\n" + ] + } + ], + "source": [ + "from math import sqrt,pi\n", + "from __future__ import division\n", + "n1=1.50## core refractive index\n", + "n2=1.45## cladding refractive index\n", + "n_m=sqrt(n1**2-n2**2)## numerical aperture\n", + "dl=(n1-n2)/n1## fractional difference\n", + "print \"numerical aperture = %0.2f\"%(n_m)#\n", + "print \"\\n fractional difference = %0.2f\"%(dl)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:2.12 Pg: 62" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "critical angle = 83.29 degree\n", + "\n", + " acceptance angle = 9.82 degree\n", + "\n", + " numerical aperture = 0.17\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,asin\n", + "from __future__ import division\n", + "n1=1.46## core refractive index\n", + "n2=1.45## cladding refractive index\n", + "x_c=(asin(n2/n1))*180/pi## critical angle in degree\n", + "n_m=sqrt(n1**2-n2**2)## numerical aperture\n", + "x_a=(asin(n_m))*180/pi## acceptance angle in degree\n", + "print \"critical angle = %0.2f degree\"%(x_c)#\n", + "print \"\\n acceptance angle = %0.2f degree\"%(x_a)#\n", + "print \"\\n numerical aperture = %0.2f\"%(n_m)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:2.13 Pg: 62" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "core refractive index = 1.44\n", + "\n", + " cladding refractive index = 1.43\n" + ] + } + ], + "source": [ + "from math import sqrt,pi\n", + "from __future__ import division\n", + "n_m=0.204## numerical aperture\n", + "dl=0.01## index difference\n", + "n1=n_m/(sqrt(2*dl))## core refractive index\n", + "n2=n1*(1-dl)## cladding refractive index\n", + "print \"core refractive index = %0.2f\"%(n1)#\n", + "print \"\\n cladding refractive index = %0.2f\"%(n2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:2.14 Pg: 62" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "critical angle = 81.89 degree\n", + "\n", + " numerical aperture = 0.21\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,asin\n", + "from __future__ import division\n", + "n1=1.46## core refractive index\n", + "dl=0.01## index difference\n", + "n_2=n1-(n1*dl)## cladding refractive index\n", + "x_c=(asin(n_2/n1))*180/pi## critical angle in degree\n", + "n_m=sqrt(n1**2-n_2**2)## numerical aperture\n", + "print \"critical angle = %0.2f degree\"%(x_c)#\n", + "print \"\\n numerical aperture = %0.2f\"%(n_m)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:2.15 Pg: 62" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "critical angle=75.16 degree\n", + "\n", + " acceptance angle=22.59 degree\n", + "\n", + " numerical aperture=0.38\n", + "\n", + " percentage of light=14.75%\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,asin\n", + "from __future__ import division\n", + "n1=1.50## core refractive index\n", + "n2=1.45## cladding refractive index\n", + "x_c=(asin(n2/n1))*180/pi## critical angle in degree\n", + "n_m=sqrt(n1**2-n2**2)## numerical aperture\n", + "x_a=(asin(n_m))*180/pi## acceptance angle in degree\n", + "n_c=(n_m)**2*100## percentage of light\n", + "print \"critical angle=%0.2f degree\"%(x_c)#\n", + "print \"\\n acceptance angle=%0.2f degree\"%(x_a)#\n", + "print \"\\n numerical aperture=%0.2f\"%(n_m)#\n", + "print \"\\n percentage of light=%0.2f%%\"%(n_c)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:2.16 Pg: 63" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "numerical aperture=0.21\n", + "\n", + " acceptance angle=0.14 radian\n", + "\n", + " critical angle=81.89 degree\n" + ] + } + ], + "source": [ + "from math import sqrt,pi,asin\n", + "from __future__ import division\n", + "n1=1.50## core refractive index\n", + "dl=0.01## index difference\n", + "n_m=n1*(sqrt(2*dl))## numerical aperture\n", + "x_a=pi*(n_m)**2## acceptance angle in radian\n", + "n2_1=1-dl## the ratio of n2 to n1\n", + "x_c=(asin(n2_1))*180/pi## critical angle in degree\n", + "print \"numerical aperture=%0.2f\"%(n_m)#\n", + "print \"\\n acceptance angle=%0.2f radian\"%(x_a)#\n", + "print \"\\n critical angle=%0.2f degree\"%(x_c)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.9" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} |