{
 "metadata": {
  "name": "",
  "signature": "sha256:4d772ceb697010a6070b0f71f390c487e44edcdb77789475508cd72b0c2457de"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 20 : Optical communication"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.1  Page No : 616"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#page no 616\n",
      "#prob no. 20.1\n",
      "\n",
      "# Variables\n",
      "lembda = 1300.*10**-9;   #wavwlength in m\n",
      "c = 3*10**8;            #speed of light in m/s\n",
      "\n",
      "# Calculations\n",
      "f = c/lembda           #in Hz\n",
      "\n",
      "# Results\n",
      "print 'frequency of laser is ,f = %.0f  THz'%(f*10**-12);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "frequency of laser is ,f = 231  THz\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.2  Page No : 619"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "theta_i = 30;    #degree\n",
      "ni = 1.00;       #incident refraction index\n",
      "nr = 1.52;       #refeacted ray refraction index\n",
      "\n",
      "# Calculations\n",
      "theta_r = math.asin(ni/nr*math.sin(theta_i*math.pi/180));    #in radians\n",
      "\n",
      "# Results\n",
      "print 'angle of refraction is %.2f  degree'%(theta_r*180/math.pi);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "angle of refraction is 19.20  degree\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.3  Page No : 620"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "theta_r = 90.;    #degree\n",
      "ni = 1.52;       #refraction index for crown glass\n",
      "nr = 1.00;       #refraction index for air\n",
      "\n",
      "# Calculations\n",
      "theta_i = math.asin(nr/ni*math.sin(theta_r*math.pi/180));    #in radians\n",
      "\n",
      "# Results\n",
      "print 'critical angle is %.2f  degree'%(theta_i*180/math.pi);\n",
      "#misprinted theta_r in the text\n",
      "#values are raunded up in the text\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "critical angle is 41.14  degree\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.4  Page No : 624"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "eta = .8;    #efficiency \n",
      "lembda = 850;  #nm\n",
      "\n",
      "# Calculations\n",
      "R = eta*lembda/1234;    #  A/W\n",
      "\n",
      "# Results\n",
      "print 'The responsivity of diode is R =  %.2f  A/W'%(R);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The responsivity of diode is R =  0.55  A/W\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.5  Page No : 624"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Calculations\n",
      "eta = .6;    #efficiency \n",
      "lembda = 1310;  #nm\n",
      "\n",
      "# Calculations\n",
      "R = eta*lembda/1234;    #  A/W\n",
      "\n",
      "# Results\n",
      "print 'The responsivity of diode is R =  %.2f  A/W'%(R);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The responsivity of diode is R =  0.64  A/W\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.6  Page No : 627"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Calculations\n",
      "L = .4*.8;    #loss in dB\n",
      "\n",
      "# Results\n",
      "print 'The loss usong this cable is L =  %.2f  dB'%(L);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The loss usong this cable is L =  0.32  dB\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.7  Page No : 627"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Calculations\n",
      "L = 2.7*.8;    #loss in dB\n",
      "\n",
      "# Results\n",
      "print 'The loss usong multimode cable is L =  %.2f  dB'%(L);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The loss usong multimode cable is L =  2.16  dB\n"
       ]
      }
     ],
     "prompt_number": 8
    }
   ],
   "metadata": {}
  }
 ]
}