summaryrefslogtreecommitdiff
path: root/Optical_Fiber_Communication_by_R._R._Dudeja/Chapter3_1.ipynb
diff options
context:
space:
mode:
authorkinitrupti2017-05-12 18:53:46 +0530
committerkinitrupti2017-05-12 18:53:46 +0530
commit6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d (patch)
tree22789c9dbe468dae6697dcd12d8e97de4bcf94a2 /Optical_Fiber_Communication_by_R._R._Dudeja/Chapter3_1.ipynb
parentd36fc3b8f88cc3108ffff6151e376b619b9abb01 (diff)
downloadPython-Textbook-Companions-6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d.tar.gz
Python-Textbook-Companions-6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d.tar.bz2
Python-Textbook-Companions-6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d.zip
Removed duplicates
Diffstat (limited to 'Optical_Fiber_Communication_by_R._R._Dudeja/Chapter3_1.ipynb')
-rwxr-xr-xOptical_Fiber_Communication_by_R._R._Dudeja/Chapter3_1.ipynb1352
1 files changed, 1352 insertions, 0 deletions
diff --git a/Optical_Fiber_Communication_by_R._R._Dudeja/Chapter3_1.ipynb b/Optical_Fiber_Communication_by_R._R._Dudeja/Chapter3_1.ipynb
new file mode 100755
index 00000000..4ff5c94e
--- /dev/null
+++ b/Optical_Fiber_Communication_by_R._R._Dudeja/Chapter3_1.ipynb
@@ -0,0 +1,1352 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:2b710cf5b5be9f51b281cf20f926c177245f0b5c79ffccf88ed3e06dd1ffcbfa"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3- Optical Fiber Fabrication"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example1: PgNo-83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# variable declaration\n",
+ "n1=1.50 # core refractive index\n",
+ "n2=1.48 # cladding refractive index\n",
+ "y=1.3*math.pow(10,(-6))\n",
+ "m=1000 # the no. of models\n",
+ "\n",
+ "# Calculations\n",
+ "v=math.sqrt(2*m)\n",
+ "a=(v*y)/(2*math.pi*(math.sqrt(pow(n1,2)-math.pow(n2,2)))*math.pow(10,6)) # core radius in micrometer\n",
+ "\n",
+ "# Results\n",
+ "print ('%s %.2e %s' %(\" core radius= \",a ,\"micrometer\"))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " core radius= 3.79e-11 micrometer\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example2: PgNo-83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Variable declaration\n",
+ "n1=1.505 # core refractive index\n",
+ "n2=1.502 # cladding refractive index\n",
+ "\n",
+ "# Calculations\n",
+ "n_m=math.sqrt(math.pow(n1,2)-math.pow(n2,2)) # numerical aperture\n",
+ "y=1.3*math.pow(10,(-6))\n",
+ "v=2.4\n",
+ "a=(v*y)/(2*math.pi*(math.sqrt(math.pow(n1,2)-math.pow(n2,2))))*math.pow(10,6)# core radius in micrometer\n",
+ "\n",
+ "# Results\n",
+ "print ('%s %.2f'%(\" numerical aperture= \",n_m))\n",
+ "print ('%s %.3f %s' %(\"\\n core radius= \",a,\"micrometer\"))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " numerical aperture= 0.09\n",
+ "\n",
+ " core radius= 5.228 micrometer\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example3: PgNo-84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# Variable declaration\n",
+ "\n",
+ "n1=1.5 # core refractive index\n",
+ "dl=0.01 # index difference\n",
+ "m=0 # for the dominant mode\n",
+ "v=0 # for the dominant mode\n",
+ "y=1.3 # in micrometer\n",
+ "a=5.0 # radius in micrometer\n",
+ "\n",
+ "# Calculations\n",
+ "k=(2*math.pi)/y\n",
+ "b=math.pow(k,2)*math.pow(n1,2)-(2*k*n1*math.sqrt(2*dl))/a\n",
+ "B=math.sqrt(b) # propagation constant in rad/um\n",
+ "\n",
+ "# Results\n",
+ "print ('%s %.3f %s' %(\" propagation constant= \",B,\"rad/um\"))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " propagation constant= 7.221 rad/um\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example4: PgNo-86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Printing the results\n",
+ "b=1/2 # propagtion constant\n",
+ "print (\" normalised propagtion constant\")\n",
+ "print (\"\\n B=(pow((b/k),2)-pow(n2,2))/(pow(n1,2)-pow(n2,2))\")\n",
+ "print (\"\\n thus when b=1/2\")\n",
+ "print (\"\\n B=k*sqrt(pow(n2,2)+b*(pow(n1,2)-pow(n2,2))\")\n",
+ "print (\"\\n B=k*sqrt(pow(n1,2)-pow(n2,2)/2)\")\n",
+ "print (\"\\n which gives its rms value\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " normalised propagtion constant\n",
+ "\n",
+ " B=(pow((b/k),2)-pow(n2,2))/(pow(n1,2)-pow(n2,2))\n",
+ "\n",
+ " thus when b=1/2\n",
+ "\n",
+ " B=k*sqrt(pow(n2,2)+b*(pow(n1,2)-pow(n2,2))\n",
+ "\n",
+ " B=k*sqrt(pow(n1,2)-pow(n2,2)/2)\n",
+ "\n",
+ " which gives its rms value\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example5: PgNo-87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Variable declaration\n",
+ "n1=3.6 #core refractive index\n",
+ "n2=3.3 # cladding refractive index\n",
+ "d=2.0 # thickness in um\n",
+ "y=0.8 # wavelength in um\n",
+ "\n",
+ "# Calculations\n",
+ "m=(2*d*math.sqrt(math.pow(n1,2)-math.pow(n2,2))/y) # total no. of models allowed\n",
+ "M=math.ceil(m) # total no. of models allowed\n",
+ "\n",
+ "print \" Total no. of models allowed= \",int(M)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total no. of models allowed= 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example6: PgNo-88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Initialisation of variables\n",
+ "n1=1.48 # core refractive index\n",
+ "a=40*(math.pow(10,-6)) #core radius in meter\n",
+ "dl=0.015 # index difference\n",
+ "y=0.85*(math.pow(10,-6)) # wavelength in um\n",
+ "\n",
+ "# Calculations\n",
+ "v=(2*math.pi*a*n1*math.sqrt(2*dl))/y # normalised frequency\n",
+ "M=math.pow(v,2)/2\n",
+ "m=math.ceil(M) # the total no. of guided modes\n",
+ "\n",
+ "# Results\n",
+ "print ('%s %.2f' %(\" normalised frequency= \",v))\n",
+ "print \"\\n The total no. of guided modess = \",int(m)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " normalised frequency= 75.80\n",
+ "\n",
+ " The total no. of guided modess = 2873\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example7: PgNo-89"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Initialisation of variables\n",
+ "n1=1.46 # core refractive index\n",
+ "dl=0.015 # index difference\n",
+ "a=30*(math.pow(10,-6))# core radius in meter\n",
+ "y=0.85*(math.pow(10,-6)) #wavelength in um\n",
+ "\n",
+ "# calcualtions\n",
+ "n2=n1-(n1*dl)# cladding refractive index\n",
+ "v=(2*math.pi*a*n1*math.sqrt(2*dl))/y # normalised frequency\n",
+ "M=math.pow(v,2)/2 # the total no. of guided modes\n",
+ "\n",
+ "# Results\n",
+ "print ('%s %.2f' %(\" Cladding refractive index= \",n2))\n",
+ "print ('%s %.3f'%(\"\\n Normalised frequency= \",v))\n",
+ "print \"\\n The total no. of guided modes = \",int(M)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Cladding refractive index= 1.44\n",
+ "\n",
+ " Normalised frequency= 56.078\n",
+ "\n",
+ " The total no. of guided modes = 1572\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example8: PgNo-91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Initialisation of variables\n",
+ "n1=1.5 # core refractive index\n",
+ "dl=0.01 # index difference\n",
+ "M=1100 # the total no. of guided modes\n",
+ "y=1.3*(math.pow(10,-6)) # wavelength in um\n",
+ "v=math.sqrt(2*M)# normalised frequency\n",
+ "\n",
+ "# Calculations\n",
+ "a=(v*y)/(2*math.pi*n1*math.sqrt(2*dl))*math.pow(10,6) #core radius in meter\n",
+ "\n",
+ "# Results\n",
+ "print ('%s %.2f' %(\" Normalised frequency= \",v))\n",
+ "print ('%s %.2f %s' %(\"\\n The diameter of the fiber core = \",2*a,\"um\"))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Normalised frequency= 46.90\n",
+ "\n",
+ " The diameter of the fiber core = 91.50 um\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example9: PgNo-91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Initialisation of variables\n",
+ "n1=1.45 # core refractive index\n",
+ "n_m=0.16 # numerical aperture\n",
+ "\n",
+ "# Calculations\n",
+ "a=30*math.pow(10,-6) # core radius in micrometer\n",
+ "y=0.5*(math.pow(10,-6)) # wavelength in um\n",
+ "v=(2*math.pi*a*n_m)/y #normalised frequency\n",
+ "\n",
+ "# Results\n",
+ "print ('%s %.2f' %(\" Normalised frequency= \",v))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Normalised frequency= 60.32\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example10: PgNo-93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Initialisation of variables\n",
+ "n1=3.6 # core refractive index\n",
+ "n2=3.56 # cladding refractive index\n",
+ "y=0.85*(math.pow(10,-6))# wavelength in um\n",
+ "m=1\n",
+ "n=0\n",
+ "v_c=2.405 # for planner guide\n",
+ "\n",
+ "# Calculations\n",
+ "a=(v_c*y)/(2*math.pi*math.sqrt(math.pow(n1,2)-math.pow(n2,2)))# core radius in micrometer\n",
+ "\n",
+ "print ('%s %.2f %s' %(\"The max thickness= \",a*pow(10,6),\"um\"))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The max thickness= 0.61 um\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example11: PgNo-94"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# variable declaration\n",
+ "n1=1.5 #core refractive index\n",
+ "y=1.3*(math.pow(10,-6)) # wavelength in um\n",
+ "M=1100 # total no. of models\n",
+ "dl=0.01 # index difference\n",
+ "\n",
+ "# Calculations\n",
+ "v=math.sqrt(2*M)\n",
+ "V=math.ceil(v)\n",
+ "a=(V*y)/(2*math.pi*n1*math.sqrt(2*dl))*math.pow(10,6) # core radius in micrometer\n",
+ "a1=math.ceil(a)# core radius in micrometer\n",
+ "\n",
+ "# Results\n",
+ "print ('%s %.2f %s' %(\"The core diameter= \",2*a1,\"um\"))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The core diameter= 92.00 um\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example12: PgNo-96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Initialisation of variables\n",
+ "n1=1.45 # core refractive index\n",
+ "dl=0.015 # index difference\n",
+ "\n",
+ "# Calculations\n",
+ "y=0.85*(math.pow(10,-6)) # wavelength in meter\n",
+ "v=2.4*math.pow((1+(2/2)),(0.5))# Max normalised frequency\n",
+ "a=(v*y)/(2*math.pi*n1*math.pow((2*dl),(0.5))) # Max core radius in m\n",
+ "d=2*a # The max core diameter in meter\n",
+ "\n",
+ "# Results\n",
+ "print ('%s %.3f %s'%(\" The max core diameter in meter= \",d*pow(10,6),\"um\"))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The max core diameter in meter= 3.657 um\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example13: PgNo-98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Variable Initialisation\n",
+ "n1=1.48 #core refractive index\n",
+ "n2=1.46 # cladding refractive index\n",
+ "a=2.5 # radius in um\n",
+ "y=0.85 # wavelength in um\n",
+ "dl=(n1-n2)/n1 # index difference\n",
+ "v=(2*math.pi*a*n1*math.pow((2*dl),(0.5)))/y #the normaised frequency\n",
+ "M=(v*v)/2 # number of modes\n",
+ "print \" The number of modes= \",int(M)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number of modes= 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example14: PgNo-101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Initialisation of variables\n",
+ "a=25 # radius in um\n",
+ "y=1.3 # wavelength in um\n",
+ "v=26.6 # the normaised frequency\n",
+ "NA=(v*y)/(2*math.pi*a) #Numerical aperture\n",
+ "a_c=math.pi*math.pow((NA),2)\n",
+ "M=(v*v)/2\n",
+ "\n",
+ "# Results\n",
+ "print ('%s %.3f' %(\" The number of modes= \", NA))\n",
+ "print ('%s %.3f' %(\"\\n The number of modes= \", a_c))\n",
+ "print (\"\\n Answer in textbook is wrong\")\n",
+ "print \"\\n The number of modes= \",int(M)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number of modes= 0.220\n",
+ "\n",
+ " The number of modes= 0.152\n",
+ "\n",
+ " Answer in textbook is wrong\n",
+ "\n",
+ " The number of modes= 353\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example15: PgNo-103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Declaration of variables\n",
+ "n1=1.49 # core refractive index\n",
+ "n2=1.47 # cladding refractive index\n",
+ "a=2 # radius in um\n",
+ "dl=(n1-n2)/n1 # index difference\n",
+ "v_c=2.405\n",
+ "\n",
+ "# calculations\n",
+ "y_c=(2*math.pi*a*n1*math.pow((2*dl),(0.5)))/v_c # cut off wavelength in um\n",
+ "Y=1.31 # wavelength in um\n",
+ "A=(v_c*Y)/(2*math.pi*n1*math.pow((2*dl),(0.5))) # min core radius in um\n",
+ "\n",
+ "# Results\n",
+ "print ('%s %.3f %s' %(\" The cut off wavelength = \",y_c,\"um\"))\n",
+ "print ('%s %.3f %s' %(\"\\n The min core radius = \",A,\"um\"))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The cut off wavelength = 1.276 um\n",
+ "\n",
+ " The min core radius = 2.054 um\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example16: PgNo-105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Initialisation of variables\n",
+ "a=25 # radius in um\n",
+ "NA=0.3 # Numerical aperture\n",
+ "y=1 # wavelength in um\n",
+ "v=(2*math.pi*a*NA)/y # the normalised frequency\n",
+ "V=47.1 # the normalised frequency\n",
+ "M=(V*V)/4 # The mode volume\n",
+ "\n",
+ "# Results\n",
+ "print ('%s %.2f' %(\" The normalised frequency = \",v))\n",
+ "print \"\\n The mode volume = \",int(M),\"guided modes\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The normalised frequency = 47.12\n",
+ "\n",
+ " The mode volume = 554 guided modes\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example17: PgNo-107"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# variable declaration\n",
+ "n1=1.46 # core refractive index\n",
+ "a=4.5 # radius in um\n",
+ "dl=0.0025 # relative index difference\n",
+ "v_c=2.405\n",
+ "\n",
+ "# calculations\n",
+ "y_c=(2*math.pi*a*n1*math.pow((2*dl),(0.5)))/v_c # cut off wavelength in um\n",
+ "\n",
+ "print ('%s %.3f %s' %(\" The cut off wavelength = \",y_c,\"um\"))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The cut off wavelength = 1.214 um\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example18: PgNo-109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Initialisation of variables\n",
+ "n1=1.5 #core refractive index\n",
+ "n2=1.45 # cladding refractive index\n",
+ "a=50 # radius in um\n",
+ "y=1.3 #operating wavelength in um\n",
+ "\n",
+ "# calculations\n",
+ "NA=math.sqrt(math.pow(n1,2)-math.pow(n2,2)) # numerical aperture\n",
+ "N_A=0.38 \n",
+ "v=(2*math.pi*a*N_A)/y # cut of numbers\n",
+ "M=math.pow(v,2)/2 # number of modes\n",
+ "\n",
+ "print ('%s %.2f'%(\" The cut of numbers = \",v))\n",
+ "print \"\\n The number of modes = \",int(M)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The cut of numbers = 91.83\n",
+ "\n",
+ " The number of modes = 4216\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example19: PgNo-111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Variable initialisation\n",
+ "n1=1.53 # core refractive index\n",
+ "n2=1.5 # cladding refractive index\n",
+ "y=1.5 # operating wavelength in um\n",
+ "\n",
+ "# calculation\n",
+ "NA=math.sqrt(math.pow(n1,2)-math.pow(n2,2)) # numerical aperture\n",
+ "a=(2.405*y)/(2*math.pi*NA)# max radius in um\n",
+ "\n",
+ "print ('%s %.2f %s' %(\" The max core radius = \",a,\"um\"))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The max core radius = 1.90 um\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example20: PgNo-112"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# variable declaration\n",
+ "a=25 # max radius in um\n",
+ "y=0.8 # operating wavelength in um\n",
+ "NA=0.343 # numerical aperture\n",
+ "v=(2*math.pi*a*NA)/y # v-number\n",
+ "M=math.pow(v,2)/2 #number of modes\n",
+ "\n",
+ "print ('%s %.6f' %(\" The v-number = \",v))\n",
+ "print \"\\n The number of modes = \",int(M)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The v-number = 67.347893\n",
+ "\n",
+ " The number of modes = 2267\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example21: PgNo-114"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Initialisation of variables\n",
+ "n1=1.5 #core refractive index\n",
+ "NA=0.38 # numerical aperture\n",
+ "v=75 # v-number\n",
+ "y=1.3 # operating wavelength in um\n",
+ "a=(v*y)/(2*math.pi*NA) # core radius in um\n",
+ "n2=math.sqrt(math.pow(n1,2)-math.pow(NA,2))# cladding refractive index\n",
+ "\n",
+ "# Results\n",
+ "print ('%s %.2f %s' %(\" The core radius = \",a,\"um\"))\n",
+ "print ('%s %.2f' %(\"\\n The cladding refractive index = \", n2))\n",
+ "print (\"\\n answer in textbook is wrong \")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The core radius = 40.84 um\n",
+ "\n",
+ " The cladding refractive index = 1.45\n",
+ "\n",
+ " answer in textbook is wrong \n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example22: PgNo-117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Initialisation of variables\n",
+ "y=1.2 # operating wavelength in um\n",
+ "w=5 # spot size in um\n",
+ "x=(2*y)/(math.pi*w) # the divergence angle in degree\n",
+ "\n",
+ "# results\n",
+ "print ('%s %.3f %s' %(\" The divergence angle = \",x,\"degree\"))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The divergence angle = 0.153 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example23: PgNo-119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Initialisation of variables\n",
+ "n1=1.46 # core refractive index\n",
+ "a=4.5 # core radius in um\n",
+ "dl=0.0025 # relative index difference\n",
+ "NA=n1*(math.sqrt(2*dl)) # numerical aperture\n",
+ "v=2.405\n",
+ "y=(2*math.pi*a*NA)/(v) # cut off wavelength in um\n",
+ "\n",
+ "print ('%s %.3f %s' %(\" The cut off wavelength = \",y,\"um\"))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The cut off wavelength = 1.214 um\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example24: PgNo-121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# variable declaration\n",
+ "n1=1.5 # core refractive index\n",
+ "n2=1.47 # cladding refractive index\n",
+ "y1=0.87 # operating wavelength in um\n",
+ "y2=1.5 # operating wavelength in um\n",
+ "a=25.0 # max radius in um\n",
+ "\n",
+ "# Calculations\n",
+ "NA=math.sqrt(math.pow(n1,2)-math.pow(n2,2)) # numerical aperture\n",
+ "v1=(2*math.pi*a*NA)/y1\n",
+ "v2=(2*math.pi*a*NA)/y2\n",
+ "al=2.0 # parabolic index profile for GRIN\n",
+ "M1=(al/(al+2))*(math.pow(v1,2)/2)# number of modes\n",
+ "M2=(al/(al+2))*(math.pow(v2,2)/2)# number of modes\n",
+ "\n",
+ "# Results\n",
+ "print \" The number of modes at 870 nm = \",int(M1),\"um\"\n",
+ "print \"\\n The number of modes = \",int(M2),\"um\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number of modes at 870 nm = 726 um\n",
+ "\n",
+ " The number of modes = 244 um\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example25: PgNo-122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Initialisation of variables\n",
+ "n1=1.5 # core refractive index\n",
+ "n2=1.46 # cladding refractive index\n",
+ "v=2.4 # cut off parameter\n",
+ "y=0.85 # operating wavelength in um\n",
+ "\n",
+ "# Calculations\n",
+ "NA=math.sqrt(math.pow(n1,2)-math.pow(n2,2)) # numerical aperture\n",
+ "a=(v*y)/(2*math.pi*NA)# max radius in um\n",
+ "w=v*a # spot size\n",
+ "x=(2*y)/(3.4*w) # divergence angle in degree\n",
+ "d=50 # distance in meter\n",
+ "w_s=(y*d)/(math.pi*w) # spot size at 50 meter\n",
+ "\n",
+ "# Results\n",
+ "print ('%s %.2f %s' %(\" The numerical aperture = \",NA,\"um\"))\n",
+ "print ('%s %.2f %s' %(\"\\n The max core radius = \",a,\"um\"))\n",
+ "print ('%s %.2f %s' %(\"\\n The spot size = \",w,\"um\"))\n",
+ "print ('%s %.3f %s' %(\"\\n The divergence angle = \",x,\"degree\"))\n",
+ "print ('%s %.2f %s' %(\"\\n The spot size at 50 meter = \",w_s,\"m\"))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The numerical aperture = 0.34 um\n",
+ "\n",
+ " The max core radius = 0.94 um\n",
+ "\n",
+ " The spot size = 2.26 um\n",
+ "\n",
+ " The divergence angle = 0.221 degree\n",
+ "\n",
+ " The spot size at 50 meter = 5.97 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example26: PgNo-124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Initialisation of variables\n",
+ "n1=1.53 # core refractive index\n",
+ "n2=1.50 # cladding refractive index\n",
+ "y=1.2 # wavelength in um\n",
+ "v=2.405\n",
+ "a=(v*y)/(2*math.pi*(math.sqrt(math.pow(n1,2)-math.pow(n2,2)))) #core radius in micrometer\n",
+ "\n",
+ "print ('%s %.3f %s' %(\" The max diameter= \",2*a,\"um\"))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The max diameter= 3.047 um\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example27: PgNo-127"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# Initialisation of variables\n",
+ "n1=1.47 # core refractive index\n",
+ "n2=1.46 # cladding refractive index\n",
+ "y=1.3 # wavelength in um\n",
+ "dl=(n1-n2)/n1 # fractional refractive index diff\n",
+ "\n",
+ "# calculations\n",
+ "NA=math.sqrt(math.pow(n1,2)-math.pow(n2,2))\n",
+ "v=2.405\n",
+ "a=(v*y)/(2*math.pi*(math.sqrt(math.pow(n1,2)-math.pow(n2,2))))# largest core radius in micrometer\n",
+ "n_eff=n1-(NA/(2*math.pi*(a/y))) # fractional refractive index\n",
+ "\n",
+ "# Results\n",
+ "print ('%s %.2f %s' %(\" The largest core radius = \",a,\"um\"))\n",
+ "print ('%s %.2f' %(\"\\n The fractional refractive index= \",n_eff))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The largest core radius = 2.91 um\n",
+ "\n",
+ " The fractional refractive index= 1.46\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example28: PgNo-130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# initialisation of variables\n",
+ "n1=1.50 # core refractive index\n",
+ "n2=1.48 # cladding refractive index\n",
+ "NA=math.sqrt(math.pow(n1,2)-math.pow(n2,2)) # numerical aperture\n",
+ "a=25 # core radius in um\n",
+ "y=0.85 # wavelength in um\n",
+ "v=(2*math.pi*a*NA)/y #cut off parameter\n",
+ "M=math.pow(v,2)/2 # number of modes\n",
+ "\n",
+ "# Results\n",
+ "print ('%s %.3f' %(\" The cut off parameter = \",v))\n",
+ "print \"\\n The number of modes = \",int(M)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The cut off parameter = 45.115\n",
+ "\n",
+ " The number of modes = 1017\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example29: PgNo-132"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# initialisation of variables\n",
+ "n1=1.50 # core refractive index\n",
+ "a=25 # core radius in um\n",
+ "y=1.5 # wavelength in um\n",
+ "v=2.405\n",
+ "\n",
+ "# Calculations\n",
+ "NA=(v*y)/(2*math.pi*a) # numerical aperture\n",
+ "D=math.pow((NA/n1),2)/(2) # max value of D\n",
+ "n2=n1-(D*n1) # cladding refractive index\n",
+ "\n",
+ "# Results\n",
+ "print ('%s %.6f' %(\" The max value of D = \",D))\n",
+ "print ('%s %.2f' %(\"\\n The cladding refractive index = \",n2))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The max value of D = 0.000117\n",
+ "\n",
+ " The cladding refractive index = 1.50\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example30: PgNo-133"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# variable declaration\n",
+ "n1=1.52 #core refractive index\n",
+ "n2=1.48 #cladding refractive index\n",
+ "a=45 # core radius in um\n",
+ "y=0.85 # wavelength in um\n",
+ "\n",
+ "# Calculations\n",
+ "dl=(n1-n2)/n1 # relative refractive index\n",
+ "x=(math.asin(n2/n1))*(180/math.pi) # critical angle in degree\n",
+ "NA=math.sqrt(math.pow(n1,2)-math.pow(n2,2)) #numerical aperture\n",
+ "a_c=(math.asin(NA))*(180/math.pi) #acceptance angle in degree\n",
+ "a_s=math.pi*(math.pow(n1,2)-math.pow(n2,2))# solid acceptance angle\n",
+ "v=(2*math.pi*a*0.34)/y # normalise v-number\n",
+ "M=math.pow(v,2)/2 # number of guided modes\n",
+ "a1=5 # for single mode step fiber\n",
+ "v1=(2*math.pi*a1*0.34)/y\n",
+ "M1=math.pow(v1,2)/2\n",
+ "R=int(M)-int(M1)# reduction in modes\n",
+ "\n",
+ "# Results\n",
+ "print ('%s %.4f' %(\" The max value of D = \",dl))\n",
+ "print ('%s %.2f %s' %(\"\\n The critical angle = \",x,\"degree\"))\n",
+ "print ('%s %.2f %s' %(\"\\n The acceptance angle = \",2*a_c,\"degree\"))\n",
+ "print ('%s %.2f %s' %(\"\\n The solid acceptance angle = \",a_s,\"degree\"))\n",
+ "print ('%s %.2f ' %(\"\\n The numerical aperture = \",NA))\n",
+ "print ('%s %.2f ' %(\"\\n The normalise v-number = \",v))\n",
+ "print \"\\n The number of guided modes = \",int(M)\n",
+ "print \"\\n The reduction in modes = \",R\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The max value of D = 0.0263\n",
+ "\n",
+ " The critical angle = 76.83 degree\n",
+ "\n",
+ " The acceptance angle = 40.54 degree\n",
+ "\n",
+ " The solid acceptance angle = 0.38 degree\n",
+ "\n",
+ " The numerical aperture = 0.35 \n",
+ "\n",
+ " The normalise v-number = 113.10 \n",
+ "\n",
+ " The number of guided modes = 6395\n",
+ "\n",
+ " The reduction in modes = 6317\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example31: PgNo-135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# Initialisation of variables\n",
+ "\n",
+ "n1=1.46 #core refractive index\n",
+ "a=45/2 #max radius in um\n",
+ "y=0.85 # operating wavelength in um\n",
+ "NA=0.17 # numerical aperture\n",
+ "v=(2*math.pi*a*NA)/y #normalised frequency\n",
+ "M=math.pow(v,2)/2 # number of modes\n",
+ "\n",
+ "# Results\n",
+ "print ('%s %.2f' %(\" The normalised frequency = \",v))\n",
+ "print \"\\n The number of modes = \",int(M)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The normalised frequency = 27.65\n",
+ "\n",
+ " The number of modes = 382\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file