{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h1> Chapter No 2 : Semiconductor Materials and\n",
      "Their Properties<h1>"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.1, Page No 65 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "lambda1 = 11000.0  #in \u00c5\n",
      "lambda1 = lambda1 * 10**-10 \n",
      "h = 6.625*10**-34 \n",
      "c = 3*10**8\n",
      "q = 1.6*10**-19    #in C\n",
      "\n",
      "#CALCULATIONS\n",
      "E_g = h*c/lambda1  #in J\n",
      "E_g= E_g/q        #in eV\n",
      "\n",
      "#RESULTS\n",
      "print('The energy gap in Si  is = %.2f eV' %E_g)\n",
      "\n",
      "#Note: The answer in the book is not correct \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The energy gap in Si  is = 1.13 eV\n"
       ]
      }
     ],
     "prompt_number": 27
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2, Page No 65 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#initialisation of variables\n",
      "E_g = 0.75    #in eV\n",
      "q=1.6*10**-19   #in C\n",
      "E_g = E_g*q   #in J\n",
      "h = 6.63*10**-34   #in J\n",
      "c = 3*10**8    #in m/s\n",
      "\n",
      "#CALCULATIONS\n",
      "lembda = (h*c)/E_g    #in m\n",
      "lembda = lembda * 10**10   #in \u00c5\n",
      "\n",
      "#RESULTS\n",
      "print('The wavelength is =%.f  \u00c5 ' %lembda)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The wavelength is =16575  \u00c5 \n"
       ]
      }
     ],
     "prompt_number": 28
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.3 Page No 81 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from numpy import *\n",
      "\n",
      "#initialisation of variables\n",
      "del_E = 0.3        #value of E_C-E_F in eV\n",
      "T1 = 330.0          #in K\n",
      "T = 300            #in K\n",
      "\n",
      "#CALCULATIONS\n",
      "del_E1 = del_E*(T1/T)   #value of E_C-E_F in eV\n",
      "\n",
      "#RESULTS\n",
      "print('The position of fermi level   is =%.2f eV' %del_E1)\n",
      "print('Hence the Fermi level will be %.2f eV below the conduction band' %del_E1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The position of fermi level   is =0.33 eV\n",
        "Hence the Fermi level will be 0.33 eV below the conduction band\n"
       ]
      }
     ],
     "prompt_number": 29
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.4, Page No 81"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#initialisation of variables\n",
      "K = 8.63*10**-5\n",
      "T = 300.0     #in K\n",
      "N_C = 2.8*10**19     #in cm^-3\n",
      "del_E = 0.25\n",
      "\n",
      "#CALCULATIONS\n",
      "f_F = math.exp( (-del_E)/(K*T) )\n",
      "n_o = N_C*math.exp( (-del_E)/(K*T) )    #in cm^-3\n",
      "\n",
      "#RESULTS\n",
      "print('The probability is =%.6f ' %f_F)\n",
      "print('The thermal equillibrium electron concentration  is =%.2f X 10^15 cm^-3' %(n_o/(10**15)))\n",
      "print('Approximation  error ')\n",
      "# The answer is same as in book only thy have rounded off to 1.8 * 10^15 which is same as above"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The probability is =0.000064 \n",
        "The thermal equillibrium electron concentration  is =1.79 X 10^15 cm^-3\n",
        "Approximation  error \n"
       ]
      }
     ],
     "prompt_number": 30
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.5 Page No 82"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#initialisation of variables\n",
      "N_V = 1.04*10**19    #in cm^-3\n",
      "T1 = 400.0        #in K\n",
      "T2 = 300.0        #in K\n",
      "del_E = 0.27     #value of E_F-E_V in eV\n",
      "K = 0.0259\n",
      "\n",
      "#CALCULATIONS\n",
      "N_V= N_V*(T1/T2)**(3/2)      #in cm^-3\n",
      "KT = K*(T1/T2)              #in eV\n",
      "p_o = N_V*math.exp( (-del_E)/(KT) )    #in /cm^3\n",
      "\n",
      "#RESULTS\n",
      "print('The hole concentration is =%.2f x 10^15 per cm^3' %(p_o/(10**15)))\n",
      "print('Approximationa error ')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The hole concentration is =5.58 x 10^15 per cm^3\n",
        "Approximationa error \n"
       ]
      }
     ],
     "prompt_number": 31
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.6 Page No 86"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#initialisation of variables\n",
      "N = 6.02*10**23\n",
      "A = 63.5            #atomic weight\n",
      "Rho = 1.7*10**-6    #in ohm cm\n",
      "d = 8.96           # in gm/cc\n",
      "\n",
      "#CALCULATIONS\n",
      "n = (N/A)*d     #in /cc\n",
      "e = 1.6*10**-19    #in C\n",
      "Miu_e = 1/(Rho*n*e)    #in cm^2/volt-sec\n",
      "\n",
      "#RESULTS\n",
      "print('The mobility of electron  is =%.2f  cm^2/volt.sec' %Miu_e)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The mobility of electron  is =43.28  cm^2/volt.sec\n"
       ]
      }
     ],
     "prompt_number": 32
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.7, Page No 87"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from sympy.mpmath import *\n",
      "import cmath\n",
      "\n",
      "\n",
      "#initialisation of variables\n",
      "d = 8.96   #in gm/cc\n",
      "At = 63.5   #atomic weight\n",
      "N_A = 6.02*10**23   #in /gm mole\n",
      "l = 0.1 #in m\n",
      "e = 1.6*10**-19   #in C\n",
      "A = 1.7*10**-6   #in m^2\n",
      "R = 0.1        #in ohm\n",
      "\n",
      "#CALCULATIONS\n",
      "n = (N_A/At)*d   #in /cc\n",
      "n = n * 10**6   #in /m^3\n",
      "Rho = (R*A)/l   #in ohm.m\n",
      "Sigma = 1/Rho   #in mho/m\n",
      "Miu_e = Sigma/(n*e)     #in m^2/V-sec\n",
      "\n",
      "#RESULTS\n",
      "print('The electron mobility is =%.3f X 10^-3 m^2/V-sec ' %(Miu_e*(10**3)))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The electron mobility is =0.043 X 10^-3 m^2/V-sec \n"
       ]
      }
     ],
     "prompt_number": 33
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.8 Page No 87"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#initialisation of variables\n",
      "N_A = 6.025*10**23    #in /gm mole\n",
      "d = 10.5             #in gm/cc\n",
      "At = 108.0         #atomic weight of \n",
      "\n",
      "#CALCULATIONS\n",
      "n = (N_A/At)*d   #in /cm^3\n",
      "n = n * 10**6   #in /m^3\n",
      "r = 10**-3        #in m\n",
      "A = math.pi * ((r)**2)   #in m^2\n",
      "q = 1.6*10**-19     \n",
      "I = 2       #in A\n",
      "V = I/(n*q*A)      #in m/s\n",
      "\n",
      "#RESULTS\n",
      "print('The drift velocity of an electron  is =%.f X 10^-4 m/s' %(V*(10**5)))\n",
      "print('Approximationa error ')\n",
      "# answer is same as in book only they have rounded of 0.000068 to 7 * 10^-4"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The drift velocity of an electron  is =7 X 10^-4 m/s\n",
        "Approximationa error \n"
       ]
      }
     ],
     "prompt_number": 34
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.9 Page No 88"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#initialisation of variables\n",
      "e= 1.6*10**-19   #in C\n",
      "d= 1.03      #in mm\n",
      "d= d*10**-3   #in m\n",
      "R= 6.51    #in ohm\n",
      "l= 300.0  #in m\n",
      "n= 8.4*10**28   #per m^3\n",
      "\n",
      "#CALCULATIONS\n",
      "r= d/2     #in m (radius)\n",
      "A= math.pi*r**2   #in m^2\n",
      "rho= R*A/l     #in ohm meter\n",
      "sigma=  1/rho    #in mho/m\n",
      "miu_e= sigma/(n*e)    #m^2/V-sec\n",
      "\n",
      "#RESULTS\n",
      "print('The coductivity of copper is =%.2f  mho/m' %sigma)\n",
      "print('The mobility of charge carriers  is : =%.6f  m^2/V-sec' %miu_e)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The coductivity of copper is =55306469.41  mho/m\n",
        "The mobility of charge carriers  is : =0.004115  m^2/V-sec\n"
       ]
      }
     ],
     "prompt_number": 35
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.9.ii Page No 88"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#initialisation of variables\n",
      "Miu_e = 1500.0     #in cm^2/volt.sec\n",
      "Miu_h = 500.0      #in cm^2/volt.sec\n",
      "n_i = 1.6*10**10  #in /cm^3\n",
      "e = 1.6*10**-19   #in C\n",
      "\n",
      "#CALCULATIONS\n",
      "Sigma_i = n_i*(Miu_e+Miu_h)*e   #in mho/cm\n",
      "Sigma = Sigma_i                 #in mho/cm\n",
      "\n",
      "#RESULTS\n",
      "print('The conductivity of pure silicon  is =%.7f  mho/cm' %Sigma)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The conductivity of pure silicon  is =0.0000051  mho/cm\n"
       ]
      }
     ],
     "prompt_number": 36
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No 2.10 Page No 89"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "Miu_e = 1500.0  #in cm^2/volt.sec\n",
      "Miu_h = 500.0  #in cm^2/volt.sec\n",
      "n_i = 1.6*10**10   #in /cm^3\n",
      "e = 1.6*10**-19    #in C\n",
      "\n",
      "#CALCULATIONS\n",
      "Sigma_i = n_i*(Miu_e+Miu_h)*e    #in mho/cm\n",
      "Sigma = Sigma_i              #in mho/cm\n",
      "\n",
      "#RESULTS\n",
      "print('The conductivity of pure silicon  is =%.2f X 10^-6  mho/cm' %(Sigma*(10**6)))\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The conductivity of pure silicon  is =5.12 X 10^-6  mho/cm\n"
       ]
      }
     ],
     "prompt_number": 37
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No 2.11 Page No 90"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "Miu_d = 500.0   #in cm^2/V.S\n",
      "Rho = 10       #in ohm cm \n",
      "\n",
      "#CALCULATIONS\n",
      "e = 1.6*10**-19   #in C\n",
      "n_d = 1/(Rho*e*Miu_d)     #in /cm^3... correction\n",
      "\n",
      "#RESULTS\n",
      "print('The number of donor  is =%.2f X 10^15 atom per cm^3' %(n_d/(10**15)))\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The number of donor  is =1.25 X 10^15 atom per cm^3\n"
       ]
      }
     ],
     "prompt_number": 38
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No 2.12 Page No 90"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "d = 5.32         #in gm/cc\n",
      "N_A = 6.02*10**23   #in atoms/gm.mole\n",
      "At = 72.6       #atomic weight\n",
      "Miu = 3800    #in cm^2/v.s\n",
      "\n",
      "#CALCULATIONS\n",
      "n_d = (N_A/At) * d          #in /cm^3\n",
      "n_d = n_d * 10**-8    #in /cc\n",
      "e = 1.6*10**-19    #in C\n",
      "Sigma = n_d * Miu * e           #in mho/cm\n",
      "\n",
      "#RESULTS\n",
      "print('The conductivity of specimen is =%.2f  mho/cm' %Sigma)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The conductivity of specimen is =0.27  mho/cm\n"
       ]
      }
     ],
     "prompt_number": 39
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No 2.13 Page No 90"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "Rho = 0.3623*10**-3    #in ohm m\n",
      "d = 4.42*10**28      #Ge density in atoms/m^3\n",
      "\n",
      "#CALCULATIONS\n",
      "Sigma = 1/Rho       #in mho/m\n",
      "n_d = d*10**-6    #in atoms/m^3\n",
      "e = 1.6*10**-19    #in C\n",
      "Miu = Sigma/(n_d*e)    #in m^2/V.sec\n",
      "\n",
      "#RESULTS\n",
      "print('The electron mobility is =%.2f  m^2/V-sec' %Miu)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The electron mobility is =0.39  m^2/V-sec\n"
       ]
      }
     ],
     "prompt_number": 40
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No 2.14 Page No 91"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "N_A = 6.025*10**26    #in /kg.Mole\n",
      "At = 72.59          #atomic weight\n",
      "d = 5.36*10**3    #in kg/m^3\n",
      "R = 0.42            #in ohm m\n",
      "B_i = 10**-6    #rate of boron impurity in %\n",
      "e = 1.6*10**-19     #in C\n",
      "\n",
      "#CALCULATIONS\n",
      "n = (N_A/At)*d    #number of Ge atoms\n",
      "h = n/10**8      #holes per unit volume\n",
      "Miu_h = 1/(R*h*e)       #in m^2/V.sec\n",
      "\n",
      "#RESULTS\n",
      "print('The Mobility of holes is =%.2f m^2/V-sec' %Miu_h)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Mobility of holes is =0.03 m^2/V-sec\n"
       ]
      }
     ],
     "prompt_number": 41
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      " Example No 2.15 Page No 90"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "n_i = 2*10**19     #in /m^3\n",
      "Miu_e = 0.36    #in m^2/v.s\n",
      "Miu_h = 0.17   #in m^2/v.s\n",
      "\n",
      "#CALCULATIONS\n",
      "A = 1*10**-4     #in m^2\n",
      "V = 2            #in Volts\n",
      "l = 0.3         #in mm\n",
      "l = l * 10**-3   #in m\n",
      "e = 1.6*10**-19   #in C\n",
      "Sigma_i = n_i * e * (Miu_e+Miu_h)   #in mho/m\n",
      "I = (Sigma_i * V*A)/l        #in amp \n",
      "\n",
      "#RESULTS\n",
      "print('The current in amp is =%.2f ' %I)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The current in amp is =1.13 \n"
       ]
      }
     ],
     "prompt_number": 42
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      " Example No 2.16 Page No 92"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "d = 4.2*10**28   #in atoms/m^3\n",
      "n_d = d/10**6   #in atoms/m^3\n",
      "e = 1.6*10**-19   #in C\n",
      "Miu_e = 0.36    #in m^2/V-sec\n",
      "\n",
      "#CALCULATIONS\n",
      "Sigma_n = n_d *e *Miu_e    #in mho/m\n",
      "Rho_n = 1/Sigma_n          #ohm m\n",
      "\n",
      "#RESULTS\n",
      "print('The resistivity in \u03a9m is =%.2f X 10^-3' %(Rho_n*(10**3)))\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The resistivity in \u03a9m is =0.41 X 10^-3\n"
       ]
      }
     ],
     "prompt_number": 43
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      " Example No 2.17 Page No 92"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "n_i = 1*10**19        #in /m^3\n",
      "Miu_e = 0.36     #in m^2/volt.sec\n",
      "Miu_h = 0.17      #in m^2/volt.sec\n",
      "A = 2                #in cm^2\n",
      "A = A *  10**-4    #in m^2\n",
      "t = 0.1         #in mm\n",
      "t = t*10**-3   #in m\n",
      "V = 4        #in volts\n",
      "e = 1.6*10**-19   #in C\n",
      "\n",
      "#CALCULATIONS\n",
      "Sigma_i = n_i * e * (Miu_e + Miu_h)   #mho/m\n",
      "J = Sigma_i * (V/t)             #in Amp/m^2\n",
      "I = J*A                      #in Amp\n",
      "\n",
      "#RESULTS\n",
      "print('The current in Amp is =%.2f ' %I)\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The current in Amp is =6.78 \n"
       ]
      }
     ],
     "prompt_number": 44
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No 2.18 Page No 92"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "Miu_h = 500.0                  #in cm^2/V.s\n",
      "Miu_e = 1500.0                 #in cm^2/V.s\n",
      "n_i = 1.6*10**10              #in /cm^3\n",
      "e = 1.6*10**-19               #in C\n",
      "\n",
      "#CALCULATIONS\n",
      "Sigma_i = n_i * e * (Miu_e+Miu_h)       #in mho/cm\n",
      "\n",
      "#RESULTS\n",
      "print('The conductivity of pure silicon in mho/cm is =%.2f X 10^-6 ' %(Sigma_i*(10**6)))\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The conductivity of pure silicon in mho/cm is =5.12 X 10^-6 \n"
       ]
      }
     ],
     "prompt_number": 45
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      " Example No 2.19 Page No 96"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "Si_density = 10.5                #in gm/cc\n",
      "N_A = 6.025*10**23         \n",
      "At = 108.0                  #atomic weight\n",
      "B = 0.8                   #in Tesla\n",
      "w = 0.50               #in cm\n",
      "w = w * 10**-2          #in m\n",
      "t = 0.10              #in mm\n",
      "t = t * 10**-3       #in m\n",
      "A = w*t                 #in m^2\n",
      "q = 1.6*10**-19          #in C\n",
      "I = 2                    #in ampere\n",
      "\n",
      "#CALCULATIONS\n",
      "n = (N_A/At) * Si_density  #in /cc\n",
      "n = n * 10**6              #in /m^3\n",
      "V_H = (B*I*t)/(n*q*A)           #in volts\n",
      "\n",
      "#RESULTS\n",
      "print('The hall voltage produced is =%.3f X 10^-7 volts' %(V_H*(10**7)))\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The hall voltage produced is =0.341 X 10^-7 volts\n"
       ]
      }
     ],
     "prompt_number": 46
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      " Example No 2.20 Page No 96"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "Sigma = 5.8*10**7        #in mho/m\n",
      "l = 1                     #in m\n",
      "d = 1                  #in cm\n",
      "d = d * 10**-2          #in m\n",
      "W = 1               #in mm \n",
      "W = W*10**-3       #in m\n",
      "I = 1             #in Amp\n",
      "B = 1            #in Tesla\n",
      "V_H = 0.074*10**-6        #in Volts\n",
      "A = 10**-2 * 10**-3          #in m^2\n",
      "\n",
      "#CALCULATIONS\n",
      "R_H = (V_H*A)/(B*I*d)              #in m^3/c\n",
      "Miu = Sigma * R_H                    #in m^2/volt.sec\n",
      "\n",
      "#RESULTS\n",
      "print('Hall coefficient  is =%.1f X 10^-11  m^3/c' %(R_H*(10**11)))\n",
      "print('The mobility of electron is = %.2f X 10^-3 m^2/volt.sec ' %(Miu*(10**3)))\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Hall coefficient  is =7.4 X 10^-11  m^3/c\n",
        "The mobility of electron is = 4.29 X 10^-3 m^2/volt.sec \n"
       ]
      }
     ],
     "prompt_number": 47
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      " Example No 2.21 Page No 97"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "n_i = 1.4*10**18             #in /m^3\n",
      "n_D = 1.4*10**24             #in /m^3\n",
      "n = n_D                      #in /m^3\n",
      "\n",
      "#CALCULATIONS\n",
      "p = n_i**2/n               #in /m^3\n",
      "R_e = n/p              #Ratio of electron\n",
      "\n",
      "#RESULTS\n",
      "print('Concentration of is =%.2f X 10^12 holes per m^3 ' %(p/(10**12)))\n",
      "print('Ratio of electron to hole concentration is =%.f 10^12 ' %(R_e/(10**12)))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Concentration of is =1.40 X 10^12 holes per m^3 \n",
        "Ratio of electron to hole concentration is =1 10^12 \n"
       ]
      }
     ],
     "prompt_number": 48
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      " Example No 2.22 Page No 97"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "B = 0.48                #in Wb/m^2\n",
      "R_H = 3.6 * 10**-4           #in m^3/c\n",
      "R = 9*10**-3           #in ohm-m\n",
      "\n",
      "#CALCULATIONS\n",
      "Sigma = 1/R                #in (ohm-m)^-1\n",
      "Rho = 1/R_H                #in coulomb/m^3\n",
      "e = 1.6*10**-19            #in C\n",
      "n = Rho/e                  #in /m^3\n",
      "Miu = Sigma * R_H          #in m^2/volt-s\n",
      "\n",
      "#RESULTS\n",
      "print('The mobility of electron  is =%.2f  m^2/volt-s' %Miu)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The mobility of electron  is =0.04  m^2/volt-s\n"
       ]
      }
     ],
     "prompt_number": 49
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      " Example No 2.23 Page No 104"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "e = 1.6*10**-19           #in C\n",
      "R_H = 0.0145              #in m^3/coulomb\n",
      "Miu_e = 0.36              #m^2/v-s\n",
      "E = 100                  #V/m\n",
      "\n",
      "#CALCULATIONS\n",
      "n = 1/(e*R_H)             #in /m^3\n",
      "J= n*e*Miu_e*E            #in A/m^2\n",
      "\n",
      "#RESULTS\n",
      "print('The current density  is =%.2f  A/m^2 ' %J)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The current density  is =2482.76  A/m^2 \n"
       ]
      }
     ],
     "prompt_number": 50
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      " Example No 2.24 Page No 105"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#initialisation of variables\n",
      "e = 1.6*10**-19            #in C\n",
      "Miu_e = 7.04*10**-3           #in m^2/volt-sec\n",
      "n = 5.8*10**28              #number of electron/m^3\n",
      "m = 9.1*10**-31\n",
      "E_F = 5.5                    # in eV\n",
      "\n",
      "#CALCULATIONS\n",
      "Torque = (Miu_e/e)*m                # in sec \n",
      "Rho = 1/(n*e*Miu_e)                 #in ohm cm\n",
      "V_F = math.sqrt( (2*E_F*e)/m )           #in m/s\n",
      "\n",
      "#RESULTS\n",
      "print('Relaxtion time is =%.2f X 10^-15 sec ' %(Torque*(10**15)))\n",
      "print('Resistivity of conductor  is =%.2f X 10^-18 in \u03a9m' %(Rho*(10**8)))\n",
      "print('Velocity of electron with the fermi energy  is =%.2f X 10^-6 in m/s' %(V_F/(10**6)))\n",
      "\n",
      "# Note: The calculation of Part (ii) is wrong also the unit of resistivity of conductor is wrong\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Relaxtion time is =40.04 X 10^-15 sec \n",
        "Resistivity of conductor  is =1.53 X 10^-18 in \u03a9m\n",
        "Velocity of electron with the fermi energy  is =1.39 X 10^-6 in m/s\n"
       ]
      }
     ],
     "prompt_number": 51
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      " Example No 2.25 Page No 105"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "\n",
      "E= 5.95           #in eV\n",
      "EF= 6.25          #in eV\n",
      "delE= 0.01\n",
      "\n",
      "#CALCULATIONS\n",
      " #delE= 1-1/(1+exp((E-EF)/KT))\n",
      "K=1.38*10**-23                      #Boltzman Constant in J/K\n",
      "T = ((E-EF)/math.log(1/(1-delE) -1)*1.6*10**-19)/K               #in K\n",
      "\n",
      "#RESULTS\n",
      "print('The temperature is =%.2f K' %T)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The temperature is =756.95 K\n"
       ]
      }
     ],
     "prompt_number": 52
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      " Example No 2.26 Page No 105"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "\n",
      "T1 = 400.0       #in K\n",
      "T2 = 300.0       #in K\n",
      "N_V = 1.04*10**19       #in cm^-3\n",
      "\n",
      "#CALCULATIONS\n",
      "N1 = N_V*((T1/T2)**(3/2))          #in cm^-3\n",
      "KT = 0.0259*(T1/T2)           #in eV\n",
      "FermiLevel= 0.27              #in eV\n",
      "P_O = N1*math.exp( (-FermiLevel)/KT )          #in cm^-3\n",
      "\n",
      "#RESULTS\n",
      "print('The thermal equillibrium hole concentration  is =%.2f X 10^15 cm^-3' %(P_O/(10**15)))\n",
      "print('Approximationa error ')\n",
      "# Answer in the book is wrong"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The thermal equillibrium hole concentration  is =5.58 X 10^15 cm^-3\n",
        "Approximationa error \n"
       ]
      }
     ],
     "prompt_number": 53
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      " Example No 2.27  Page No 107"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "T1 = 550.0              #in K\n",
      "T2 = 300.0           #in K\n",
      "N1 = 1.04*10**19     \n",
      "\n",
      "#CALCULATIONS\n",
      "N_V = N1*((T1/T2)**(3))  \n",
      "N_C = 2.8*10**19\n",
      "E_g = -1.12\n",
      "KT = 0.0259*(T1/T2)\n",
      "n_i = math.sqrt(N_C*N_V*math.exp(E_g/KT))   #in cm^-3\n",
      "Nd= math.sqrt(n_i**2/((1.05-1/2.0)**2-(1/2.0)**2))\n",
      "\n",
      "\n",
      "#RESULTS\n",
      "print('The value of n_i  is =%.2f X 10^14 cm^-3' %(n_i/(10**14)))\n",
      "print('The value of N_d is =%.2f X 10^15 cm^-3' %(Nd/(10**15)))\n",
      "#Formula n_o= Nd/2+sqrt((Nd/2)^2+n_i^2) and n_o = 1.05*N_d;\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The value of n_i  is =3.20 X 10^14 cm^-3\n",
        "The value of N_d is =1.40 X 10^15 cm^-3\n"
       ]
      }
     ],
     "prompt_number": 54
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      " Example No 2.28 Page No 106"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "n_o = 10**15         #in cm^-3\n",
      "n_i = 10**10         #in cm^-3\n",
      "p_o = 10**5       #in cm^-3\n",
      "del_p = 10**13    #in cm^-3\n",
      "\n",
      "#CALCULATIONS\n",
      "del_n = del_p         #in cm^-3\n",
      "KT= 0.0259          #in eV\n",
      "Fermi_level1= KT*math.log(n_o/n_i)           #in eV\n",
      "Fermi_level2= KT*math.log((n_o+del_n)/n_i)        #in eV\n",
      "Fermi_level3= KT*math.log((p_o+del_p)/n_i)        #in eV\n",
      "\n",
      "\n",
      "#RESULTS\n",
      "print('Fermi level for thermal equillibrium  is : =%.2f eV ' %Fermi_level1)\n",
      "print('Quasi-Fermi level for electrons in non equillibrium  is : =%.2f eV' %Fermi_level2)\n",
      "print('Quasi-Fermi level for holes in non equillibrium  is: =%.2f eV' %Fermi_level3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Fermi level for thermal equillibrium  is : =0.30 eV \n",
        "Quasi-Fermi level for electrons in non equillibrium  is : =0.30 eV\n",
        "Quasi-Fermi level for holes in non equillibrium  is: =0.18 eV\n"
       ]
      }
     ],
     "prompt_number": 55
    }
   ],
   "metadata": {}
  }
 ]
}