{
 "metadata": {
  "name": "",
  "signature": "sha256:1cf24b70876a8aeb6aa008651e71d8cde215c5cbb4fe65495bcd461a3cc2b49b"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter24-Fibre Optics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1-pg701"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##Example 24.1\n",
      "##Fiber optics\n",
      "\n",
      "##given values\n",
      "n=1.5;##refractive index\n",
      "x=.0005;##fractional index difference\n",
      "\n",
      "##calculation\n",
      "u=n*(1-x);\n",
      "print'%s %.2f %s'%('cladding index is',u,'');\n",
      "alpha=math.asin(u/n)*180/math.pi;\n",
      "print'%s %.2f %s'%('critical internal reflection angle(in degree) is',alpha,'');\n",
      "theta=math.asin(math.sqrt(n**2-u**2))*180/math.pi;\n",
      "print'%s %.2f %s'%('critical acceptance angle(in degree) is',theta,'');\n",
      "N=n*math.sqrt(2.*x);\n",
      "print'%s %.2f %s'%('numerical aperture is',N,'');"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "cladding index is 1.50 \n",
        "critical internal reflection angle(in degree) is 88.19 \n",
        "critical acceptance angle(in degree) is 2.72 \n",
        "numerical aperture is 0.05 \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex2-pg701"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##Example 24.2\n",
      "##calculation of acceptance angle\n",
      "\n",
      "##given values\n",
      "n=1.59;##cladding refractive index\n",
      "u=1.33;##refractive index of water\n",
      "N=.20;##numerical aperture offibre\n",
      "##calculation\n",
      "x=math.sqrt(N**2+n**2.);##index of fibre\n",
      "N1=math.sqrt(x**2-n**2.)/u;##numerical aperture when fibre is in water\n",
      "alpha=math.asin(N1)*180./math.pi;\n",
      "print'%s %.2f %s'%('acceptance angle in degree is',alpha,'');"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "acceptance angle in degree is 8.65 \n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3-pg705"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##Example 24.3\n",
      "##calculation of normalised frequency\n",
      "\n",
      "##given values\n",
      "n=1.45;##core refractive index\n",
      "d=.6;##core diametre in m\n",
      "N=.16;##numerical aperture of fibre\n",
      "l=.9*10**-6.;##wavelength of light\n",
      "\n",
      "##calculation\n",
      "u=math.sqrt(n**2.+N**2.);##index of glass fibre\n",
      "V=math.pi*d*math.sqrt(u**2.-n**2.)/l;\n",
      "print'%s %.2f %s'%('normalised frequency is',V,'');"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "normalised frequency is 335103.22 \n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex4-pg705"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##Example 24.4\n",
      "##calculation of normailsed frequency and no of modes\n",
      "\n",
      "##given values\n",
      "n=1.52;##core refractive index\n",
      "d=29*10**-6.;##core diametre in m\n",
      "l=1.3*10**-6.;##wavelength of light\n",
      "x=.0007;##fractional refractive index\n",
      "\n",
      "##calculation\n",
      "u=n*(1.-x);##index of glass fibre\n",
      "V=math.pi*d*math.sqrt(n**2-u**2)/l;\n",
      "print'%s %.2f %s'%('normalised frequency is',V,'');\n",
      "N=V**2./2.;\n",
      "print'%s %.2f %s'%('no of modes is',N,'');"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "normalised frequency is 3.99 \n",
        "no of modes is 7.94 \n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex5-pg706"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##Example 24.5\n",
      "##calculation of numerical aperture and maximum acceptance angle\n",
      "\n",
      "##given values\n",
      "n=1.480;##core refractive index\n",
      "u=1.47;##index of glass\n",
      "l=850*10**-9.;##wavelength of light\n",
      "V=2.405;##V-number\n",
      "\n",
      "##calculation\n",
      "r=V*l/math.sqrt(n**2-u**2)/math.pi/2;##in m\n",
      "print'%s %.2f %s'%('core radius in micrometre is',r*10**6,'');\n",
      "N=math.sqrt(n**2-u**2);\n",
      "print'%s %.2f %s'%('numerical aperture is',N,'');\n",
      "alpha=math.asin(N)*180/math.pi;\n",
      "print'%s %.2f %s'%('max acceptance angle is',alpha,'');"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "core radius in micrometre is 1.89 \n",
        "numerical aperture is 0.17 \n",
        "max acceptance angle is 9.89 \n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex6-pg712"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##Example 24.6\n",
      "##calculation of power level\n",
      "\n",
      "##given values\n",
      "a=3.5;##attenuation in dB/km\n",
      "Pi=.5*10**-3.;##initial power level in W\n",
      "l=4.;##length of cable in km\n",
      "\n",
      "##calculation\n",
      "Po=Pi*10**6./(10**(a*l/10.));\n",
      "print'%s %.2f %s'%('power level after km(in microwatt) is',Po,'');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "power level after km(in microwatt) is 19.91 \n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex7-pg712"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "##Example 24.7\n",
      "##calculation of power loss\n",
      "\n",
      "##given values\n",
      "Pi=1*10**-3.;##initial power level in W\n",
      "l=.5;##length of cable in km\n",
      "Po=.85*Pi\n",
      "\n",
      "##calculation\n",
      "a=(10./l)*math.log10(Pi/Po);\n",
      "print'%s %.2f %s'%('loss in dB/km is',a,'');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "loss in dB/km is 1.41 \n"
       ]
      }
     ],
     "prompt_number": 7
    }
   ],
   "metadata": {}
  }
 ]
}