{
 "metadata": {
  "name": "",
  "signature": "sha256:10bc56ed65806cbbee507a717cc3074e0bb64182283ec8c23086b1c40de0014f"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 8: Photonic Devices"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 8.1 Page no 293"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#given data \n",
      "NA=10**22               #in atoms/m**3\n",
      "ND=10**22               #in atoms/m**3\n",
      "De=25*10**-4           \t#in m**2/s\n",
      "Dh=10**-3\t\t#in m**2/s\n",
      "TAUeo=500\t\t#in ns\n",
      "TAUho=100\t\t#in ns\n",
      "ni=1.5*10**16\t\t#in atoms/m**3\n",
      "VR=-10\t\t\t#in Volt\n",
      "epsilon=11.6*8.854*10**-12\t#in F/m\n",
      "e=1.6*10**-19\t\t\t#in Coulamb\n",
      "VT=26\t\t\t\t#in mV\n",
      "GL=10**27\t\t\t#in m**-3 s**-1\n",
      "\n",
      "\n",
      "#calculation\n",
      "import math\n",
      "Le=math.sqrt(De*TAUeo*10**-9)\t#in um\n",
      "Le=Le*10**6\t\t\t#in um\n",
      "Lh=math.sqrt(Dh*TAUho*10**-9)\t#in um\n",
      "Lh=Lh*10**6\t\t\t#in um\n",
      "Vbi=VT*10**-3*math.log(NA*ND/ni**2)\t#in Volt\n",
      "Vo=Vbi\t\t\t\t#in Volt\n",
      "VB=Vo-VR\t\t\t#in Volt\n",
      "W=math.sqrt((2*epsilon*VB/e)*(1/NA+1/ND))\t#in um\n",
      "W=W*10**6\t\t\t#in um\n",
      "JL=e*(W+Le+Lh)*10**-6*GL\t#in A/cm**2\n",
      "\n",
      "#Result\n",
      "print \"Steady state photocurrent density is \",round(JL/10**4,3),\"A/cm**2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Steady state photocurrent density is  0.726 A/cm**2\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 8.2 Page no 295"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "import math\n",
      "W=25\t\t\t#in um\n",
      "PhotonFlux=10**21\t#in m**2s**-1\n",
      "alfa=10**5\t\t#in m**-1\n",
      "e=1.6*10**-19\t\t#in Coulambs\n",
      "\n",
      "#calculation\n",
      "GL1=alfa*PhotonFlux\t#in m**-3s**-1\n",
      "GL2=alfa*PhotonFlux*math.exp(-alfa*W*10**-6)\t#in m**-3s**-1\n",
      "JL=e*PhotonFlux*(1-math.exp(-alfa*W*10**-6))\t#in mA/cm**2\n",
      "\n",
      "#Result\n",
      "print\"Steady state photocurrent density is \",round(JL/10,2),\"mA/cm**2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Steady state photocurrent density is  14.69 mA/cm**2\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 8.3 Page no 304"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "NA=7.5*10**24\t\t#in atoms/m**3\n",
      "ND=1.5*10**22\t\t#in atoms/m**3\n",
      "De=25.0*10**-4\t\t#in m**2/s\n",
      "Dh=10.0**-3\t\t#in m**2/s\n",
      "TAUeo=500.0\t\t#in ns\n",
      "TAUho=100.0\t\t#in ns\n",
      "ni=1.5*10**16\t\t#in atoms/m**3\n",
      "VR=-10.0\t\t\t#in Volt\n",
      "epsilon=11.6*8.854*10**-12\t#in F/m\n",
      "e=1.6*10**-19\t\t#in Coulamb\n",
      "VT=26.0\t\t\t#in mV\n",
      "GL=10.0**27\t\t#in m**-3 s**-1\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "Le=math.sqrt(De*TAUeo*10**-9)\t#in m\n",
      "Le=Le*10**6\t\t\t#in um\n",
      "Lh=math.sqrt(Dh*TAUho*10**-9)\t#in m\n",
      "Lh=Lh*10**6\t\t\t#in um\n",
      "JS=e*(ni**2)*(De/(Le*10**-6*NA)+Dh/(Lh*10**-6*ND))\t#in A/cm**2\n",
      "JL=12.5\t\t\t\t#in mA/cm**2\n",
      "VOC=VT*math.log(1.0+((JL*10**-3)/(JS*10**-4)))\t\t#in Volt\n",
      "\n",
      "#Result\n",
      "print\"Open circuit voltage is\",round(VOC/1000,3),\"V\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Open circuit voltage is 0.522 V\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 8.4 Page no 304"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "Vout=28\t\t\t#in Volts\n",
      "Vcell=0.45\t\t#in Volt\n",
      "n=Vout/Vcell\t\t#Unitless\n",
      "Iout=1\t\t\t#in A\n",
      "Icell=50\t\t#in mA\n",
      "\n",
      "#Calculation\n",
      "m=Iout/(Icell*10**-3)\t#unitless\n",
      "\n",
      "#Result\n",
      "print\"The total no. of cells required : \",round(m*n)\n",
      "#Note : Answer in the book is wrong."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total no. of cells required :  1244.0\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}