{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#10: Optical Materials"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.1, Page number 10.61"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "wavelength of emission is 8628.0 angstrom\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "h=6.626*10**-34;       #plancks constant(J s)\n",
    "c=3*10**8;     #velocity of light(m/s)\n",
    "Eg=1.44*1.6*10**-19;    #band gap(J)\n",
    "\n",
    "#Calculation\n",
    "lamda=h*c/Eg;      #wavelength of emission(m)\n",
    "\n",
    "#Result\n",
    "print \"wavelength of emission is\",round(lamda*10**10),\"angstrom\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.2, Page number 10.61"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "band gap is 0.8 eV\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "lamda=1.55;     #wavelength(micro m)\n",
    "\n",
    "#Calculation\n",
    "Eg=1.24/lamda;     #band gap(eV)\n",
    "\n",
    "#Result\n",
    "print \"band gap is\",Eg,\"eV\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.3, Page number 10.61"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "number of electron-hole pairs is 3.25 *10**5\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "eta=0.65;     #quantum efficiency\n",
    "n=5*10**5;    #number of photons incident\n",
    "\n",
    "#Calculation\n",
    "N=eta*n;      #number of electron-hole pairs\n",
    "\n",
    "#Result\n",
    "print \"number of electron-hole pairs is\",N/10**5,\"*10**5\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.4, Page number 10.61"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "responsibility is 0.628 A/W\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "eta=0.6;     #quantum efficiency\n",
    "q=1.6*10**-19;    #charge(coulomb)\n",
    "lamda=1.3*10**-6;    #lamda(m)\n",
    "h=6.625*10**-34;       #plancks constant(J s)\n",
    "c=3*10**8;     #velocity of light(m/s)\n",
    "\n",
    "#Calculation\n",
    "R=eta*q*lamda/(h*c);     #responsibility(A/W)\n",
    "\n",
    "#Result\n",
    "print \"responsibility is\",round(R,3),\"A/W\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.5, Page number 10.61"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "multiplication factor is 41\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "eta=0.7;     #quantum efficiency\n",
    "q=1.6*10**-19;    #charge(coulomb)\n",
    "lamda=863*10**-9;    #lamda(m)\n",
    "P0=0.5*10**-6;     #optical power(W)\n",
    "h=6.625*10**-34;       #plancks constant(J s)\n",
    "c=3*10**8;     #velocity of light(m/s)\n",
    "IT=10*10**-6;    #current(A)\n",
    "\n",
    "#Calculation\n",
    "IP=eta*q*lamda*P0/(h*c);\n",
    "M=IT/IP;       #multiplication factor\n",
    "\n",
    "#Result\n",
    "print \"multiplication factor is\",int(M)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.6, Page number 10.62"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "critical angle is 78.5 degrees\n",
      "numerical aperture is 0.3\n",
      "acceptance angle is 17.4 degrees\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "n2=1.47;              #refractive index of cladding\n",
    "n1=1.5;    #refractive index of core\n",
    "\n",
    "#Calculation\n",
    "phi_c=math.asin(n2/n1);     #critical angle(radian)\n",
    "phi_c=phi_c*180/math.pi;    #critical angle(degrees)\n",
    "NA=math.sqrt(n1**2-n2**2);     #numerical aperture\n",
    "phi_max=math.asin(NA);       #acceptance angle(radian)\n",
    "phi_max=phi_max*180/math.pi;    #acceptance angle(degrees)\n",
    "\n",
    "#Result\n",
    "print \"critical angle is\",round(phi_c,1),\"degrees\"\n",
    "print \"numerical aperture is\",round(NA,1)\n",
    "print \"acceptance angle is\",round(phi_max,1),\"degrees\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.7, Page number 10.62"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "total number of guided modes is 490.0\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "d=50*10**-6;     #diameter(m)\n",
    "NA=0.2;      #numerical aperture(m)\n",
    "lamda=1*10**-6;    #wavelength(m)\n",
    "\n",
    "#Calculation\n",
    "N=4.9*(d*NA/lamda)**2;     #total number of guided modes\n",
    "\n",
    "#Result\n",
    "print \"total number of guided modes is\",N"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.8, Page number 10.62"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "total number of guided modes is 1\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "d=5*10**-6;     #diameter(m)\n",
    "n2=1.447;              #refractive index of cladding\n",
    "n1=1.45;    #refractive index of core\n",
    "lamda=1*10**-6;    #wavelength(m)\n",
    "\n",
    "#Calculation\n",
    "NA=math.sqrt(n1**2-n2**2);      #numerical aperture\n",
    "N=4.9*(d*NA/lamda)**2;     #total number of guided modes\n",
    "\n",
    "#Result\n",
    "print \"total number of guided modes is\",int(N)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.9, Page number 10.63"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "numerical aperture is 0.46\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "n1=1.46;    #refractive index of core\n",
    "delta=0.05;    #refractive index difference\n",
    "\n",
    "#Calculation\n",
    "NA=n1*math.sqrt(2*delta);     #numerical aperture\n",
    "\n",
    "#Result\n",
    "print \"numerical aperture is\",round(NA,2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.10, Page number 10.63"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "V number is 94.72\n",
      "maximum number of modes is 4486.0\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "a=50;\n",
    "n2=1.5;              #refractive index of cladding\n",
    "n1=1.53;    #refractive index of core\n",
    "lamda0=1;    #wavelength(micro m)\n",
    "\n",
    "#Calculation\n",
    "V_number=round(2*math.pi*a*math.sqrt(n1**2-n2**2)/lamda0,2);     #V number\n",
    "n=V_number**2/2;     #maximum number of modes\n",
    "\n",
    "#Result\n",
    "print \"V number is\",V_number\n",
    "print \"maximum number of modes is\",round(n)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.11, Page number 10.63"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "total number of modes is 49178.0\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "a=100*10**-6;\n",
    "NA=0.3;      #numerical aperture(m)\n",
    "lamda=850*10**-9;    #wavelength(m)\n",
    "\n",
    "#Calculation\n",
    "V_number=round(2*math.pi**2*a**2*NA**2/lamda**2);     #number of modes\n",
    "\n",
    "#Result\n",
    "print \"total number of modes is\",2*V_number"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.12, Page number 10.63"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "cutoff wavelength is 1.315 micro m\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "a=25*10**-6;\n",
    "n1=1.48;    #refractive index of core\n",
    "delta=0.01;    #refractive index difference\n",
    "V=25;     #Vnumber\n",
    "\n",
    "#Calculation\n",
    "lamda=2*math.pi*a*n1*math.sqrt(2*delta)/V;      #cutoff wavelength(m)\n",
    "\n",
    "#Result\n",
    "print \"cutoff wavelength is\",round(lamda*10**6,3),\"micro m\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.13, Page number 10.63"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "maximum value of core radius is 9.95 micro m\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "V=2.405;     #Vnumber\n",
    "lamda=1.3;    #wavelength(micro m)\n",
    "NA=0.05;      #numerical aperture(m)\n",
    "\n",
    "#Calculation\n",
    "amax=V*lamda/(2*math.pi*NA);     #maximum value of core radius(micro m)\n",
    "\n",
    "#Result\n",
    "print \"maximum value of core radius is\",round(amax,2),\"micro m\""
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}