{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 8.: Statics and Band theory of Solids"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.1, page no-208"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Fermi Energy of metals\n",
      "\n",
      "import math\n",
      "# variable declaration\n",
      "d_cu=8.96*10**3                         # density of cu\n",
      "a_cu=63.55                              # Atomic weight of cu\n",
      "d_z=7.14*10**3                          # density of Zn     \n",
      "a_z=65.38                               # Atomic weight of Zn\n",
      "d_al=2700                               # density of Al\n",
      "a_al=27                                 # Atomic weight of Al     \n",
      "avg=6.022*10**26                        # Avogadro's number    \n",
      "h=6.626*10**-34                         # Planck's constant\n",
      "m=9.1*10**-31                           # mass of an electrons\n",
      "e=1.6*10**-19                           # charge of an electron\n",
      "\n",
      "\n",
      "\n",
      "#(i)\n",
      "\n",
      "# Calculations\n",
      "n_cu=d_cu*avg/a_cu\n",
      "e_cu=(h**2/(8*m))*(3*n_cu/math.pi)**(2.0/3.0)\n",
      "e_cu=e_cu/e\n",
      "\n",
      "#Result\n",
      "print(\"\\n(i)For Cu\\nThe electron concentration in Cu is %.4f*10^28 per m^3\\nFermi energy at 0 k =%.4f eV \"%(n_cu*10**-28,e_cu))\n",
      "\n",
      "#(ii)\n",
      "\n",
      "# calculations\n",
      "n_z=d_z*avg*2/a_z\n",
      "e_z=(h**2/(8*m))*(3*n_z/math.pi)**(2.0/3.0)\n",
      "e_z=e_z/e\n",
      "\n",
      "# Result\n",
      "print(\"\\n(ii)For Zn\\nThe electron concentration in Zn is %.5f*10^28 per m^3\\nFermi energy at 0 k =%.2f eV \"%(n_z*10**-28,e_z))\n",
      "\n",
      "#(iii)\n",
      "\n",
      "# Calculations\n",
      "n_al=d_al*avg*3/a_al\n",
      "e_al=(h**2/(8*m))*(3*n_al/math.pi)**(2.0/3.0)\n",
      "e_al=e_al/e\n",
      "\n",
      "#Result\n",
      "print(\"\\n(iii)For Al\\nThe electron concentration in Al is %.3f*10^28 per m^3\\nFermi energy at 0 k =%.2f eV \"%(n_al*10**-28,e_al))\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "(i)For Cu\n",
        "The electron concentration in Cu is 8.4905*10^28 per m^3\n",
        "Fermi energy at 0 k =7.0608 eV \n",
        "\n",
        "(ii)For Zn\n",
        "The electron concentration in Zn is 13.15298*10^28 per m^3\n",
        "Fermi energy at 0 k =9.45 eV \n",
        "\n",
        "(iii)For Al\n",
        "The electron concentration in Al is 18.066*10^28 per m^3\n",
        "Fermi energy at 0 k =11.68 eV \n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.2, page no-210"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Density of states for Cu\n",
      "\n",
      "import math\n",
      "# variable declaration\n",
      "avg=6.023*10**26                            # avogadro's number\n",
      "h=6.626*10**-34                             # Planck's constant \n",
      "m=9.1*10**-31                               # mass of an electron\n",
      "e=1.6*10**-19                               # charge of an electron\n",
      "n=8.4905*10**28                             # sphere of radius\n",
      "gam=6.82*10**27                             # gamma\n",
      "\n",
      "# Calculations\n",
      "ef=(h**2/(8*m))*(3*n/math.pi)**(2.0/3.0)\n",
      "ef=ef/e\n",
      "x=(gam*math.sqrt(ef))/2\n",
      "\n",
      "#Result\n",
      "print(\"The density of states for Cu at the Fermi level for T = 0 K is %.0f*10^27 m^-3\"%(x*10**-27))\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The density of states for Cu at the Fermi level for T = 0 K is 9*10^27 m^-3\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.3, page no-210"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Nordheims coeeficient\n",
      "\n",
      "import math\n",
      "#Variable declaration\n",
      "rni=63                            # Resistivity of Ni\n",
      "rcr=129                           # Resistivity of Cr\n",
      "k=1120                            # Resistivity of 80% Ni + 20% Cr\n",
      "\n",
      "#Calculations\n",
      "c=(k*10**-9)/(0.8*(1-0.8))\n",
      "\n",
      "#Result\n",
      "print(\"The Nordheims coeeficient is %.0f *10^-6 Ohm-m\"%(c*10**6))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Nordheims coeeficient is 7 *10^-6 Ohm-m\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.4, page no-211"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Conductivity of Al\n",
      "\n",
      "import math\n",
      "#Variable declaaration\n",
      "d=2700                            # Density of Al\n",
      "awt=27                            # Atomic weight\n",
      "t=10**-14                         # Relaxation time\n",
      "e=1.6*10**-19                     # charge of an electron\n",
      "m=9.1*10**-31                     # mass of an electron\n",
      "avg=6.022*10**26                  # Avogadros number\n",
      "\n",
      "# calculation\n",
      "n=avg*d*3/awt\n",
      "sig=(n*t*e**2)/m\n",
      "\n",
      "#Result\n",
      "print(\"The conductivity of Al is %.4f*10^7 ohm-m.\"%(sig*10**-7))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The conductivity of Al is 5.0823*10^7 ohm-m.\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.5, page no-211"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Fermi distribution function\n",
      "\n",
      "import math\n",
      "#variable declaration\n",
      "e1=0.01                   # difference between energy level to fermi level in eV\n",
      "e=1.6*10**-19             # charge of an electron\n",
      "ed=e*e1                   # difference between energy level to fermi level in J\n",
      "T=200                     # Temperature\n",
      "k=1.38*10**-23            # Boltzmann's constant\n",
      "\n",
      "# Calculations\n",
      "E=1/(1+math.e**(ed/(T*k)))\n",
      "print(\"The Fermi distribution function for energy E is %.4f\"%E)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Fermi distribution function for energy E is 0.3590\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.6, page no-212"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Fermi energy and fermi temperature\n",
      "\n",
      "import math\n",
      "#variable declaration\n",
      "v=0.86*10**6                      # velocity of electron\n",
      "m=9.11*10**-31                     # mass of electron\n",
      "e=1.6*10**-19                     # electronic charge   \n",
      "k=1.38*10**-23                    # Boltzmann's constant \n",
      "\n",
      "#calculations\n",
      "E=(m*v**2)/2\n",
      "E= math.floor(E*10**22)/10**22\n",
      "T=E/k\n",
      "\n",
      "#Result\n",
      "print(\"\\nThe fermi energy is %.3f*10^-19 J\\nThe Fermi Temperature Tf is %.2f*10^4 K\"%(E*10**19,T*10**-4))\n",
      "# answer in the book for Temperature id 2.43 x 10^4"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "The fermi energy is 3.368*10^-19 J\n",
        "The Fermi Temperature Tf is 2.44*10^4 K\n"
       ]
      }
     ],
     "prompt_number": 25
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.7, page no-212"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# No of states lying between energy levels\n",
      "\n",
      "import math\n",
      "# variable declaration\n",
      "m=9.1*10**-31                            # mass of electron\n",
      "dE=0.01                                  # energy interval\n",
      "h=6.63*10**-34                           # planck's constant\n",
      "eF=3.0                                   # Fermi energy\n",
      "e=1.6*10**-19                            # electronic charge\n",
      "\n",
      "#Calculations\n",
      "E1=eF*e\n",
      "E2=E1+e*dE\n",
      "n=(4*math.pi*(2*m)**(1.5))/h**3\n",
      "k=((2*0.3523/3)*((E2**(1.5)-(E1**(1.5)))))\n",
      "n=n*k\n",
      "\n",
      "#Result\n",
      "print(\"The number of states lying between the energy level is %.2f*10^25\"%(n*10**-25))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The number of states lying between the energy level is 4.14*10^25\n"
       ]
      }
     ],
     "prompt_number": 27
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.8, page no-214"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Fermi Velocity\n",
      "\n",
      "import math\n",
      "#Variable declaration\n",
      "Tf=24600                       # Fermi temperature of the metal\n",
      "m=9.11*10**-31                 # mass of electron\n",
      "k=1.38*10**-23                 # Boltzmann's constant\n",
      "\n",
      "#Calculations\n",
      "vf=math.sqrt(2*k*Tf/m)\n",
      "\n",
      "#Result\n",
      "print(\"The Fermi Velocity is %.4f *10^6 m/s\"%(vf*10**-6))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Fermi Velocity is 0.8633 *10^6 m/s\n"
       ]
      }
     ],
     "prompt_number": 29
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.9, page no-214"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Fermi energy\n",
      "\n",
      "import math\n",
      "#variable declaration\n",
      "n=18.1*10**28                   # elecron density of electron\n",
      "h=6.62*10**-34                  # Planck's constant\n",
      "m=9.1*10**-31                   # mass of an electron\n",
      "e=1.6*10**-19                   # electronic charge\n",
      "\n",
      "#calculations\n",
      "ef=((3*n/(8*math.pi))**(2.0/3.0))*((h**2)/(2*m))\n",
      "ef=ef/e\n",
      "ef=math.ceil(ef*100)/100\n",
      "\n",
      "#Result\n",
      "print(\"The Fermi energy at 0 K is %.2f eV \"%(ef))\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Fermi energy at 0 K is 11.68 eV \n"
       ]
      }
     ],
     "prompt_number": 40
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.10, page no-215"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Fermi energy \n",
      "\n",
      "import math\n",
      "#variable declaration\n",
      "n=18.1*10**28                # elecron density of electron\n",
      "h=6.62*10**-34               # Planck's constant\n",
      "m=9.1*10**-31                # mass of an electron\n",
      "e=1.6*10**-19                # electronic charge\n",
      "\n",
      "#calculations\n",
      "ef=((3*n/(8*math.pi))**(2.0/3.0))*((h**2)/(2*m))\n",
      "ef=ef/e\n",
      "ef=math.ceil(ef*100)/100\n",
      "\n",
      "#result\n",
      "print(\"The Fermi energy at 0 K is %.2f eV \"%ef)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Fermi energy at 0 K is 11.68 eV \n"
       ]
      }
     ],
     "prompt_number": 45
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.11, page no-215"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Temperature calculation\n",
      "\n",
      "import math\n",
      "#variable declaration\n",
      "e=1.6*10**-19             # electronic charge\n",
      "Ed=0.5*e                  # difference between energy level to fermi level\n",
      "k=1.38*10**-23            # Boltzmann's constant\n",
      "x=0.01                    # probability\n",
      "\n",
      "#Calculaations\n",
      "T=Ed/(k*math.log((1/x)-1))\n",
      "\n",
      "#Result\n",
      "print(\"Temperature at which there is 1%% probability that a state with 0.5 eV energy occupied above the Fermi energy level is %.1f K\"%T)\n",
      "#answer is not matching with the answer given in the book"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Temperature at which there is 1% probability that a state with 0.5 eV energy occupied above the Fermi energy level is 1261.6 K\n"
       ]
      }
     ],
     "prompt_number": 49
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.14, page no-218"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#energies for the occupying of electrons\n",
      "import math\n",
      "\n",
      "#variable declaration\n",
      "ef=2.1                      # Fermi energy\n",
      "k=1.38*10**-23              # Boltzmann's constant\n",
      "T=300                       # Temperature\n",
      "e=1.6*10**-19               # Electronic charge\n",
      "\n",
      "#calculations\n",
      "\n",
      "#(i)\n",
      "p1=0.99                     # probability\n",
      "E1=ef+(k*T*math.log(-1+1/p1))/e\n",
      "\n",
      "#(ii)\n",
      "p2=0.01                     # probability\n",
      "E2=ef+(k*T*math.log(-1+1/p2))/e\n",
      "\n",
      "#(iii)\n",
      "p3=0.5                     # probability\n",
      "E3=ef+(k*T*math.log(-1+1/p3))/e\n",
      "\n",
      "#Result\n",
      "\n",
      "print(\"\\nThe energies for the occupying of electrons at %d K for the probability of %.2f are %.2f eV\"%(T,p1,E1))\n",
      "\n",
      "print(\"\\nThe energies for the occupying of electrons at %d K for the probability of %.2f are %.2f eV\"%(T,p2,E2))\n",
      "\n",
      "print(\"\\nThe energies for the occupying of electrons at %d K for the probability of %.2f are %.2f eV\"%(T,p3,E3))\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "The energies for the occupying of electrons at 300 K for the probability of 0.99 are 1.98 eV\n",
        "\n",
        "The energies for the occupying of electrons at 300 K for the probability of 0.01 are 2.22 eV\n",
        "\n",
        "The energies for the occupying of electrons at 300 K for the probability of 0.50 are 2.10 eV\n"
       ]
      }
     ],
     "prompt_number": 53
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.15, page no-219"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Fermi distribution function\n",
      "\n",
      "import math\n",
      "# Variable declarations\n",
      "e=1.6*10**-19                       # Electronic charge\n",
      "ed=0.02*e                           # difference between energy level to fermi level\n",
      "T1=200                              # Temperature 1\n",
      "T2=400                              # Temperature 2\n",
      "k=1.38*10**-23                      # Boltzmann's constant\n",
      "\n",
      "#Calculations\n",
      "fe1=1/(1+math.e**(ed/(k*T1)))\n",
      "fe2=1/(1+math.e**(ed/(k*T2)))\n",
      "\n",
      "#Result\n",
      "print(\"\\nThe Fermi distribution function for the given energy at %d K is %.5f\"%(T1,fe1))\n",
      "print(\"\\nThe Fermi distribution function for the given energy at %d K is %.4f\"%(T2,fe2))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "The Fermi distribution function for the given energy at 200 K is 0.23877\n",
        "\n",
        "The Fermi distribution function for the given energy at 400 K is 0.3590\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.16, page no-220"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Fermi energy for given metal\n",
      "\n",
      "import math\n",
      "#Variaable declaration\n",
      "d=10500                           # Density of the metal\n",
      "avg=6.022*10**26                  # Avogadro's number\n",
      "awt=107.9                         # Atomic weight of metal\n",
      "h=6.62*10**-34                    # Planck's constant\n",
      "m=9.1*10**-31                     # mass of an electron\n",
      "e=1.6*10**-19                     # electronic charge\n",
      "\n",
      "#Calculattions\n",
      "n=d*avg/awt\n",
      "ef=((3*n/(8*math.pi))**(2.0/3.0))*((h**2)/(2*m))\n",
      "ef=ef/e\n",
      "\n",
      "#Result\n",
      "print(\"The Fermi energy for given metal is %.1f eV \"%ef)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Fermi energy for given metal is 5.5 eV \n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.17, page no-221"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Fermi distribution function \n",
      "\n",
      "import math\n",
      "#Variable declaration\n",
      "e=1.6*10**-19                         # electronic charge\n",
      "ed=0.2*e                              # difference between energy level to Fermi level\n",
      "T1=300                                # Temperature 1\n",
      "T2=1000                               # Temperature 2\n",
      "k=1.38*10**-23                        # Boltzmann's constant\n",
      "\n",
      "#Calculations\n",
      "fe1=1/(1+math.e**(ed/(k*T1)))\n",
      "fe2=1/(1+math.e**(ed/(k*T2)))\n",
      "\n",
      "#Result\n",
      "print(\"\\nThe Fermi distribution function for the given energy at %d K is %.7f\"%(T1,fe1))\n",
      "print(\"\\nThe Fermi distribution function for the given energy at %d K is %.4f\"%(T2,fe2))\n",
      "# Answer for 300 K is wrong in the book"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "The Fermi distribution function for the given energy at 300 K is 0.0004395\n",
        "\n",
        "The Fermi distribution function for the given energy at 1000 K is 0.0896\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.18, page no-221"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Free electrons concentration\n",
      "\n",
      "import math\n",
      "#Variable declarations\n",
      "h=6.62*10**-34                         # Planck's constant\n",
      "m=9.1*10**-31                          # Mass of electron\n",
      "e=1.6*10**-19                          # Charge of an electron\n",
      "ef=3*e                                 # Fermi Energy\n",
      "\n",
      "#Calculations\n",
      "k=((3/(8*math.pi))**(2.0/3.0))*((h**2)/(2*m))\n",
      "k=ef/k\n",
      "n=k**(1.5)\n",
      "\n",
      "#Result\n",
      "print(\"The number of free electrons concentration in metal is %.2f *10^28 per cubic meter \"%(n*10**-28))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The number of free electrons concentration in metal is 2.36 *10^28 per cubic meter \n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.19, page no-221"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Free electrons concentration in metal  \n",
      "\n",
      "import math\n",
      "#Variable declaration\n",
      "h=6.626*10**-34                     # Planck's constant\n",
      "m=9.1*10**-31                       # Mass of electron\n",
      "e=1.6*10**-19                       # Charge of electron\n",
      "ef=5.5*e                            # Fermi energy\n",
      "\n",
      "# Calculation\n",
      "k=((3/(8*math.pi))**(2.0/3.0))*((h**2)/(2*m))\n",
      "k=ef/k\n",
      "n=k**(1.5)\n",
      "\n",
      "#Result\n",
      "print(\"The number of free electrons concentration in metal is %.3f * 10^28 per cubic meter \"%(n*10**-28))\n",
      "#Answer is matching with the answer given in the book"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The number of free electrons concentration in metal is 5.837 * 10^28 per cubic meter \n"
       ]
      }
     ],
     "prompt_number": 31
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.20, page no-221"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# electrons concentration and termal velocity of electrons\n",
      "\n",
      "import math\n",
      "#variable declaration\n",
      "h=6.626*10**-34                             # Planck's constant\n",
      "m=9.1*10**-31                              # mass of electron\n",
      "e=1.6*10**-19                              # charge of electron\n",
      "ef=7*e                                     # Fermi energy\n",
      "\n",
      "#calculations\n",
      "k=((3/(8*math.pi))**(2.0/3.0))*((h**2)/(2*m))\n",
      "k=ef/k\n",
      "n=k**(1.5)\n",
      "vth=math.sqrt(2*ef/m)\n",
      "\n",
      "#Result\n",
      "print(\"The number of free electrons concentration in metal is %.2f *10^28 per cubic meter \"%(math.ceil(n*10**-28*10**2)/10**2))\n",
      "print(\"\\nThe termal velocity of electrons in copper is %.3f *10^6 m/s\"%(math.floor(vth*10**-6*10**3)/10**3))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The number of free electrons concentration in metal is 8.39 *10^28 per cubic meter \n",
        "\n",
        "The termal velocity of electrons in copper is 1.568 *10^6 m/s\n"
       ]
      }
     ],
     "prompt_number": 41
    }
   ],
   "metadata": {}
  }
 ]
}