{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 02 : Transport Phenomena in Semiconductor"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.1, Page No 22"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "n=10.0**20\n",
      "q=1.6*10**-19\n",
      "mn=800     #cm^3\n",
      "delta=1   #V/cm\n",
      "\n",
      "#Calculations\n",
      "J=n*q*mn*delta\n",
      "\n",
      "\n",
      "#Results\n",
      "print(\"The electron current density is= %.2f X 10^4 atom/cm^2 \" %(J/(10**4)))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The electron current density is= 1.28 X 10^4 atom/cm^2 \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2a, Page No 27"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "ni=10.0**10\n",
      "Nd=10**12\n",
      "\n",
      "#Calculations\n",
      "n=(Nd+(math.sqrt(Nd+4*ni**2)))\n",
      "\n",
      "\n",
      "#Results\n",
      "print(\"The free electron  is= %.3f X 10^12 cm^3 \" %(n/(10**12)))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The free electron  is= 1.020 X 10^12 cm^3 \n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2b, Page No 27"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "ni=10.0**10\n",
      "Nd=10**18\n",
      "\n",
      "#Calculations\n",
      "n=(Nd+(math.sqrt(Nd+4*ni**2)))\n",
      "\n",
      "\n",
      "#Results\n",
      "print(\"The free electron  is= %.2f X 10^18 cm^3 \" %(n/(10**18)))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The free electron  is= 1.00 X 10^18 cm^3 \n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.3a, Page No 29"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "Av=6.02*(10**23)      #Avogadro No.\n",
      "m=72.6                #Molar mass of germanium in gm/moles\n",
      "d=5.32                #density in gm/cm^3\n",
      "\n",
      "#Calculations\n",
      "conc = (Av/m)*d       #Concentration of atom in germanium\n",
      "\n",
      "#Results\n",
      "print(\"The concentration of germanium atom is= %.2f X 10^22 atom/cm^3 \" %(conc/(10**22)))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The concentration of germanium atom is= 4.41 X 10^22 atom/cm^3 \n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.3b, Page No 29"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#initialisation of variables\n",
      "Av=6.02*(10**23) #Avogadro No.\n",
      "m=72.6        #Molar mass of germanium in gm/moles\n",
      "d=5.32        #density in gm/cm^3\n",
      "ni=2.5*(10**13)        #in cm^-3\n",
      "n=ni\n",
      "p=ni                #n=magnitude of free electrons, p=magnitude of holes, ni=magnitude of intrinsic concentration\n",
      "\n",
      "#Calculations\n",
      "q=1.6*(10**-19)          #Charge of an Electron\n",
      "yn=3800.0         #in cm^2/V-s\n",
      "yp=1800.0        #in cm^2/V-s\n",
      "\n",
      "#Required Formula\n",
      "A=ni*q*(yn+yp)          #Conductivity\n",
      "print(\"Conductivity is = %.2f ohm-cm^-1 \" %A)\n",
      "R =1.0/A          #Resistivity\n",
      "print(\"Resistivity is = %.2f ohm-cm \" %R)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Conductivity is = 0.02 ohm-cm^-1 \n",
        "Resistivity is = 44.64 ohm-cm \n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.3c Page No 29"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#initialisation of variables\n",
      "print('We know that n=p=ni where n is conc of free electron p is conc of holes and ni is conc of intrinsic carriers')\n",
      "#Resistivity if 1 donor atom per 10^8 germanium atoms\n",
      "Nd=4.41*(10**14)           #in atoms/cm^3\n",
      "ni=2.5*(10**13)         #in cm^3\n",
      "yn=3800.0              #in cm^2/V-s\n",
      "\n",
      "#Calculations\n",
      "q=1.6*(10**-19)\n",
      "n=Nd\n",
      "p=(ni**2)/Nd\n",
      "\n",
      "print(\"The concentration of holes is= %.2f holes/cm^3 \" %p)\n",
      "if n>p:\n",
      "    A=n*q*yn        #Conductivity\n",
      "    print(\"The conductivity is = %.2f ohm-cm^-1 \" %A)\n",
      " \n",
      "R=1.0/A           #Resistivity\n",
      "\n",
      "#Results\n",
      "print(\"The resistivity is = %.2f ohm-cm \" %R)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "We know that n=p=ni where n is conc of free electron p is conc of holes and ni is conc of intrinsic carriers\n",
        "The concentration of holes is= 1417233560090.70 holes/cm^3 \n",
        "The conductivity is = 0.27 ohm-cm^-1 \n",
        "The resistivity is = 3.73 ohm-cm \n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.3d, Page No 29"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "\n",
      "print('We know that n=p=ni where n is conc of free electron p is conc of holes and ni is conc of intrinsic carriers')\n",
      "#Ratio of Conductivities\n",
      "Nd=4.41*(10**14)       #in atoms/cm^3\n",
      "ni=2.5*(10**13)      #in cm^3\n",
      "yn=3800.0           #in cm^2/V-s\n",
      "q=1.6*(10**-19)\n",
      "\n",
      "#Calculations\n",
      "n=Nd\n",
      "A=n*q*yn      #Conductivity\n",
      "\n",
      "#If germanium atom were monovalent metal , ratio of conductivity to that of n-type semiconductor\n",
      "\n",
      "n=4.41*(10**22)         #in electrons/cm^3\n",
      "\n",
      "\n",
      "#Results\n",
      "print('If germanium atom were monovalent metal')\n",
      "A1=n*q*yn\n",
      "print(\"The coductivity of metal is= %.2f ohm=cm^-1 x 10^7 \" %(A1/10**7))\n",
      "F=A1/A\n",
      "print(\"The factor by which the coductivity of metal is higher than that of n type semiconductor is %.2f x 10^8 \" %(F/10**8))\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "We know that n=p=ni where n is conc of free electron p is conc of holes and ni is conc of intrinsic carriers\n",
        "If germanium atom were monovalent metal\n",
        "The coductivity of metal is= 2.68 ohm=cm^-1 x 10^7 \n",
        "The factor by which the coductivity of metal is higher than that of n type semiconductor is 1.00 x 10^8 \n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.4, Page No 35"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#initialisation of variables\n",
      "g=5*10**21    #Generation rate\n",
      "tp=2*10**-6        #hole lifetime\n",
      "\n",
      "#Calculations\n",
      "p=g*tp\n",
      "\n",
      "#Required Formula\n",
      "print(\"Hole density is = %.2f cm^3 10^16 \" %(p/10**16))\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Hole density is = 1.00 cm^3 10^16 \n"
       ]
      }
     ],
     "prompt_number": 8
    }
   ],
   "metadata": {}
  }
 ]
}