{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#10: Intrinsic Semiconductors"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.1, Page number 277"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The intrinsic carrier concentration at room temperature is 1.3889 *10**16 m^-3\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "ec=4*10**-4;    #electrical conductivity of intrinsic silicon at room temperature(ohm^-1 m^-1)\n",
    "me=0.14;    #The electron mobility(m^2 V^-1 s^-1)\n",
    "mh=0.04;   #The hole mobility(m^2 V^-1 s^-1)\n",
    "e=1.6*10**-19;   #charge of electron(c)\n",
    "\n",
    "#Calculation\n",
    "ni=ec/(e*(me+mh));    #The intrinsic carrier concentration at room temperature(m^-3)\n",
    "\n",
    "#Result\n",
    "print \"The intrinsic carrier concentration at room temperature is\",round(ni/10**16,4),\"*10**16 m^-3\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.2, Page number 277"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The resistivity of intrinsic carrier is 0.4709 ohm m\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "d=2.37*10**19;   #The intrinsic carrier density at room temperature(m^-3)\n",
    "me=0.38;   #The electron mobility(m^2 V^-1 s^-1)\n",
    "mh=0.18;   #The hole mobility(m^2 V^-1 s^-1)\n",
    "e=1.6*10**-19;  #charge of electron(c)\n",
    "\n",
    "#Calculation\n",
    "r=1/(d*e*(me+mh));    #The resistivity of intrinsic carrier(ohm m)\n",
    "\n",
    "#Result\n",
    "print \"The resistivity of intrinsic carrier is\",round(r,4),\"ohm m\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.3, Page number 277"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The intrinsic carrier density at room tepmerature is 5.04 *10**21 m^-3\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "r=2*10**-4;   #the resistivity of In-Sb(ohm m)\n",
    "me=6;    #The electron mobility(m^2 V^-1 s^-1)\n",
    "mh=0.2;  #The hole mobility(m^2 V^-1 s^-1)\n",
    "e=1.6*10**-19;   #charge of electron(c)\n",
    "\n",
    "#Calculation\n",
    "d=1/(r*e*(me+mh));    #The intrinsic carrier density at room tepmerature(m^-3)\n",
    "\n",
    "#Result\n",
    "print \"The intrinsic carrier density at room tepmerature is\",round(d/10**21,2),\"*10**21 m^-3\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.4, Page number 278"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The electrical conductivity at room temperature is 1.4374 *10**-3 ohm^-1 m^-1\n",
      "answer given in the book is wrong\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "Eg=1.1*1.6*10**-19;    #The energy gap of silicon(J)\n",
    "me=0.48;    #The electron mobility(m^2 V^-1 s^-1)\n",
    "mh=0.13;    #The hole mobility(m^2 V^-1 s^-1)\n",
    "h=6.625*10**-34;   #Planck's constant(m^2 Kg/sec)\n",
    "e=1.6*10**-19;   #charge of electron(c)\n",
    "m=9.11*10**-31;  #mass of an electron\n",
    "kb=1.38*10**-23;  #Boltzmann's constant(m^2 Kg s^-2 k^-1)\n",
    "t=300;   #temperature(K)\n",
    "\n",
    "#Calculation\n",
    "ni=2*(2*math.pi*m*kb*t/h**2)**(3/2)*math.exp(-Eg/(2*kb*t));    #intrinsic carrier concentration(m^-3)\n",
    "ec=ni*e*(me+mh);   #The electrical conductivity at room temperature(ohm^-1 m^-1 *10^-3)\n",
    "\n",
    "#Result\n",
    "print \"The electrical conductivity at room temperature is\",round(ec*10**3,4),\"*10**-3 ohm^-1 m^-1\"\n",
    "print \"answer given in the book is wrong\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.5, Page number 279"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The intrinsic carrier concentration is 1.983 *10**12 m^-3\n",
      "The electrical conductivity at room temperature is 2.8239 *10**-7 ohm^-1 m^-1\n",
      "answer varies due to rounding off errors\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "Eg=1.43*1.6*10**-19;    #The energy gap of intrinsic GaAs(J)\n",
    "xe=0.85;    #The electron mobility(m^2 V^-1 s^-1)\n",
    "xh=0.04;    #The hole mobility(m^2 V^-1 s^-1)\n",
    "me=0.068*9.11*10**-31;   #effective mass of electron(m)\n",
    "mh=0.5*9.11*10**-31;   #effective mass of hole(m)\n",
    "h=6.625*10**-34;     #Planck's constant(m^2 Kg/sec)\n",
    "e=1.6*10**-19;    #charge of electron(c)\n",
    "m=9.11*10**-31;   #mass of an electron(kg)\n",
    "kb=1.38*10**-23;  #Boltzmann's constant(m^2 Kg s^-2 k^-1)\n",
    "t=300;    #temperature(K)\n",
    "\n",
    "#Calculation\n",
    "ni=2*(2*math.pi*kb*t/h**2)**(3/2)*(me*mh)**(3/4)*math.exp(-Eg/(2*kb*t));    #intrinsic carrier concentration(m^-3)\n",
    "ec=ni*e*(xe+xh);    #The electrical conductivity at room temperature(ohm^-1 m^-1)\n",
    "\n",
    "#Result\n",
    "print \"The intrinsic carrier concentration is\",round(ni/10**12,3),\"*10**12 m^-3\"\n",
    "print \"The electrical conductivity at room temperature is\",round(ec*10**7,4),\"*10**-7 ohm^-1 m^-1\"\n",
    "print \"answer varies due to rounding off errors\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.6, Page number 279"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The position of the fermi level is 9.223086 *10**-20 J or 0.5764 eV\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "Eg=1.12*1.6*10**-19;     #Energy gap of Si semi conductor(J)\n",
    "me=0.12*9.11*10**-31;   #The electron mobility(m^2 V^-1 s^-1)\n",
    "mh=0.28*9.11*10**-31;   #The hole mobility(m^2 V^-1 s^-1)\n",
    "t=300;    #temperature of fermi level(K)\n",
    "kb=1.38*10**-23;   #Boltzmann's constant(m^2 Kg s^-2 k^-1)\n",
    "m=9.11*10**-31;   #mass of an electron(Kg)\n",
    "\n",
    "#Calculation\n",
    "Ef=(Eg/2)+((3*kb*t/4)*math.log(mh/me));     #position of the fermi level(J)\n",
    "\n",
    "#Result\n",
    "print \"The position of the fermi level is\",round(Ef*10**20,6),\"*10**-20 J or\",round(Ef/(1.6*10**-19),4),\"eV\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.7, Page number 280"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Temperature of the fermi level shifted by 10% is 1115.127 K\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "Eg=1*1.6*10**-19;   #Energy gap(J)\n",
    "E=0.1*1.6*10**-19;    #Fermi level is shifted by 10%(J)\n",
    "me=1*9.11*10**-31;    #The electron mobility(m^2 V^-1 s^-1)\n",
    "mh=4*9.11*10**-31;    #Effective mass of holes is 4 times that of electrons(m^2 V^-1 s^-1)\n",
    "m=9.11*10**-31;    #mass of an electron(kg)\n",
    "kb=1.38*10**-23;   #Boltzmann's constant(m^2 Kg s^-2 k^-1)\n",
    "\n",
    "#Calculation\n",
    "T=4*E/(3*kb*math.log(4));   #The Temperature of the fermi level shifted by 10%(K)\n",
    "\n",
    "#Result\n",
    "print \"The Temperature of the fermi level shifted by 10% is\",round(T,3),\"K\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.8, Page number 281"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The resistance of an intrinsic Ge rod is 4310 ohm\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "l=1*10**-2;   #length of the intrinsic Ge rod(m)\n",
    "b=1*10**-3;   #breadth of the intrinsic Ge rod(m)\n",
    "t=1*10**-3;   #thickness of the intrinsic Ge rod(m)\n",
    "T=300;      #temperature of the intrinsic Ge rod(K)\n",
    "me=0.39;    #The electron mobility(m^2 V^-1 s^-1)\n",
    "mh=0.19;    #The hole mobility(m^2 V^-1 s^-1)\n",
    "ni=2.5*10**19;    #intrinsic carrier conduction(m^3)\n",
    "e=1.6*10**-19;    #charge of electron(c)\n",
    "\n",
    "#Calculation\n",
    "ec=ni*e*(me+mh);    #The electrical conductivity at room temperature(ohm^-1 m^-1)\n",
    "A=b*t;      #area(m^2)\n",
    "R=l/(ec*A);    #The resistance of an intrinsic Ge rod(ohm)\n",
    "\n",
    "#Result\n",
    "print \"The resistance of an intrinsic Ge rod is\",int(R),\"ohm\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.9, Page number 281"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The ratio of conductiveness is 1.08 *10**5\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "Eg=1.2*1.6*10**-19;    #The energy gap of intrinsic semiconductor(J)\n",
    "T1=600;    #Temperature(K)\n",
    "T2=300;    #Temperature(K)\n",
    "e=1.6*10**-19;    #charge of electron(c)\n",
    "kb=1.38*10**-23;     #Boltzmann's constant(m^2 Kg s^-2 k^-1)\n",
    "\n",
    "#Calculation\n",
    "x=math.exp((-Eg/(2*kb))*((1/T1)-(1/T2)));    #The ratio of conductiveness\n",
    "\n",
    "#Result\n",
    "print \"The ratio of conductiveness is\",round(x/10**5,2),\"*10**5\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.10, Page number 282"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The conductivity of Ge at T2 is 4.969895 ohm^-1 m^-1\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "Eg=0.72*1.6*10**-19;    #The band gap of Ge(J)\n",
    "T1=293;    #Temperature(K)\n",
    "T2=313;    #Temperature(K)\n",
    "x1=2;     #The conductivity of Ge at T1(ohm^-1 m^-1)\n",
    "e=1.6*10**-19;   #charge of electron(c)\n",
    "kb=1.38*10**-23;   #Boltzmann's constant(m^2 Kg s^-2 k^-1)\n",
    "\n",
    "#Calculation\n",
    "x2=x1*math.exp((Eg/(2*kb))*((1/T1)-(1/T2)));    #The ratio of conductiveness\n",
    "\n",
    "#Result\n",
    "print \"The conductivity of Ge at T2 is\",round(x2,6),\"ohm^-1 m^-1\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.11, Page number 282"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The intrinsic carrier density of A to B is 1015\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "Eg1=0.36;    #The energy gap of intrinsic semiconductor A(eV)\n",
    "Eg2=0.72;    #The energy gap of intrinsic semiconductor B(eV)\n",
    "T1=300;     #Temperature of semiconductor A(K)\n",
    "T2=300;     #Temperature of semiconductor B(K)\n",
    "m=9.11*10**-31;   #mass of an electron(kg)\n",
    "KT=0.026;     #kt(eV)\n",
    "\n",
    "#Calculation\n",
    "x=math.exp((Eg2-Eg1)/(2*KT));    #The intrinsic carrier density of A to B\n",
    "\n",
    "#Result\n",
    "print \"The intrinsic carrier density of A to B is\",int(x)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.12, Page number 283"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The band gap of semiconductor is 5.5863 *10**-20 J or 0.349 eV\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "T1=293;   #Temperature(K)\n",
    "T2=373;   #Temperature(K)\n",
    "x1=250;   #The conductivity of semiconductor at T1(ohm^-1 m^-1)\n",
    "x2=1100;  #The conductivity of semiconductor at T2(ohm^-1 m^-1)\n",
    "e=1.6*10**-19;   #charge of electron(c)\n",
    "kb=1.38*10**-23;   #Boltzmann's constant(m^2 Kg s^-2 k^-1)\n",
    "\n",
    "#Calculation\n",
    "Eg=2*kb*math.log(x2/x1)*(T1*T2/(T2-T1));   #The band gap of semiconductor(J)\n",
    "\n",
    "#Result\n",
    "print \"The band gap of semiconductor is\",round(Eg*10**20,4),\"*10**-20 J or\",round(Eg/(1.6*10**-19),3),\"eV\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.13, Page number 284"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "mobility of pure semi conductor is 0.08283 m^2 V^-1 s^-1\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "me=50;    #The electron mobility of pure semi conductor(m^2 V^-1 s^-1)\n",
    "t1=4.2;   #temperature of pure semi conductor(K)\n",
    "t2=300;   #temperature(K)\n",
    "\n",
    "#Calculation\n",
    "m=me*((t2**(-3/2))/(t1**(-3/2)));    #mobility of pure semi conductor(m^2 V^-1 s^-1)\n",
    "\n",
    "#Result\n",
    "print \"mobility of pure semi conductor is\",round(m,5),\"m^2 V^-1 s^-1\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 10.14, Page number 284"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The band gap of an intrinsic semi conductor is 1.183808 *10**-19 J or 0.7399 eV\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "ec1=19.96;    #The electrical conductivity of an intrinsic semi conductor(ohm^-1 m^-1)\n",
    "ec2=79.44;    #The increasing electrical conductivity of an intrinsic semi conductor(ohm^-1 m^-1)\n",
    "t1=333;   #temperature of an intrinsic semi conductor(K)\n",
    "t2=373;   #increasing temperature of an intrinsic semi conductor(K)\n",
    "kb=1.38*10**-23;   #Boltzmann's constant(m^2 Kg s^-2 k^-1)\n",
    "\n",
    "#Calculation\n",
    "Eg=2*kb*math.log(ec2/ec1)*((t1*t2)/(t2-t1));    #The band gap of an intrinsic semi conductor(J)\n",
    "\n",
    "#Result\n",
    "print \"The band gap of an intrinsic semi conductor is\",round(Eg*10**19,6),\"*10**-19 J or\",round(Eg/(1.6*10**-19),4),\"eV\""
   ]
  }
 ],
 "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
}