{
 "metadata": {
  "name": "Chapter_2"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": "Chapter 2 : Optical fiber waveguides\n"
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 2.1,  page 19"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math\n\n#Variable declaration\nn1=1.50                   #core refractive index\nn2=1.47                   #cladding refractive index\n\n#Calculation\nphic=math.asin(n2/n1)*180/(math.pi)     #critical angle at core cladding\nNA=math.sqrt(n1**2-n2**2)               #numerical aperture\nphia=math.asin(NA)*180/math.pi          #acceptance angle in air\n\n#Result\nprint'(a) Critical angle at the core-cladding = %.1f\u00b0'%phic\nprint'(b) NA for the fiber = %.2f'%NA\nprint'(c) Acceptance angle in air for the fiber = %.1f\u00b0'%phia",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "(a) Critical angle at the core-cladding = 78.5\u00b0\n(b) NA for the fiber = 0.30\n(c) Acceptance angle in air for the fiber = 17.4\u00b0\n"
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 2.2,  page 20"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math\n\n#Variable declaration\ndelta=0.01                           #relative refractive index = 1%\nn1=1.46                               #core index\n\n#Calculation\nNA=n1*math.sqrt(2*delta)             #numerical aperture\nzeta=math.pi*(NA)**2                 #solid acceptance angle\nn12=1-delta                          #ratio of(n2/n1)\nphic=math.asin(n12)*180/math.pi      #critical angle\n\n#Result\nprint'Numerical aperture (NA) = %.2f'%NA\nprint'Solid acceptance angle = ',round((zeta),2),'rad'\nprint'Critical angle at core-cladding = %.1f\u00b0'%phic",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Numerical aperture (NA) = 0.21\nSolid acceptance angle =  0.13 rad\nCritical angle at core-cladding = 81.9\u00b0\n"
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 2.3,  page 23"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math\n\n#variable declaration\nNA=0.4                                              #numerical aperture\ny=50*math.pi/180                                    #angle between projection of the ray and radius of fibre of core (radians)\n\n#Calculation\nphia1=math.asin(NA)*180/math.pi                     #acceptance angle for meridional rays\nphia2=math.asin(NA/(math.cos(y)))*180/math.pi       #acceptance angle for skew rays\n\n#Result\nprint'Acceptance angle for meridional rays = %.1f\u00b0'%phia1\nprint'Acceptance angle for skew rays = %.1f\u00b0'%phia2\nprint\"Therefore, acceptance angle for the skew rays is about 15\u00b0 greater thanthe corresponding angle for meridional rays\"",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Acceptance angle for meridional rays = 23.6\u00b0\nAcceptance angle for skew rays = 38.5\u00b0\nTherefore, acceptance angle for the skew rays is about 15\u00b0 greater thanthe corresponding angle for meridional rays\n"
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 2.4,  page 45"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math\n\n#variable declaration\nn1=1.48                                              #core index\na=40*10**-6                                          #radius of core\ndelta=1.5/100                                        #relative refractive index = 1.5%\nh=0.85*10**-6                                        #operating wavelength\n\n#Calculation \nV=(2*math.pi*a*n1*math.sqrt(2*delta))/h              #normalized frequency for the fiber\nMs=(V**2)/2                                          #no of guided modes\n\n#Result\nprint 'Normalised frequency, V = %.1f'%V\nprint'Total number of guided modes, Ms = %d'%round(Ms)",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Normalised frequency, V = 75.8\nTotal number of guided modes, Ms = 2872\n"
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 2.5,  page 54"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math\n\n#variable declaration\nNA=0.2                                            #numerical aperture\na=25*10**-6                                       #radius of core\nh=1*10**-6                                        #operating wavelength\n\n#Calculation \nV=(2*math.pi*a*NA)/h                             #normalized frequency for the fiber\nMg=(V**2)/4                                      #no of guided modes gor parabolic profile\n\n#Result\nprint 'Normalised frequency, V = %.1f'%V\nprint'Total number of guided modes, Mg = %d'%round(Mg)",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Normalised frequency, V = 31.4\nTotal number of guided modes, Mg = 247\n"
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 2.6,  page 55"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math\n#variable declaration\nn1=1.48                                                         #core index        \nh=0.85*10**-6                                                   #operating wavelength\nV=2.4                                                           #normalized frequency for the fiber\ndelta=1.5/100                                                   #relative refractive index (RRI)= 1.5%\ndelta1=delta/10                                               #RRI difference reduced by 10\n\n#Calculation\na=(V*h)/(2*math.pi*n1*math.sqrt(2*delta))                       #radius of core\nd=2*a\na1=(V*h)/(2*math.pi*n1*math.sqrt(2*delta1))                     #new radius of core\nd1=2*a1\n\n#Result\nprint 'Maximum core diameter for relative refractive index of 1.5 percent  = ',round((d*10**6),2),\"um\"\nprint \"Maximum core diameter for relative refractive index  = \",round(d1*10**6),\"um\"",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Maximum core diameter for relative refractive index of 1.5 percent  =  2.53 um\nMaximum core diameter for relative refractive index  =  8.0 um\n"
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 2.7,  page 2.7"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math\n#variable declaration\nn1=1.5                                                          #core index \ndelta=0.01                                                      #relative refractive index (RRI)= 1%\nh=1.3*10**-6                                                    #operating wavelength\nalph=2\n\n#Calculation\nV=(2.4)*math.sqrt(1+(2/alph))                                   #normalized frequency for the fiber\na=(V*h)/(2*math.pi*n1*math.sqrt(2*delta))                       #radius of core\nd=2*a\n\n#Result\nprint \"Maximum core diameter for relative refractive index  = \",round(d*10**6,1),\"um\"",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Maximum core diameter for relative refractive index  =  6.6 um\n"
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 2.8,  page 60"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math\n#Variable declaration\na=4.5*10**-6                                                   #radius of core\nn1=1.46                                                        #core index \ndelta=0.25/100                                                 #relative refractive index (RRI)= 0.25%\n\n\n#Calculation \nhc=(2*math.pi*a*n1*math.sqrt(2*delta))/2.405                    #cutoff wavelength\n\n\n#Result\nprint 'Fibre is single moded to a wavelength = ',round(hc*10**9),'nm'",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Fibre is single moded to a wavelength =  1214.0 nm\n"
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 2.10,  page 69"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math\n#Variable declaration\nwo=5.8*10**-6                                   #spot size            \nV=2.2                                         #normalized frequency\n\n#Calculation \na=wo/((0.65+1.619*V**(-1.5))+(2.879*V**-6))     #radius of the core\nd=2*a\n\n#Result\nprint'Fibre core diameter = ',round(d*10**6,1),\"um\"\n",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Fibre core diameter =  9.9 um\n"
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 2.11,  page 73"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math\n#Variable declaration\nh=1.30*10**-6                            #operating wavelength  \nhc=1.08*10**-6                            #cutoff wavelength\ntheta=12                                   #in angle (degree)\n\n#Calculation \naeff=3.832*h/(2*math.pi*math.sin(theta))                     #effective core radius\nVeff=2.405*hc/h                                               #effective normalised frequency\nwo=3.81*10**-6*(0.6043+(1.755*Veff**-1.5)+(2.78*Veff**-6))    #spot size\n\n#Result\nprint 'Spot size = ',round(wo*10**6,2),'um'",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Spot size =  4.84 um\n"
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 2.12,  page 74"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math\n\n#Variable declaration\nwo=5.2*10**-6                                     #spot size\nn1=1.485                                          #core index\nhc=1.190*10**-6                                   #cutoff wavelength\n\n#Calculation \naesi=1.820*wo                                     #ESI core radius\nD=(0.293/n1**2)*(hc/aesi)**2                      #ESI relative index difference\n\n#Result\nprint'ESI relative refractive index difference = ',round(D*10**2,2),'%'",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "ESI relative refractive index difference =  0.21 %\n"
      }
     ],
     "prompt_number": 22
    }
   ],
   "metadata": {}
  }
 ]
}