{
 "metadata": {
  "name": "",
  "signature": "sha256:161f2af28057c1d070e2d9170a764b41538f5b5faa1a2af8f60c6674471beb1e"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 2: Optical fibers: Structures, Waveguiding, and Fabrication"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.1, Page Number: 37"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#variable declaration\n",
      "n1 = 1.48                           #core refractive index for glass n1\n",
      "n2 = 1.00                           #core refractive index for air n2\n",
      "\n",
      "#calculation\n",
      "phic = math.asin(n2/n1)             #Interflaction reflaction angle(degree)\n",
      "\n",
      "#result\n",
      "print  \"Total Interflaction reflaction angle = \",round(phic*57.3,1),\"degree\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Total Interflaction reflaction angle =  42.5 degree\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2, Page Number: 45"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#variable declaration\n",
      "n1=1.48                              #core refractive index\n",
      "n2=1.46                              #cladding refractive index\n",
      "\n",
      "#calculation\n",
      "phiC=math.degrees(math.asin(n2/n1))       #critical angle (degree)\n",
      "NA=math.sqrt((n1*n1)-(n2*n2))             #numerical apperture\n",
      "phiO=math.degrees(math.asin(NA))          #maximum entrance angle (degree)\n",
      "\n",
      "#result\n",
      "print \"Critical angle =\" ,round(phiC,1),\"degree\"\n",
      "print \"Numerical apperture =\" ,round(NA,3)\n",
      "print \"Acceptance angle =\" ,int(phiO),\"degree\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Critical angle = 80.6 degree\n",
        "Numerical apperture = 0.242\n",
        "Acceptance angle = 14 degree\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.3 , Page Number: 58"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#variable declaration\n",
      "V=26.6                          #normalized frequency\n",
      "lamda=1300*1e-9                 #wavelength(nm)\n",
      "a=25*1e-6                       #core radius(um)\n",
      "\n",
      "\n",
      "#caculation\n",
      "NA=(V*lamda)/(2*math.pi*a)      #numerical aperture\n",
      "\n",
      "#result\n",
      "print \"Numerical aperture =\",round(NA,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Numerical aperture = 0.22\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.4 , Page Number: 62"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math   \n",
      " \n",
      "#variable declaration\n",
      "V2 = 22                      #normalized frequency2\n",
      "V1=39                        #normalized frequency1\n",
      "p=1.4   \n",
      "\n",
      "#calculation\n",
      "M1=(V1**2)/2                         #modes in fiber1\n",
      "M2=V2**2/2                           #modes in fiber2\n",
      "Pcladd_P1 = (4/3)*(M1**(-0.5))*p\n",
      "Pcore_P1= 1-Pcladd_P1\n",
      "Pcladd_P2 = (4/3)*(M2**(-0.5))*p\n",
      "Pcore_P2= 1-Pcladd_P2    \n",
      "\n",
      "#result\n",
      "print 'case1 : Total number of modes',M1\n",
      "print 'case1 : Percent age of power propagates in the cladding',int(Pcladd_P1 *100)\n",
      "print 'case2 : Total number of modes',M2\n",
      "print 'case2 : Percent age of power propagates in the cladding',int(round(Pcladd_P2 *100,0)) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "case1 : Total number of modes 760\n",
        "case1 : Percent age of power propagates in the cladding 5\n",
        "case2 : Total number of modes 242\n",
        "case2 : Percent age of power propagates in the cladding 9\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.5 , Page Number: 65"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      " \n",
      "#variable declaration\n",
      "lamda=1300*1e-9               #wavelength(nm)\n",
      "Lp=8*1e-2                     #beat length(cm)\n",
      "\n",
      "#calculation\n",
      "Bf=lamda/Lp                   #modal birefringence\n",
      "bita=(2*math.pi)/Lp           #birefringence(1/m)\n",
      "\n",
      "#result\n",
      "print \"Modal birefringence =\",round(Bf,7)\n",
      "print \"Birefringence Bita =\",bita,\"1/m\"  "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Modal birefringence = 1.62e-05\n",
        "Birefringence Bita = 78.5398163397 1/m\n"
       ]
      }
     ],
     "prompt_number": 15
    }
   ],
   "metadata": {}
  }
 ]
}