summaryrefslogtreecommitdiff
path: root/Engineering_Physics/chapter2_2.ipynb
diff options
context:
space:
mode:
authorHardik Ghaghada2014-06-20 15:52:25 +0530
committerHardik Ghaghada2014-06-20 15:52:25 +0530
commite1e59ca3a50d9f93e8b7bc0693b8081d5db77771 (patch)
treef54eab21dd3d725d64a495fcd47c00d37abed004 /Engineering_Physics/chapter2_2.ipynb
parenta78126bbe4443e9526a64df9d8245c4af8843044 (diff)
parent83c1bfceb1b681b4bb7253b47491be2d8b2014a1 (diff)
downloadPython-Textbook-Companions-e1e59ca3a50d9f93e8b7bc0693b8081d5db77771.tar.gz
Python-Textbook-Companions-e1e59ca3a50d9f93e8b7bc0693b8081d5db77771.tar.bz2
Python-Textbook-Companions-e1e59ca3a50d9f93e8b7bc0693b8081d5db77771.zip
Merge pull request #1 from debashisdeb/master
removing problem statements from all the chapters to avoid copyright violations
Diffstat (limited to 'Engineering_Physics/chapter2_2.ipynb')
-rw-r--r--Engineering_Physics/chapter2_2.ipynb531
1 files changed, 478 insertions, 53 deletions
diff --git a/Engineering_Physics/chapter2_2.ipynb b/Engineering_Physics/chapter2_2.ipynb
index 95f30057..a118db3c 100644
--- a/Engineering_Physics/chapter2_2.ipynb
+++ b/Engineering_Physics/chapter2_2.ipynb
@@ -1,6 +1,7 @@
{
"metadata": {
- "name": "chapter2"
+ "name": "",
+ "signature": "sha256:04561aafd347865fa8c83acfb9b60eb84db275f85862655b442f546023cadd1e"
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -11,25 +12,46 @@
"cell_type": "heading",
"level": 1,
"metadata": {},
- "source": "Electron Theory of Metals"
+ "source": [
+ "Electron Theory of Metals"
+ ]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.1, Page number 69"
+ "source": [
+ "Example number 2.1, Page number 69"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "# To calculate the Fermi function\n\n#import module\nimport 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))\nFE=1/(1+math.exp(1));\nFE=math.ceil(FE*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"fermi function is\",FE);",
+ "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"
+ "text": [
+ "('fermi function is', 0.27)\n"
+ ]
}
],
"prompt_number": 5
@@ -38,19 +60,38 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.2, Page number 69"
+ "source": [
+ "Example number 2.2, Page number 69"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "# To calculate the Fermi function\n\n#import module\nimport 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))\nFE=1/(1+math.exp(1));\nFE=math.ceil(FE*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"fermi function is\",FE);",
+ "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"
+ "text": [
+ "('fermi function is', 0.269)\n"
+ ]
}
],
"prompt_number": 6
@@ -59,19 +100,49 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.3, Page number 69"
+ "source": [
+ "Example number 2.3, Page number 69"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "# To calculate the temperature\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nFE=10/100; #fermi function is 10%\nEf=5.5; #fermi energy of silver in eV\nk=1.38*10**-23;\n\n#Calculation\nE=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; \nX=E-Ef; #energy in eV\nX=X*1.6*10**-19; #energy in J\nT = (X/(k*math.log((1/FE)-1)));\nT=math.ceil(T*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"temperature in K is\",T);",
+ "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"
+ "text": [
+ "('temperature in K is', 290.23)\n"
+ ]
}
],
"prompt_number": 8
@@ -80,19 +151,49 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.4, Page number 70 **************************************"
+ "source": [
+ "Example number 2.4, Page number 70 **************************************"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "# To calculate the temperature\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\n#let X=E-Ef\nX=0.5; #E-Ef=0.5 in eV\n\n#Calculation\nX=X*1.6*10**-19; #X in J\nFE=1/100; #fermi function is 1% \nk=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))\nT = X/(k*2.303*math.log10((1/FE)-1));\n\n#Result\nprint(\"temperature in K is\",T);",
+ "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"
+ "text": [
+ "('temperature in K is', 1261.3505710887953)\n"
+ ]
}
],
"prompt_number": 14
@@ -101,19 +202,45 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.5, Page number 71 *******"
+ "source": [
+ "Example number 2.5, Page number 71 *******"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "# To calculate the density and mobility of electrons in silver\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nrho_s=10.5*10**3; #density in kg/m^3\nNA=6.02*10**26; #avagadro number per kmol\nMA=107.9; \n\n#Calculation\nn=(rho_s*NA)/MA;\nsigma=6.8*10**7;\ne=1.6*10**-19; #charge in coulomb\nmew=sigma/(n*e);\nmew=math.ceil(mew*10**6)/10**6; #rounding off to 6 decimals\n\n#Result\nprint(\"density of electrons is\",n);\nprint(\"mobility of electrons in silver in m^2/Vs is\",mew);",
+ "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"
+ "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
@@ -122,19 +249,47 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.6, Page number 71 ***"
+ "source": [
+ "Example number 2.6, Page number 71 ***"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "# To calculate the mobility and average time of collision of electrons\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nd=8.92*10**3; #density in kg/m^3\nrho=1.73*10**-8; #resistivity in ohm-m\nm=9.1*10**-31; #mass in kg\nw=63.5; #atomic weight\ne=1.6*10**-19; #charge in coulomb\nA=6.02*10**26; #avagadro number\n\n#Calculation\nn=(d*A)/w;\nmew=1/(rho*n*e);\ntow=m/(n*(e**2)*rho);\nmew=math.ceil(mew*10**6)/10**6; #rounding off to 6 decimals\n\n#Result\nprint(\"mobility of electrons in Copper in m/Vs is\",mew);\nprint(\"average time of collision of electrons in copper in sec is\",tow);",
+ "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"
+ "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
@@ -143,19 +298,40 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.7, Page number 72"
+ "source": [
+ "Example number 2.7, Page number 72"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "# To calculate the relaxation time of conduction electrons\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nrho=1.54*10**-8; #resistivity in ohm-m\nn=5.8*10**28; #electron/m^3\nm=9.108*10**-31; #mass in kg\ne=1.602*10**-19; #charge in coulomb\n\n#Calculation\ntow=m/(n*(e**2)*rho);\n\n#Result\nprint(\"relaxation time of conduction electrons in sec is\",tow);",
+ "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"
+ "text": [
+ "('relaxation time of conduction electrons in sec is', 3.973281032516849e-14)\n"
+ ]
}
],
"prompt_number": 19
@@ -164,19 +340,49 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.8, Page number 73"
+ "source": [
+ "Example number 2.8, Page number 73"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "# To calculate the temperature\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nFE=10/100; #fermi function is 10%\nEf=5.5; #fermi energy of silver in eV\nk=1.38*10**-23;\n\n#Calculation\nE=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; \nX=E-Ef; #energy in eV\nX=X*1.6*10**-19; #energy in J\nT = (X/(k*math.log((1/FE)-1)));\nT=math.ceil(T*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"temperature in K is\",T);",
+ "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"
+ "text": [
+ "('temperature in K is', 290.23)\n"
+ ]
}
],
"prompt_number": 21
@@ -185,19 +391,39 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.9, Page number 73"
+ "source": [
+ "Example number 2.9, Page number 73"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "# To calculate the Fermi distribution function\n\n#import module\nimport 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))\nFpE=1/(1+math.exp(1));\nFpE=math.ceil(FpE*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"fermi function is\",FpE);\n#the presence of electron at that energy level is not certain",
+ "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"
+ "text": [
+ "('fermi function is', 0.27)\n"
+ ]
}
],
"prompt_number": 23
@@ -206,12 +432,36 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.10, Page number 74 ****************************"
+ "source": [
+ "Example number 2.10, Page number 74 ****************************"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "# To calculate the number of states per unit volume\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nm=9.1*10**-31; #mass in kg\nh=6.626*10**-34;\nA=(8*m)**(3/2);\n\n#Calculation\nB=math.pi/(2*h**3);\nEfeV=3.10; #fermi energy in eV\nEf=EfeV*1.6*10**-19; #fermi energy in J\nEFeV=EfeV+0.02; #energy after interval in eV\nEF=EFeV*1.6*10**-19; #energy after interval in J\nfunction Q=f(E),Q=A*B*math.sqrt(E),endfunction\nI=intg(Ef,EF,f)\n\n#Result\nprint(\"number of energy states per unit volume is\",I);",
+ "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",
+ "function Q=f(E),Q=A*B*math.sqrt(E),endfunction\n",
+ "I=intg(Ef,EF,f)\n",
+ "\n",
+ "#Result\n",
+ "print(\"number of energy states per unit volume is\",I);"
+ ],
"language": "python",
"metadata": {},
"outputs": [
@@ -230,19 +480,44 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.11, Page number 74"
+ "source": [
+ "Example number 2.11, Page number 74"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "# To calculate the mean free path of electron\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nT=300; #temperature in K\nn=8.5*10**28; #density per m^3\nrho=1.69*10**-8; #resistivity in ohm/m^3\nme=9.11*10**-31; #mass of electron in kg\ne=1.6*10**-19; #charge in coulomb\nKB=1.38*10**-23; #boltzmann constant in J/k\n\n#Calculation\nlamda=math.sqrt(3*KB*me*T)/(n*(e**2)*rho);\n\n#Result\nprint(\"mean free path of electron in m is\",lamda);\n\n#answer given in the book is wrong",
+ "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"
+ "text": [
+ "('mean free path of electron in m is', 2.892506814374228e-09)\n"
+ ]
}
],
"prompt_number": 27
@@ -251,19 +526,39 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.12, Page number 75"
+ "source": [
+ "Example number 2.12, Page number 75"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "# To calculate the relaxation time of conduction electrons\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nrho=1.43*10**-8; #resistivity in ohm-m\nn=6.5*10**28; #electron/m^3\nm=9.11*10**-34; #mass in kg\ne=1.6*10**-19; #charge in coulomb\n\n#Calculation\ntow=m/(n*(e**2)*rho);\n\n#Result\nprint(\"relaxation time of conduction electrons in sec is\",tow);",
+ "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"
+ "text": [
+ "('relaxation time of conduction electrons in sec is', 3.8285032275416887e-17)\n"
+ ]
}
],
"prompt_number": 28
@@ -272,19 +567,46 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.13, Page number 75 ******"
+ "source": [
+ "Example number 2.13, Page number 75 ******"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "# To calculate the mobility and average time of collision of electrons\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nd=8.92*10**3; #density in kg/m^3\nrho=1.73*10**-8; #resistivity in ohm-m\nm=9.1*10**-31; #mass in kg\nM=63.5; #atomic weight\ne=1.6*10**-19; #charge in coulomb\nA=6.02*10**26; #avagadro number\n\n#Calculation\nn=(d*A)/M;\nmew=1/(rho*n*e);\ntow=m/(n*(e**2)*rho);\nmew=math.ceil(mew*10**6)/10**6; #rounding off to 6 decimals\n\n#Result\nprint(\"mobility of electrons in Copper in m/Vs is\",mew);\nprint(\"average time of collision of electrons in copper in sec is\",tow);",
+ "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"
+ "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
@@ -293,19 +615,47 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.14, Page number 76"
+ "source": [
+ "Example number 2.14, Page number 76"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "# To calculate the order of magnitude of velocity of molecules\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nMH=1.008*2*1.67*10**-27; #mass in kg\nT=30; #temperature in C\n\n#Calculation\nT=T+273; #temperature in K\nKB=1.38*10**-23; #boltzmann constant in J/k\nKE=(3/2)*KB*T; #kinetic energy in J\nKEeV=KE*6.24*10**18; #kinetic energy in eV\ncbar=math.sqrt((3*KB*T)/MH);\n\n#Result\nprint(\"average kinetic energy in J is\",KE);\nprint(\"average kinetic energy in eV is\",KEeV);\nprint(\"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",
+ "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"
+ "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
@@ -314,19 +664,46 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.15, Page number 77 ****"
+ "source": [
+ "Example number 2.15, Page number 77 ****"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "# To calculate the velocity of an electron and proton\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nEe=10; #electron kinetic energy in eV\nEp=10; #proton kinetic energy in eV\nme=9.1*10**-31; #mass of electron in kg\nmp=1.67*10**-27; #mass of proton in kg\n\n#Calculation\nEeeV=Ee*1.6*10**-19; #electron kinetic energy in J\nEpeV=Ep*1.6*10**-19; #proton kinetic energy in J\ncebar=math.sqrt((2*EeeV)/me);\ncpbar=math.sqrt((2*EpeV)/mp);\n\n#Result\nprint(\"velocity of electron in m/s is\",cebar);\nprint(\"velocity of proton in m/s is\",cpbar);\n\n#answers given in the book are wrong",
+ "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"
+ "text": [
+ "('velocity of electron in m/s is', 1875228.9237539817)\n",
+ "('velocity of proton in m/s is', 43774.05241316662)\n"
+ ]
}
],
"prompt_number": 35
@@ -335,19 +712,43 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.16, Page number 77"
+ "source": [
+ "Example number 2.16, Page number 77"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "# To calculate the drift velocity of free electrons\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nA=10; #area of cross section in mm^2\nA=A*10**-6; #area of cross section in m^2\ni=100; #current in amp\nn=8.5*10**28; #number of electrons per mm^3\ne=1.6*10**-19; #electron charge in coulumb\n\n#Calculation\nvd=1/(n*A*e);\n\n#Result\nprint(\"drift velocity in m/s is\",vd);\n\n#answer given in the book is wrong",
+ "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"
+ "text": [
+ "('drift velocity in m/s is', 7.3529411764705884e-06)\n"
+ ]
}
],
"prompt_number": 36
@@ -356,19 +757,43 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.17, Page number 78"
+ "source": [
+ "Example number 2.17, Page number 78"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "# To calculate the thermal conductivity of copper\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\ntow=3*10**-14; #relaxation time in sec\nn=8*10**28; #density of electrons per m^3\nKB=1.38*10**-23; #boltzmann constant in J/k\nT=0; #temperature in C\n\n#Calculation\nT=T+273; #temperature in K\nm=9.1*10**-31; #mass of electron in kg\nsigma_T=((3*n*tow*(KB**2)*T)/(2*m));\nsigma_T=math.ceil(sigma_T*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"thermal conductivity of copper in ohm-1 is\",sigma_T);",
+ "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"
+ "text": [
+ "('thermal conductivity of copper in ohm-1 is', 205.68)\n"
+ ]
}
],
"prompt_number": 38
@@ -376,7 +801,7 @@
{
"cell_type": "code",
"collapsed": false,
- "input": "",
+ "input": [],
"language": "python",
"metadata": {},
"outputs": []