{
 "metadata": {
  "name": "",
  "signature": "sha256:04561aafd347865fa8c83acfb9b60eb84db275f85862655b442f546023cadd1e"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Electron Theory of Metals"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.1, Page number 69"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#import module\n",
      "import math\n",
      "\n",
      "#Calculation\n",
      "# given that E-Ef = kT\n",
      "# fermi function FE = 1/(1+exp((E-Ef)/kT)\n",
      "# therefore FE = 1/(1+exp(kT/kT));\n",
      "# FE = 1/(1+exp(1))\n",
      "FE=1/(1+math.exp(1));\n",
      "FE=math.ceil(FE*10**2)/10**2;   #rounding off to 2 decimals\n",
      "\n",
      "#Result\n",
      "print(\"fermi function is\",FE);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('fermi function is', 0.27)\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.2, Page number 69"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "\n",
      "#Calculation\n",
      "# given that E-Ef = kT\n",
      "# fermi function FE = 1/(1+exp((E-Ef)/kT)\n",
      "# therefore FE = 1/(1+exp(kT/kT));\n",
      "# FE = 1/(1+exp(1))\n",
      "FE=1/(1+math.exp(1));\n",
      "FE=math.ceil(FE*10**3)/10**3;   #rounding off to 3 decimals\n",
      "\n",
      "#Result\n",
      "print(\"fermi function is\",FE);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('fermi function is', 0.269)\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.3, Page number 69"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "FE=10/100;    #fermi function is 10%\n",
      "Ef=5.5;   #fermi energy of silver in eV\n",
      "k=1.38*10**-23;\n",
      "\n",
      "#Calculation\n",
      "E=Ef+(Ef/100);\n",
      "#FE=1/(1+math.exp((E-Ef)/(k*T)))\n",
      "#therefore 1/FE = 1+math.exp((E-Ef)/(k*T))\n",
      "#therefore (1/FE)-1 = math.exp((E-Ef)/(k*T))\n",
      "#therefore log((1/FE)-1) = (E-Ef)/(k*T)\n",
      "#therefore T = (E-Ef)/(k*math.log((1/FE)-1))\n",
      "#let X=E-Ef;    \n",
      "X=E-Ef;     #energy in eV\n",
      "X=X*1.6*10**-19;    #energy in J\n",
      "T = (X/(k*math.log((1/FE)-1)));\n",
      "T=math.ceil(T*10**2)/10**2;   #rounding off to 2 decimals\n",
      "\n",
      "#Result\n",
      "print(\"temperature in K is\",T);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('temperature in K is', 290.23)\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.4, Page number 70 **************************************"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "#let X=E-Ef\n",
      "X=0.5;   #E-Ef=0.5 in eV\n",
      "\n",
      "#Calculation\n",
      "X=X*1.6*10**-19;   #X in J\n",
      "FE=1/100;    #fermi function is 1% \n",
      "k=1.38*10**-23;\n",
      "#FE=1/(1+exp(X/(k*T)))\n",
      "#therefore 1/FE = 1+math.exp(X/(k*T))\n",
      "#therefore (1/FE)-1 = math.exp(X/(k*T))\n",
      "#therefore log((1/FE)-1) = X/(k*T)\n",
      "#but log(x) = 2.303*math.log10(x)\n",
      "#therefore T = X/(k*math.log((1/FE)-1))\n",
      "#but log(x)=2.303*math.log10(x)\n",
      "#therefore T = X/(k*2.303*math.log10((1/FE)-1))\n",
      "T = X/(k*2.303*math.log10((1/FE)-1));\n",
      "\n",
      "#Result\n",
      "print(\"temperature in K is\",T);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('temperature in K is', 1261.3505710887953)\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.5, Page number 71 *******"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "rho_s=10.5*10**3;   #density in kg/m^3\n",
      "NA=6.02*10**26;    #avagadro number per kmol\n",
      "MA=107.9; \n",
      "\n",
      "#Calculation\n",
      "n=(rho_s*NA)/MA;\n",
      "sigma=6.8*10**7;\n",
      "e=1.6*10**-19;   #charge in coulomb\n",
      "mew=sigma/(n*e);\n",
      "mew=math.ceil(mew*10**6)/10**6;   #rounding off to 6 decimals\n",
      "\n",
      "#Result\n",
      "print(\"density of electrons is\",n);\n",
      "print(\"mobility of electrons in silver in m^2/Vs is\",mew);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('density of electrons is', 5.85820203892493e+28)\n",
        "('mobility of electrons in silver in m^2/Vs is', 0.007255)\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.6, Page number 71 ***"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "d=8.92*10**3;   #density in kg/m^3\n",
      "rho=1.73*10**-8;  #resistivity in ohm-m\n",
      "m=9.1*10**-31;    #mass in kg\n",
      "w=63.5;    #atomic weight\n",
      "e=1.6*10**-19;    #charge in coulomb\n",
      "A=6.02*10**26;    #avagadro number\n",
      "\n",
      "#Calculation\n",
      "n=(d*A)/w;\n",
      "mew=1/(rho*n*e);\n",
      "tow=m/(n*(e**2)*rho);\n",
      "mew=math.ceil(mew*10**6)/10**6;   #rounding off to 6 decimals\n",
      "\n",
      "#Result\n",
      "print(\"mobility of electrons in Copper in m/Vs is\",mew);\n",
      "print(\"average time of collision of electrons in copper in sec is\",tow);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('mobility of electrons in Copper in m/Vs is', 0.004273)\n",
        "('average time of collision of electrons in copper in sec is', 2.4297841992299697e-14)\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.7, Page number 72"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "rho=1.54*10**-8;    #resistivity in ohm-m\n",
      "n=5.8*10**28;       #electron/m^3\n",
      "m=9.108*10**-31;   #mass in kg\n",
      "e=1.602*10**-19;   #charge in coulomb\n",
      "\n",
      "#Calculation\n",
      "tow=m/(n*(e**2)*rho);\n",
      "\n",
      "#Result\n",
      "print(\"relaxation time of conduction electrons in sec is\",tow);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('relaxation time of conduction electrons in sec is', 3.973281032516849e-14)\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.8, Page number 73"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "FE=10/100;    #fermi function is 10%\n",
      "Ef=5.5;   #fermi energy of silver in eV\n",
      "k=1.38*10**-23;\n",
      "\n",
      "#Calculation\n",
      "E=Ef+(Ef/100);\n",
      "#FE=1/(1+math.exp((E-Ef)/(k*T)))\n",
      "#therefore 1/FE = 1+math.exp((E-Ef)/(k*T))\n",
      "#therefore (1/FE)-1 = math.exp((E-Ef)/(k*T))\n",
      "#therefore log((1/FE)-1) = (E-Ef)/(k*T)\n",
      "#therefore T = (E-Ef)/(k*math.log((1/FE)-1))\n",
      "#let X=E-Ef;    \n",
      "X=E-Ef;     #energy in eV\n",
      "X=X*1.6*10**-19;    #energy in J\n",
      "T = (X/(k*math.log((1/FE)-1)));\n",
      "T=math.ceil(T*10**2)/10**2;   #rounding off to 2 decimals\n",
      "\n",
      "#Result\n",
      "print(\"temperature in K is\",T);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('temperature in K is', 290.23)\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.9, Page number 73"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "\n",
      "#Calculation\n",
      "# given that E-Ef = kT\n",
      "# fermi function FpE = 1/(1+exp((E-Ef)/kT)\n",
      "# therefore FpE = 1/(1+exp(kT/kT));\n",
      "# FpE = 1/(1+exp(1))\n",
      "FpE=1/(1+math.exp(1));\n",
      "FpE=math.ceil(FpE*10**2)/10**2;   #rounding off to 2 decimals\n",
      "\n",
      "#Result\n",
      "print(\"fermi function is\",FpE);\n",
      "#the presence of electron at that energy level is not certain"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('fermi function is', 0.27)\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.10, Page number 74  ****************************"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "m=9.1*10**-31;   #mass in kg\n",
      "h=6.626*10**-34;\n",
      "A=(8*m)**(3/2);\n",
      "\n",
      "#Calculation\n",
      "B=math.pi/(2*h**3);\n",
      "EfeV=3.10;    #fermi energy in eV\n",
      "Ef=EfeV*1.6*10**-19;    #fermi energy in J\n",
      "EFeV=EfeV+0.02;    #energy after interval in eV\n",
      "EF=EFeV*1.6*10**-19;    #energy after interval in J\n",
      "def f(E):\n",
      "    Q=A*B*math.sqrt(E)\n",
      "    \n",
      "I=(Ef,EF,f)\n",
      "\n",
      "#Result\n",
      "print(\"number of energy states per unit volume is\",I);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('number of energy states per unit volume is', (4.960000000000001e-19, 4.992000000000001e-19, <function f at 0x7f1495202848>))\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.11, Page number 74"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "T=300;   #temperature in K\n",
      "n=8.5*10**28;   #density per m^3\n",
      "rho=1.69*10**-8;   #resistivity in ohm/m^3\n",
      "me=9.11*10**-31;    #mass of electron in kg\n",
      "e=1.6*10**-19;    #charge in coulomb\n",
      "KB=1.38*10**-23;    #boltzmann constant in J/k\n",
      "\n",
      "#Calculation\n",
      "lamda=math.sqrt(3*KB*me*T)/(n*(e**2)*rho);\n",
      "\n",
      "#Result\n",
      "print(\"mean free path of electron in m is\",lamda);\n",
      "\n",
      "#answer given in the book is wrong"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('mean free path of electron in m is', 2.892506814374228e-09)\n"
       ]
      }
     ],
     "prompt_number": 27
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.12, Page number 75"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "rho=1.43*10**-8;    #resistivity in ohm-m\n",
      "n=6.5*10**28;    #electron/m^3\n",
      "m=9.11*10**-34;  #mass in kg\n",
      "e=1.6*10**-19;   #charge in coulomb\n",
      "\n",
      "#Calculation\n",
      "tow=m/(n*(e**2)*rho);\n",
      "\n",
      "#Result\n",
      "print(\"relaxation time of conduction electrons in sec is\",tow);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('relaxation time of conduction electrons in sec is', 3.8285032275416887e-17)\n"
       ]
      }
     ],
     "prompt_number": 28
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.13, Page number 75 ******"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "d=8.92*10**3;   #density in kg/m^3\n",
      "rho=1.73*10**-8;  #resistivity in ohm-m\n",
      "m=9.1*10**-31;    #mass in kg\n",
      "M=63.5;    #atomic weight\n",
      "e=1.6*10**-19;    #charge in coulomb\n",
      "A=6.02*10**26;    #avagadro number\n",
      "\n",
      "#Calculation\n",
      "n=(d*A)/M;\n",
      "mew=1/(rho*n*e);\n",
      "tow=m/(n*(e**2)*rho);\n",
      "mew=math.ceil(mew*10**6)/10**6;   #rounding off to 6 decimals\n",
      "\n",
      "#Result\n",
      "print(\"mobility of electrons in Copper in m/Vs is\",mew);\n",
      "print(\"average time of collision of electrons in copper in sec is\",tow);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('mobility of electrons in Copper in m/Vs is', 0.004273)\n",
        "('average time of collision of electrons in copper in sec is', 2.4297841992299697e-14)\n"
       ]
      }
     ],
     "prompt_number": 31
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.14, Page number 76"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "MH=1.008*2*1.67*10**-27;    #mass in kg\n",
      "T=30;   #temperature in C\n",
      "\n",
      "#Calculation\n",
      "T=T+273;   #temperature in K\n",
      "KB=1.38*10**-23;    #boltzmann constant in J/k\n",
      "KE=(3/2)*KB*T;   #kinetic energy in J\n",
      "KEeV=KE*6.24*10**18;   #kinetic energy in eV\n",
      "cbar=math.sqrt((3*KB*T)/MH);\n",
      "\n",
      "#Result\n",
      "print(\"average kinetic energy in J is\",KE);\n",
      "print(\"average kinetic energy in eV is\",KEeV);\n",
      "print(\"velocity of molecules in m/s is\",cbar);\n",
      "\n",
      "#answers for average kinetic energy in eV and velocity of electrons given in the book are wrong"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('average kinetic energy in J is', 6.2720999999999986e-21)\n",
        "('average kinetic energy in eV is', 0.039137903999999994)\n",
        "('velocity of molecules in m/s is', 1930.269663853336)\n"
       ]
      }
     ],
     "prompt_number": 33
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.15, Page number 77 ****"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "Ee=10;   #electron kinetic energy in eV\n",
      "Ep=10;   #proton kinetic energy in eV\n",
      "me=9.1*10**-31;   #mass of electron in kg\n",
      "mp=1.67*10**-27;   #mass of proton in kg\n",
      "\n",
      "#Calculation\n",
      "EeeV=Ee*1.6*10**-19;   #electron kinetic energy in J\n",
      "EpeV=Ep*1.6*10**-19;   #proton kinetic energy in J\n",
      "cebar=math.sqrt((2*EeeV)/me);\n",
      "cpbar=math.sqrt((2*EpeV)/mp);\n",
      "\n",
      "#Result\n",
      "print(\"velocity of electron in m/s is\",cebar);\n",
      "print(\"velocity of proton in m/s is\",cpbar);\n",
      "\n",
      "#answers given in the book are wrong"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('velocity of electron in m/s is', 1875228.9237539817)\n",
        "('velocity of proton in m/s is', 43774.05241316662)\n"
       ]
      }
     ],
     "prompt_number": 35
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.16, Page number 77"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "A=10;   #area of cross section in mm^2\n",
      "A=A*10**-6;   #area of cross section in m^2\n",
      "i=100;   #current in amp\n",
      "n=8.5*10**28;    #number of electrons per mm^3\n",
      "e=1.6*10**-19;    #electron charge in coulumb\n",
      "\n",
      "#Calculation\n",
      "vd=1/(n*A*e);\n",
      "\n",
      "#Result\n",
      "print(\"drift velocity in m/s is\",vd);\n",
      "\n",
      "#answer given in the book is wrong"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('drift velocity in m/s is', 7.3529411764705884e-06)\n"
       ]
      }
     ],
     "prompt_number": 36
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.17, Page number 78"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "tow=3*10**-14;    #relaxation time in sec\n",
      "n=8*10**28;    #density of electrons per m^3\n",
      "KB=1.38*10**-23;   #boltzmann constant in J/k\n",
      "T=0;   #temperature in C\n",
      "\n",
      "#Calculation\n",
      "T=T+273;   #temperature in K\n",
      "m=9.1*10**-31;   #mass of electron in kg\n",
      "sigma_T=((3*n*tow*(KB**2)*T)/(2*m));\n",
      "sigma_T=math.ceil(sigma_T*10**2)/10**2;   #rounding off to 2 decimals\n",
      "\n",
      "#Result\n",
      "print(\"thermal conductivity of copper in ohm-1 is\",sigma_T);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('thermal conductivity of copper in ohm-1 is', 205.68)\n"
       ]
      }
     ],
     "prompt_number": 38
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}