diff options
author | Jovina Dsouza | 2014-07-25 00:00:07 +0530 |
---|---|---|
committer | Jovina Dsouza | 2014-07-25 00:00:07 +0530 |
commit | fd5a671b82455b88fd313d8d0bee2793ab27739a (patch) | |
tree | e35148d9f2c5d1ee88f62f903b2ca46292b6f568 | |
parent | c8733e4b6b4bffcddf7eb45ff1c72ccc837aa3af (diff) | |
download | Python-Textbook-Companions-fd5a671b82455b88fd313d8d0bee2793ab27739a.tar.gz Python-Textbook-Companions-fd5a671b82455b88fd313d8d0bee2793ab27739a.tar.bz2 Python-Textbook-Companions-fd5a671b82455b88fd313d8d0bee2793ab27739a.zip |
adding book
54 files changed, 9562 insertions, 2994 deletions
diff --git a/Engineering_Physics/Chapter1.ipynb b/Engineering_Physics/Chapter1.ipynb new file mode 100755 index 00000000..a3614569 --- /dev/null +++ b/Engineering_Physics/Chapter1.ipynb @@ -0,0 +1,357 @@ +{ + "metadata": { + "name": "Chapter1", + "signature": "sha256:e55f587b2da98ead68f73bb2b4d29bef91aa67eb577c460fb9dcaab92acc4339" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": "1: Ultrasonics" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.1, Page number 20" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#Variable declaration\nv = 1440; #velocity of ultrasonic waves(m/s)\nt = 0.33; #time elapsed(s)\n\n#Calculation\nd = v*t; #distance travelled(m)\nd1 = d/2; #depth of submarine(m)\n\n#Result\nprint \"depth of the submerged submarine is\",d1, \"m\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "depth of the submerged submarine is 237.6 m\n" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.2, Page number 21" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nl = 40; #length of iron rod(mm)\nE = 115*10**9; #Young's modulus(N/m**2)\nrho = 7.25*10**3; #density of pure iron(kg/m**3)\n\n#Calculation\nl = l*10**-3; #length of iron rod(m)\nnew = (1/(2*l))*math.sqrt(E/rho); #natural frequency of the rod(Hz)\nnew = new*10**-3; #natural frequency of the rod(kHz)\nnew=math.ceil(new*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"depth of the submerged submarine is\",new, \"kHz\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "depth of the submerged submarine is 49.785 kHz\n" + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.3, Page number 21" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nl = 1; #length of quartz crystal(mm)\nE = 7.9*10**10; #Young's modulus(N/m**2)\nrho = 2650; #density(kg/m**3)\n\n#Calculation\nl = l*10**-3; #length of iron rod(m)\nnew = (1/(2*l))*math.sqrt(E/rho); #natural frequency of the rod(Hz)\nnew = new*10**-6; \nnew=math.ceil(new*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint \"fundamental frequency of crystal is\",new, \"*10**6 Hz\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "fundamental frequency of crystal is 2.73 *10**6 Hz\n" + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.4, Page number 22" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nd = 0.55; #distance between 2 constructive antinodes(mm)\nnew = 1.5; #frequency of crystal(MHz)\n \n#Calculation\nnew = new*10**6; #frequency of crystal(Hz)\nd = d*10**-3; #distance between 2 constructive antinodes(m)\n#distance between 2 antinodes is given by lamda/2\nlamda = 2*d; #wavelength of ultrasonic waves(m)\nv = new*lamda; #velocity of waves(m/s)\n\n#Result\nprint \"velocity of waves is\",int(v), \"m/s\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "velocity of waves is 1650 m/s\n" + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.5, Page number 22" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nl = 50; #length of rod(mm)\nE = 11.5*10**10; #Young's modulus(N/m**2)\nrho = 7250; #density(kg/m**3)\n\n#Calculation\nl = l*10**-3; #length of iron rod(m)\nnew = (1/(2*l))*math.sqrt(E/rho); #natural frequency of the rod(Hz)\nnew = new*10**-3; #natural frequency of the rod(kHz)\nnew = math.ceil(new*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint \"natural frequency of rod is\",new, \"kHz\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "natural frequency of rod is 39.83 kHz\n" + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.6, Page number 22" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nl = 2; #length of crystal(mm)\nE = 7.9*10**10; #Young's modulus(N/m**2)\nrho = 2650; #density(kg/m**3)\n\n#Calculation\nl = l*10**-3; #length of iron rod(m)\nnew = (1/(2*l))*math.sqrt(E/rho); #natural frequency of the rod(Hz)\nnew = new*10**-6; #natural frequency of the rod(MHz)\nnew=math.ceil(new*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"frequency of crystal is\",new, \"MHz\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "frequency of crystal is 1.365 MHz\n" + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.7, Page number 23" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nl = 3; #length of crystal(mm)\nE = 8*10**10; #Young's modulus(N/m**2)\nrho = 2500; #density(kg/m**3)\n\n#Calculation\nl = l*10**-3; #length of iron rod(m)\nnew = (1/(2*l))*math.sqrt(E/rho); #natural frequency of the rod(Hz)\nnew = new*10**-3; #natural frequency of the rod(kHz) \nnew=math.ceil(new*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint \"frequency of crystal is\",new, \"kHz\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "frequency of crystal is 942.81 kHz\n" + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.8, Page number 23" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nl = 1.5; #length of crystal(mm)\nE = 7.9*10**10; #Young's modulus(N/m**2)\nrho = 2650; #density(kg/m**3)\n\n#Calculation\nl = l*10**-3; #length of iron rod(m)\nnew = (1/(2*l))*math.sqrt(E/rho); #natural frequency of the rod(Hz)\nnew = new*10**-6; #natural frequency of the rod(MHz) \nnew=math.ceil(new*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint \"frequency of crystal is\",new, \"MHz\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "frequency of crystal is 1.82 MHz\n" + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.9, Page number 24" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#Variable declaration\nv = 1440; #velocity of ultrasonic waves(m/s)\nt = 0.95; #time elapsed(s)\n\n#Calculation\nd = v*t; #distance travelled(m)\nd1 = d/2; #depth of sea(m)\n\n#Result\nprint \"depth of the submerged submarine is\",int(d1), \"m\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "depth of the submerged submarine is 684 m\n" + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.10, Page number 24" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#Variable declaration\nv = 1440; #velocity of ultrasonic waves(m/s)\nt = 0.83; #time elapsed(s)\n\n#Calculation\nd = v*t; #distance travelled(m)\nd1 = d/2; #depth of submarine(m)\n\n#Result\nprint \"depth of the submerged submarine is\",d1, \"m\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "depth of the submerged submarine is 597.6 m\n" + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.11, Page number 24" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\naS = 1050; #total absorption inside hall(Sabine)\nV = 9000; #volume of cinema hall(m**3)\n\n#Calculation\nT = 0.165*V/aS; #reverberation time of hall(s)\nT = math.ceil(T*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint \"reverberation time of the hall is\",T, \"s\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "reverberation time of the hall is 1.4143 s\n" + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.12, Page number 25" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\na = 0.65; #average absorption coefficient(Sabine/m**2)\nV = 13500; #volume of auditorium(m**3)\nT = 1.2; #reverberation time of hall(s)\n\n#Calculation\nS = 0.165*V/(a*T); #reverberation time of hall(s)\nS = math.ceil(S*10)/10; #rounding off to 1 decimal\n\n#Result\nprint \"total area of interior surface is\",S, \"m**2\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "total area of interior surface is 2855.8 m**2\n" + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.13, Page number 25" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nV = 15000; #volume of cinema hall(m**3)\nT1 = 1.3; #initial reverberation time of hall(s)\na1S1 = 300; #number of chairs placed\n\n#Calculation\naS = 0.165*V/T1; #total absorption of hall\nT2 = (0.165*V)/(aS+a1S1); #reverberation time of hall after adding chairs(s)\nT2 = math.ceil(T2*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint \"reverberation time of the hall after adding chairs is\",T2, \"s\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "reverberation time of the hall after adding chairs is 1.1231 s\n" + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.14, Page number 26" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#Variable declaration\nv = 1440; #velocity of ultrasonic waves(m/s)\nt = 0.5; #time elapsed(s)\n\n#Calculation\nd = v*t; #distance travelled(m)\nd1 = d/2; #depth of submarine(m)\n\n#Result\nprint \"depth of the submerged submarine is\",int(d1), \"m\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "depth of the submerged submarine is 360 m\n" + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.15, Page number 26" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nd = 0.4; #distance between 2 constructive antinodes(mm)\nnew = 1.5; #frequency of crystal(MHz)\n \n#Calculation\nnew = new*10**6; #frequency of crystal(Hz)\nd = d*10**-3; #distance between 2 constructive antinodes(m)\n#distance between 2 antinodes is given by lamda/2\nlamda = 2*d; #wavelength of ultrasonic waves(m)\nv = new*lamda; #velocity of waves(m/s)\n\n#Result\nprint \"velocity of waves is\",int(v), \"m/s\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "velocity of waves is 1200 m/s\n" + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.16, Page number 26" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nl = 40; #length of iron rod(mm)\nE = 11.5*10**10; #Young's modulus(N/m**2)\nrho = 7250; #density of pure iron(kg/m**3)\n\n#Calculation\nl = l*10**-3; #length of iron rod(m)\nnew = (1/(2*l))*math.sqrt(E/rho); #natural frequency of the rod(Hz)\nnew = new*10**-3; #natural frequency of the rod(kHz)\nnew=math.ceil(new*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"depth of the submerged submarine is\",new, \"kHz\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "depth of the submerged submarine is 49.785 kHz\n" + } + ], + "prompt_number": 18 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Engineering_Physics/Chapter10.ipynb b/Engineering_Physics/Chapter10.ipynb new file mode 100755 index 00000000..051ee9c1 --- /dev/null +++ b/Engineering_Physics/Chapter10.ipynb @@ -0,0 +1,62 @@ +{ + "metadata": { + "name": "Chapter10" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": "10: Dielectric Materials" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 10.1, Page number 289" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nepsilon_r = 1.0000684; #dielectric constant\nN = 2.7*10**25; #number of atoms(per m**3)\nepsilon0 = 8.85*10**-12; #permittivity of free space\n\n#Calculation\nalpha_e = epsilon0*(epsilon_r-1)/N; #electronic polarizability(Fm**2)\n\n#Result\nprint \"electronic polarizability is\",alpha_e,\"Fm**2\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "electronic polarizability is 2.242e-41 Fm**2\n" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 10.2, Page number 290" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nepsilon_r = 1.0024; #relative permittivity\nN = 2.7*10**25; #number of atoms(per m**3)\nepsilon0 = 8.85*10**-12; #permittivity of free space\n\n#Calculation\nalpha_e = epsilon0*(epsilon_r-1)/N; #electronic polarizability(Fm**2)\n\n#Result\nprint \"electronic polarizability is\",alpha_e,\"Fm**2\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "electronic polarizability is 7.86666666667e-40 Fm**2\n" + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Engineering_Physics/Chapter10_1.ipynb b/Engineering_Physics/Chapter10_1.ipynb index b2bd25cb..051ee9c1 100755 --- a/Engineering_Physics/Chapter10_1.ipynb +++ b/Engineering_Physics/Chapter10_1.ipynb @@ -1,7 +1,6 @@ { "metadata": { - "name": "", - "signature": "sha256:4b61028c3be5c168cde4c3aa75ae23500168dbc119942b73de7c79e4a037fd53" + "name": "Chapter10" }, "nbformat": 3, "nbformat_minor": 0, @@ -12,52 +11,25 @@ "cell_type": "heading", "level": 1, "metadata": {}, - "source": [ - "10: Statistical Mechanics" - ] + "source": "10: Dielectric Materials" }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 10.1, Page number 222" - ] + "source": "Example number 10.1, Page number 289" }, { "cell_type": "code", "collapsed": false, - "input": [ - "\n", - "#importing modules\n", - "from __future__ import division\n", - "import math\n", - "\n", - "#Variable declaration\n", - "k = 1.38*10**-23; #Boltzmann constant(J/K)\n", - "e = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\n", - "g1 = 2; #The degeneracy of ground state\n", - "g2 = 8; #The degeneracy of excited state\n", - "delta_E = 10.2; #Energy of excited state above the ground state(eV)\n", - "T = 6000; #Temperature of the state(K)\n", - "\n", - "#Calculation\n", - "D_ratio = g2/g1; #Ratio of degeneracy of states\n", - "x = k*T/e;\n", - "N_ratio = D_ratio*math.exp(-delta_E/x); #Ratio of occupancy of the excited to the ground state\n", - "\n", - "#Result\n", - "print \"The ratio of occupancy of the excited to the ground state is\",N_ratio" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nepsilon_r = 1.0000684; #dielectric constant\nN = 2.7*10**25; #number of atoms(per m**3)\nepsilon0 = 8.85*10**-12; #permittivity of free space\n\n#Calculation\nalpha_e = epsilon0*(epsilon_r-1)/N; #electronic polarizability(Fm**2)\n\n#Result\nprint \"electronic polarizability is\",alpha_e,\"Fm**2\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The ratio of occupancy of the excited to the ground state is 1.10167326887e-08\n" - ] + "text": "electronic polarizability is 2.242e-41 Fm**2\n" } ], "prompt_number": 1 @@ -66,229 +38,22 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 10.2, Page number 222" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "a = 10/2;\n", - "#enegy of 10 bosons is E = (10*pi**2*h**2)/(2*m*a**2) = (5*pi**2*h**2)/(m*a**2)\n", - "\n", - "#Result\n", - "print \"enegy of 10 bosons is E = \",int(a),\"(pi**2*h**2)/(m*a**2)\"" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "enegy of 10 bosons is E = 5 (pi**2*h**2)/(m*a**2)\n" - ] - } - ], - "prompt_number": 5 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 10.3, Page number 223" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "\n", - "#Variable declaration\n", - "n1=1; #1st level\n", - "n2=2; #2nd level\n", - "n3=3; #3rd level\n", - "n4=4; #4th level\n", - "n5=5; #5th level\n", - "\n", - "#Calculation\n", - "#an energy level can accomodate only 2 fermions. hence there will be 2 fermions in each level\n", - "#thus total ground state energy will be E = (2*E1)+(2*E2)+(2*E3)+(2*E4)+E5\n", - "#let X = ((pi**2)*(h**2)/(2*m*a**2)). E = X*((2*n1**2)+(2*n2**2)+(2*n3**2)+(2*n4**2)+(n5**2))\n", - "A = (2*n1**2)+(2*n2**2)+(2*n3**2)+(2*n4**2)+(n5**2);\n", - "#thus E = A*X\n", - "\n", - "#Result\n", - "print \"the ground state energy of the system is\",A,\"(pi**2)*(h**2)/(2*m*a**2)\"" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "the ground state energy of the system is 85 (pi**2)*(h**2)/(2*m*a**2)\n" - ] - } - ], - "prompt_number": 6 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 10.4, Page number 223" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "e = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\n", - "N_A = 6.02*10**23; #Avogadro's number\n", - "h = 6.626*10**-34; #Planck's constant(Js)\n", - "me = 9.1*10**-31; #Mass of electron(kg)\n", - "rho = 10.5; #Density of silver(g/cm)\n", - "m = 108; #Molecular mass of silver(g/mol)\n", - "\n", - "#Calculation\n", - "N_D = rho*N_A/m; #Number density of conduction electrons(per cm**3)\n", - "N_D = N_D*10**6; #Number density of conduction electrons(per m**3)\n", - "E_F = ((h**2)/(8*me))*(3/math.pi*N_D)**(2/3); #fermi energy(J)\n", - "E_F = E_F/e; #fermi energy(eV)\n", - "E_F = math.ceil(E_F*10**2)/10**2; #rounding off the value of E_F to 2 decimals\n", - "\n", - "#Result\n", - "print \"The number density of conduction electrons is\",N_D, \"per metre cube\"\n", - "print \"The Fermi energy of silver is\",E_F, \"eV\"" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The number density of conduction electrons is 5.85277777778e+28 per metre cube\n", - "The Fermi energy of silver is 5.51 eV\n" - ] - } - ], - "prompt_number": 7 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 10.5, Page number 224" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "N_A = 6.02*10**23; #Avogadro's number\n", - "k = 1.38*10**-23; #Boltzmann constant(J/K)\n", - "T = 293; #Temperature of sodium(K)\n", - "E_F = 3.24; #Fermi energy of sodium(eV)\n", - "e = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\n", - "\n", - "#Calculation\n", - "C_v = math.pi**2*N_A*k**2*T/(2*E_F*e); #Molar specific heat of sodium(per mole)\n", - "C_v = math.ceil(C_v*10**2)/10**2; #rounding off the value of C_v to 2 decimals\n", - "\n", - "#Result\n", - "print \"The electronic contribution to molar specific heat of sodium is\",C_v, \"per mole\"" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The electronic contribution to molar specific heat of sodium is 0.32 per mole\n" - ] - } - ], - "prompt_number": 8 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 10.6, Page number 224" - ] + "source": "Example number 10.2, Page number 290" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "e = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\n", - "h = 6.626*10**-34; #Planck's constant(Js)\n", - "m = 9.1*10**-31; #Mass of the electron(kg)\n", - "N_D = 18.1*10**28; #Number density of conduction electrons in Al(per metre cube)\n", - "\n", - "#Calculation\n", - "E_F = h**2/(8*m)*(3/math.pi*N_D)**(2/3); #N_D = N/V. Fermi energy of aluminium(J)\n", - "E_F = E_F/e; #Fermi energy of aluminium(eV)\n", - "E_F = math.ceil(E_F*10**3)/10**3; #rounding off the value of E_F to 3 decimals\n", - "Em_0 = 3/5*E_F; #Mean energy of the electron at 0K(eV)\n", - "Em_0 = math.ceil(Em_0*10**3)/10**3; #rounding off the value of Em_0 to 3 decimals\n", - "\n", - "#Result\n", - "print \"The Fermi energy of aluminium is\",E_F, \"eV\"\n", - "print \"The mean energy of the electron is\",Em_0, \"eV\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nepsilon_r = 1.0024; #relative permittivity\nN = 2.7*10**25; #number of atoms(per m**3)\nepsilon0 = 8.85*10**-12; #permittivity of free space\n\n#Calculation\nalpha_e = epsilon0*(epsilon_r-1)/N; #electronic polarizability(Fm**2)\n\n#Result\nprint \"electronic polarizability is\",alpha_e,\"Fm**2\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The Fermi energy of aluminium is 11.696 eV\n", - "The mean energy of the electron is 7.018 eV\n" - ] + "text": "electronic polarizability is 7.86666666667e-40 Fm**2\n" } ], - "prompt_number": 9 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [], - "language": "python", - "metadata": {}, - "outputs": [] + "prompt_number": 2 } ], "metadata": {} diff --git a/Engineering_Physics/Chapter1_1.ipynb b/Engineering_Physics/Chapter1_1.ipynb index 9c835441..a3614569 100755 --- a/Engineering_Physics/Chapter1_1.ipynb +++ b/Engineering_Physics/Chapter1_1.ipynb @@ -1,7 +1,7 @@ { "metadata": { - "name": "", - "signature": "sha256:078983e30b4c728fb3bac2d9363145a8f1fffb1522bc3df76d2595e630af4298" + "name": "Chapter1", + "signature": "sha256:e55f587b2da98ead68f73bb2b4d29bef91aa67eb577c460fb9dcaab92acc4339" }, "nbformat": 3, "nbformat_minor": 0, @@ -12,51 +12,46 @@ "cell_type": "heading", "level": 1, "metadata": {}, - "source": [ - "1: Oscillations and Waves" - ] + "source": "1: Ultrasonics" }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 1.1, Page number 23" - ] + "source": "Example number 1.1, Page number 20" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#import modules\n", - "import math\n", - "\n", - "#Variable declaration\n", - "S=4; #SHM described by a particle(cm)\n", - "x=0; #mean position\n", - "v=12; #velocity at mean position(cm/s)\n", - "\n", - "#Calculation\n", - "A=S/2; #amplitude of motion(cm)\n", - "omega=v/A; #angular frequency(sec-1)\n", - "T=(2*math.pi)/omega; #time period(sec)\n", - "T=math.ceil(T*10**3)/10**3; #rounding off to 3 decimals\n", - "\n", - "#Result\n", - "print \"time period of motion is\",T, \"sec\"\n", - "print \"time period of motion is pi/3 sec\"" + "input": "#Variable declaration\nv = 1440; #velocity of ultrasonic waves(m/s)\nt = 0.33; #time elapsed(s)\n\n#Calculation\nd = v*t; #distance travelled(m)\nd1 = d/2; #depth of submarine(m)\n\n#Result\nprint \"depth of the submerged submarine is\",d1, \"m\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "depth of the submerged submarine is 237.6 m\n" + } ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.2, Page number 21" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nl = 40; #length of iron rod(mm)\nE = 115*10**9; #Young's modulus(N/m**2)\nrho = 7.25*10**3; #density of pure iron(kg/m**3)\n\n#Calculation\nl = l*10**-3; #length of iron rod(m)\nnew = (1/(2*l))*math.sqrt(E/rho); #natural frequency of the rod(Hz)\nnew = new*10**-3; #natural frequency of the rod(kHz)\nnew=math.ceil(new*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"depth of the submerged submarine is\",new, \"kHz\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "time period of motion is 1.048 sec\n", - "time period of motion is pi/3 sec\n" - ] + "text": "depth of the submerged submarine is 49.785 kHz\n" } ], "prompt_number": 2 @@ -65,47 +60,19 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 1.2, Page number 23" - ] + "source": "Example number 1.3, Page number 21" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#import modules\n", - "import math\n", - "\n", - "#Variable declaration\n", - "T=0.1; #time period(sec)\n", - "A=4; #amplitude of motion(cm)\n", - "x=0.2; #distance from mean position(cm)\n", - "\n", - "#Calculation\n", - "omega=(2*math.pi)/T; #angular frequency(sec-1)\n", - "a=(omega**2)*x; #acceleration(cm/sec^2)\n", - "a=math.ceil(a*10**2)/10**2; #rounding off to 2 decimals\n", - "#maximum velocity is when particle is in the mean position\n", - "v_max=omega*A; #maximum velocity(cm/sec)\n", - "v_max=math.ceil(v_max*10**2)/10**2; #rounding off to 2 decimals\n", - "\n", - "#Result\n", - "print \"acceleration is\",a, \"cm/sec^2\"\n", - "print \"maximum velocity is\",v_max, \"cm/sec\"\n", - "\n", - "#answers given in the book are wrong" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nl = 1; #length of quartz crystal(mm)\nE = 7.9*10**10; #Young's modulus(N/m**2)\nrho = 2650; #density(kg/m**3)\n\n#Calculation\nl = l*10**-3; #length of iron rod(m)\nnew = (1/(2*l))*math.sqrt(E/rho); #natural frequency of the rod(Hz)\nnew = new*10**-6; \nnew=math.ceil(new*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint \"fundamental frequency of crystal is\",new, \"*10**6 Hz\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "acceleration is 789.57 cm/sec^2\n", - "maximum velocity is 251.33 cm/sec\n" - ] + "text": "fundamental frequency of crystal is 2.73 *10**6 Hz\n" } ], "prompt_number": 3 @@ -114,146 +81,82 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 1.3, Page number 24" - ] + "source": "Example number 1.4, Page number 22" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#import modules\n", - "import math\n", - "import numpy as np\n", - "\n", - "#Variable declaration\n", - "A1 = 40; #First amplitude of oscillation(cm)\n", - "An_plus_1 = 4; #Amplitude after 100 oscillations(cm)\n", - "n = 100; #Number of oscillations\n", - "T = 2.5; #Time period of oscillations(s)\n", - "\n", - "#Calculation\n", - "t = T/4; #Time taken to reach the first amplitude from the mean position(s)\n", - "#Now A1 = x0*math.exp(-lambda*t) and An_plus_1 = x0*math.exp(-lambda*(t+nT))\n", - "#A1/An_plus_1 = math.exp(n*lambda*T)\n", - "x=A1/An_plus_1;\n", - "lamda=np.log(x)/(n*T); #Damping constant(per sec)\n", - "lamda=lamda*10**2;\n", - "lamda=math.ceil(lamda*10**3)/10**3; #rounding off to 3 decimals\n", - "\n", - "#Result\n", - "print \"Damping constant is\",lamda,\"*10**-2 per sec\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nd = 0.55; #distance between 2 constructive antinodes(mm)\nnew = 1.5; #frequency of crystal(MHz)\n \n#Calculation\nnew = new*10**6; #frequency of crystal(Hz)\nd = d*10**-3; #distance between 2 constructive antinodes(m)\n#distance between 2 antinodes is given by lamda/2\nlamda = 2*d; #wavelength of ultrasonic waves(m)\nv = new*lamda; #velocity of waves(m/s)\n\n#Result\nprint \"velocity of waves is\",int(v), \"m/s\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "Damping constant is 0.922 *10**-2 per sec\n" - ] + "text": "velocity of waves is 1650 m/s\n" } ], - "prompt_number": 6 + "prompt_number": 4 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 1.4, Page number 24" - ] + "source": "Example number 1.5, Page number 22" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#import modules\n", - "import math\n", - "\n", - "#Variable declaration\n", - "x1 = 3; #First position of the particle(cm)\n", - "x2 = 4; #Second position of the particle(cm)\n", - "v1 = 16; #Velocity of particle executing SHM at 1st position(cm/s)\n", - "v2 = 12; #Velocity of particle executing SHM at 2nd position (cm/s)\n", - "\n", - "#Calculation\n", - "#As v = omega*sqrt(A**2 - x**2) so\n", - "#(v1/v2)**2=(A**2 - x1**2)/(A**2 - x2**2)\n", - "#RHS gives (A**2-9)/(A**2-16)\n", - "#(v2**2)*(A**2 - x1**2)=(v1**2)*(A**2 - x2**2), on solving we get\n", - "A=math.sqrt((((v1**2)*(x2**2))-((v2**2)*(x1**2)))/((v1**2)-(v2**2))); #amplitude in cm\n", - "omega=v1/math.sqrt(A**2-x1**2); #Angular speed of the particle(per sec)\n", - "T=2*math.pi/omega; #Time period of oscillation(sec)\n", - "T=math.ceil(T*10**3)/10**3; #rounding off to 3 decimals\n", - "\n", - "#Result\n", - "print \"The amplitude of SHM is\",A, \"cm\"\n", - "print \"The time period of oscillation is\",T, \"sec\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nl = 50; #length of rod(mm)\nE = 11.5*10**10; #Young's modulus(N/m**2)\nrho = 7250; #density(kg/m**3)\n\n#Calculation\nl = l*10**-3; #length of iron rod(m)\nnew = (1/(2*l))*math.sqrt(E/rho); #natural frequency of the rod(Hz)\nnew = new*10**-3; #natural frequency of the rod(kHz)\nnew = math.ceil(new*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint \"natural frequency of rod is\",new, \"kHz\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The amplitude of SHM is 5.0 cm\n", - "The time period of oscillation is 1.571 sec\n" - ] + "text": "natural frequency of rod is 39.83 kHz\n" } ], - "prompt_number": 7 + "prompt_number": 5 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 1.5, Page number 25" - ] + "source": "Example number 1.6, Page number 22" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#import modules\n", - "import math\n", - "\n", - "#Variable declaration\n", - "m = 0.3; #Mass attached to the string(kg)\n", - "g = 9.8; #Acceleration due to gravity(m/sec**2)\n", - "x = 0.15; #Stretchness produced in the spring(m)\n", - "s = 0.1; #spring is stretched and released(m)\n", - "\n", - "#Calculation\n", - "F = m*g; #Restoring force acting on the mass(N)\n", - "k = F/x; #Spring constant(N/m)\n", - "A = s; #amplitude equals to the spring stretched and released\n", - "omega = math.sqrt(k/m); #Angular frequency of oscillation(rad per sec)\n", - "v0 = omega*A; #Maximum velocity during the oscillations(m/s)\n", - "v0=math.ceil(v0*100)/100; #rounding off to 2 decimals\n", - "\n", - "#Result\n", - "print \"The spring constant is\",k, \"N/m\"\n", - "print \"The amplitude of oscillation is\",A, \"m\"\n", - "print \"The maximum velocity during oscillations is\",v0, \"m/s\"" + "input": "#importing modules\nimport math\n\n#Variable declaration\nl = 2; #length of crystal(mm)\nE = 7.9*10**10; #Young's modulus(N/m**2)\nrho = 2650; #density(kg/m**3)\n\n#Calculation\nl = l*10**-3; #length of iron rod(m)\nnew = (1/(2*l))*math.sqrt(E/rho); #natural frequency of the rod(Hz)\nnew = new*10**-6; #natural frequency of the rod(MHz)\nnew=math.ceil(new*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"frequency of crystal is\",new, \"MHz\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "frequency of crystal is 1.365 MHz\n" + } ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.7, Page number 23" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nl = 3; #length of crystal(mm)\nE = 8*10**10; #Young's modulus(N/m**2)\nrho = 2500; #density(kg/m**3)\n\n#Calculation\nl = l*10**-3; #length of iron rod(m)\nnew = (1/(2*l))*math.sqrt(E/rho); #natural frequency of the rod(Hz)\nnew = new*10**-3; #natural frequency of the rod(kHz) \nnew=math.ceil(new*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint \"frequency of crystal is\",new, \"kHz\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The spring constant is 19.6 N/m\n", - "The amplitude of oscillation is 0.1 m\n", - "The maximum velocity during oscillations is 0.81 m/s\n" - ] + "text": "frequency of crystal is 942.81 kHz\n" } ], "prompt_number": 8 @@ -262,96 +165,61 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 1.6, Page number 25" - ] + "source": "Example number 1.8, Page number 23" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#import modules\n", - "import math\n", - "\n", - "#Variable declaration\n", - "lambda1 = 400; #Lower limit of wavelength of visible region(nm)\n", - "lambda2 = 700; #Upper limit of wavelength of visible region(nm)\n", - "c = 3*10**8; #Speed of light in vacuum(m/s)\n", - "\n", - "#Calculation\n", - "lambda1 = lambda1*10**-9 #Lower limit of wavelength(m) \n", - "lambda2 = lambda2*10**-9 #upper limit of wavelength(m) \n", - "new_1 = c/lambda1; #Upper limit of frequency of visible region(m)\n", - "new_2 = c/lambda2; #Lower limit of frequency of visible region(m)\n", - "\n", - "#Result\n", - "print \"The frequency equivalent of 400 nm is\",new_1, \"Hz\"\n", - "print \"The frequency equivalent of 700 nm is\",new_2, \"Hz\"\n" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nl = 1.5; #length of crystal(mm)\nE = 7.9*10**10; #Young's modulus(N/m**2)\nrho = 2650; #density(kg/m**3)\n\n#Calculation\nl = l*10**-3; #length of iron rod(m)\nnew = (1/(2*l))*math.sqrt(E/rho); #natural frequency of the rod(Hz)\nnew = new*10**-6; #natural frequency of the rod(MHz) \nnew=math.ceil(new*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint \"frequency of crystal is\",new, \"MHz\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The frequency equivalent of 400 nm is 7.5e+14 Hz\n", - "The frequency equivalent of 700 nm is 4.28571428571e+14 Hz\n" - ] + "text": "frequency of crystal is 1.82 MHz\n" } ], - "prompt_number": 9 + "prompt_number": 10 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 1.7, Page number 26" - ] + "source": "Example number 1.9, Page number 24" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#import modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "#Comparing the standard equation u(x,t) = A*sin(2*%pi(x/lambda-t/T)) with the given equation, we get\n", - "A = 1.5*10**-3; #Amplitude of the sound wave(m)\n", - "lamda = 8; #Wavelength of the sound wave(m)\n", - "T = 1/40; #Time period of the sound wave(s)\n", - "\n", - "#Calculation\n", - "A = A*10**3;\n", - "new = 1/T; #Frequency of the sound wave(Hz)\n", - "v = new*lamda; #Velocity of the sound wave(m/s)\n", - "T=math.ceil(T*100)/100; #rounding off to 2 decimals\n", - "\n", - "#Result\n", - "print \"The amplitude of the sound wave is\",A,\"*10**-3 m\"\n", - "print \"The wavelength of the sound wave is\",lamda, \"m\"\n", - "print \"The time period of the sound wave is\",T, \"s\"\n", - "print \"The frequency of the sound wave is\",new, \"Hz\"\n", - "print \"The velocity of the sound wave is\",v, \"m/s\"" + "input": "#Variable declaration\nv = 1440; #velocity of ultrasonic waves(m/s)\nt = 0.95; #time elapsed(s)\n\n#Calculation\nd = v*t; #distance travelled(m)\nd1 = d/2; #depth of sea(m)\n\n#Result\nprint \"depth of the submerged submarine is\",int(d1), \"m\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "depth of the submerged submarine is 684 m\n" + } ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.10, Page number 24" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#Variable declaration\nv = 1440; #velocity of ultrasonic waves(m/s)\nt = 0.83; #time elapsed(s)\n\n#Calculation\nd = v*t; #distance travelled(m)\nd1 = d/2; #depth of submarine(m)\n\n#Result\nprint \"depth of the submerged submarine is\",d1, \"m\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The amplitude of the sound wave is 1.5 *10**-3 m\n", - "The wavelength of the sound wave is 8 m\n", - "The time period of the sound wave is 0.03 s\n", - "The frequency of the sound wave is 40.0 Hz\n", - "The velocity of the sound wave is 320.0 m/s\n" - ] + "text": "depth of the submerged submarine is 597.6 m\n" } ], "prompt_number": 12 @@ -360,47 +228,19 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 1.8, Page number 26" - ] + "source": "Example number 1.11, Page number 24" }, { "cell_type": "code", "collapsed": false, - "input": [ - "\n", - "\n", - "#import modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "A = 2; #Amplitude of the wave(cm)\n", - "T = 0.5; #Time period of the wave(sec)\n", - "v = 200; #Wave velocity(cm/s)\n", - "\n", - "#Calculation\n", - "f = 1/T; #Frequency of the wave(Hz)\n", - "lamda = v/f; #Wavelength of the wave(cm)\n", - "\n", - "#Result\n", - "print \"frequency of wave is\",f, \"Hz\"\n", - "print \"wavelength of wave is\",lamda, \"cm\"\n", - "print \"The Equation of the wave moving along X-axis :\"\n", - "print \"u = \",A,\"*sin*2*math.pi*(x/\",lamda,\"- t/\",T,\")\" #x and y are in cm and t is in sec" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\naS = 1050; #total absorption inside hall(Sabine)\nV = 9000; #volume of cinema hall(m**3)\n\n#Calculation\nT = 0.165*V/aS; #reverberation time of hall(s)\nT = math.ceil(T*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint \"reverberation time of the hall is\",T, \"s\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "frequency of wave is 2.0 Hz\n", - "wavelength of wave is 100.0 cm\n", - "The Equation of the wave moving along X-axis :\n", - "u = 2 *sin*2*math.pi*(x/ 100.0 - t/ 0.5 )\n" - ] + "text": "reverberation time of the hall is 1.4143 s\n" } ], "prompt_number": 13 @@ -409,59 +249,106 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 1.9, Page number 27" - ] + "source": "Example number 1.12, Page number 25" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#import modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "T = 1000; #Tension in the wire(N)\n", - "M=15; #mass of the wire(kg)\n", - "l=300; #length of the wire(m)\n", - "lamda = 0.30; #Wavelength of wave along wire(m)\n", - "\n", - "#Calculation\n", - "m = M/l; #Mass per unit length of the wire(kg/m)\n", - "v = math.sqrt(T/m); #Velocity of wave through wire(m/s)\n", - "v=math.ceil(v*100)/100; #rounding off to 2 decimals\n", - "new = v/lamda; #Frequency of wave through string(Hz)\n", - "new=math.ceil(new*100)/100; #rounding off to 2 decimals\n", - "\n", - "#Result\n", - "print \"The velocity of the wave through wire is\",v, \"m/s\"\n", - "print \"The frequency of the wave through wire is\",new, \"Hz\"\n", - "\n", - "#answer for frequency of the wave is wrong in the textbook" + "input": "#importing modules\nimport math\n\n#Variable declaration\na = 0.65; #average absorption coefficient(Sabine/m**2)\nV = 13500; #volume of auditorium(m**3)\nT = 1.2; #reverberation time of hall(s)\n\n#Calculation\nS = 0.165*V/(a*T); #reverberation time of hall(s)\nS = math.ceil(S*10)/10; #rounding off to 1 decimal\n\n#Result\nprint \"total area of interior surface is\",S, \"m**2\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "total area of interior surface is 2855.8 m**2\n" + } ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.13, Page number 25" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nV = 15000; #volume of cinema hall(m**3)\nT1 = 1.3; #initial reverberation time of hall(s)\na1S1 = 300; #number of chairs placed\n\n#Calculation\naS = 0.165*V/T1; #total absorption of hall\nT2 = (0.165*V)/(aS+a1S1); #reverberation time of hall after adding chairs(s)\nT2 = math.ceil(T2*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint \"reverberation time of the hall after adding chairs is\",T2, \"s\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The velocity of the wave through wire is 141.43 m/s\n", - "The frequency of the wave through wire is 471.44 Hz\n" - ] + "text": "reverberation time of the hall after adding chairs is 1.1231 s\n" } ], "prompt_number": 15 }, { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.14, Page number 26" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#Variable declaration\nv = 1440; #velocity of ultrasonic waves(m/s)\nt = 0.5; #time elapsed(s)\n\n#Calculation\nd = v*t; #distance travelled(m)\nd1 = d/2; #depth of submarine(m)\n\n#Result\nprint \"depth of the submerged submarine is\",int(d1), \"m\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "depth of the submerged submarine is 360 m\n" + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.15, Page number 26" + }, + { "cell_type": "code", "collapsed": false, - "input": [], + "input": "#importing modules\nimport math\n\n#Variable declaration\nd = 0.4; #distance between 2 constructive antinodes(mm)\nnew = 1.5; #frequency of crystal(MHz)\n \n#Calculation\nnew = new*10**6; #frequency of crystal(Hz)\nd = d*10**-3; #distance between 2 constructive antinodes(m)\n#distance between 2 antinodes is given by lamda/2\nlamda = 2*d; #wavelength of ultrasonic waves(m)\nv = new*lamda; #velocity of waves(m/s)\n\n#Result\nprint \"velocity of waves is\",int(v), \"m/s\"", "language": "python", "metadata": {}, - "outputs": [] + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "velocity of waves is 1200 m/s\n" + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.16, Page number 26" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nl = 40; #length of iron rod(mm)\nE = 11.5*10**10; #Young's modulus(N/m**2)\nrho = 7250; #density of pure iron(kg/m**3)\n\n#Calculation\nl = l*10**-3; #length of iron rod(m)\nnew = (1/(2*l))*math.sqrt(E/rho); #natural frequency of the rod(Hz)\nnew = new*10**-3; #natural frequency of the rod(kHz)\nnew=math.ceil(new*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"depth of the submerged submarine is\",new, \"kHz\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "depth of the submerged submarine is 49.785 kHz\n" + } + ], + "prompt_number": 18 } ], "metadata": {} diff --git a/Engineering_Physics/Chapter2.ipynb b/Engineering_Physics/Chapter2.ipynb new file mode 100755 index 00000000..fff10b22 --- /dev/null +++ b/Engineering_Physics/Chapter2.ipynb @@ -0,0 +1,84 @@ +{ + "metadata": { + "name": "Chapter2", + "signature": "sha256:ac80f9dfe1725f11a5d4ce0fbda5ffed825d99c680f116629e5e3fcb8b69c198" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": "2: Lasers" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 2.1, Page number 52" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nlamda = 590; #wavelength(nm)\nh = 6.625*10**-34; #planck's constant\nc = 3*10**8; #velocity of light(m/s)\nk = 1.38*10**-23; #boltzmann's constant\nT = 523; #temperature(Kelvin)\n\n#Calculation\nlamda = lamda*10**-9; #wavelength(m) \n#n1byn2 = math.exp(-(E2-E1)/(k*T))\n#but E2-E1 = h*new and new = c/lamda\n#therefore n1byn2 = math.exp(-h*c/(lamda*k*T))\nn1byn2 = math.exp(-h*c/(lamda*k*T));\n\n#Result\nprint \"relative population of Na atoms is\",n1byn2", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "relative population of Na atoms is 5.36748316686e-21\n" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 2.2, Page number 53" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nlamda = 590; #wavelength(nm)\nh = 6.625*10**-34; #planck's constant\nc = 3*10**8; #velocity of light(m/s)\nk = 1.38*10**-23; #boltzmann's constant\nT = 523; #temperature(Kelvin)\n\n#Calculation\nlamda = lamda*10**-9; #wavelength(m) \n#n21dashbyn21 = 1/(math.exp(h*new/(k*T))-1)\n#but new = c/lamda\n#therefore n21dashbyn21 = 1/(math.exp(h*c/(lamda*k*T))-1)\nA = math.exp(h*c/(lamda*k*T))-1;\nn21dashbyn21 = 1/A; \n\n#Result\nprint \"ratio of stimulated to spontaneous emission is\",n21dashbyn21\nprint \"answer given in the book is wrong\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "ratio of stimulated to spontaneous emission is 5.36748316686e-21\nanswer given in the book is wrong\n" + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 2.3, Page number 53" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nlamda = 632.8; #wavelength of laser(nm)\nh = 6.625*10**-34; #planck's constant\nc = 3*10**8; #velocity of light(m/s)\np = 3.147; #output power(mW)\n\n#Calculation\np = p*10**-3; #output power(W)\nlamda = lamda*10**-9; #wavelength(m) \nnew = c/lamda; #frequency(Hz)\nE = h*new; #energy of each photon(J)\nEm = p*60; #energy emitted per minute(J/min)\nN = Em/E; #number of photons emitted per second\n\n#Result\nprint \"number of photons emitted per second is\",N", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "number of photons emitted per second is 6.01183879245e+17\n" + } + ], + "prompt_number": 3 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Engineering_Physics/Chapter2_1.ipynb b/Engineering_Physics/Chapter2_1.ipynb index 3d6c503f..fff10b22 100755 --- a/Engineering_Physics/Chapter2_1.ipynb +++ b/Engineering_Physics/Chapter2_1.ipynb @@ -1,7 +1,7 @@ { "metadata": { - "name": "", - "signature": "sha256:2693d83b10c8e62fc8d3ef78c9959c4d8327c36ed1f7884372585d33796bcbc3" + "name": "Chapter2", + "signature": "sha256:ac80f9dfe1725f11a5d4ce0fbda5ffed825d99c680f116629e5e3fcb8b69c198" }, "nbformat": 3, "nbformat_minor": 0, @@ -12,231 +12,70 @@ "cell_type": "heading", "level": 1, "metadata": {}, - "source": [ - "2: Electromagnetic Theory" - ] + "source": "2: Lasers" }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 2.1, Page number 46" - ] + "source": "Example number 2.1, Page number 52" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "from __future__ import division\n", - "from sympy import *\n", - "import math\n", - "\n", - "#Variable declaration\n", - "C = 10; #Capacitance of the capacitor(pF)\n", - "#given V=0.2*sin(120*math.pi*t) in volts\n", - "\n", - "#Calculation\n", - "C=C*10**-12; #Capacitance of the capacitor(F)\n", - "x, y, z, t = symbols('x y z t')\n", - "k, m, n = symbols('k m n', integer=True)\n", - "f, g, h = symbols('f g h', cls=Function)\n", - "#I = C*dV/dt\n", - "#let dV/dt be a\n", - "a=diff(0.2*sin(120*math.pi*t),t) #dV/dt\n", - "#value of dV/dt is 75.398223686155*cos(376.991118430775*t)\n", - "#for cosine function peak value occurs when 120*math.pi*t = 0\n", - "#therefore value of dV/dt becomes d = 75.398223686155\n", - "d = 75.398223686155; #value of dV/dt \n", - "I=C*d; #displacement current(A)\n", - "\n", - "#Result\n", - "print \"value of dV/dt is\",a\n", - "print \"displacement current is\",I, \"A\"" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "value of dV/dt is 75.398223686155*cos(376.991118430775*t)\n", - "displacement current is 7.53982236862e-10 A\n" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 2.2, Page number 46" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "from __future__ import division\n", - "from sympy import *\n", - "import math\n", - "\n", - "#Variable declaration\n", - "epsilon_r = 1; #Relative electrical permittivity of free space\n", - "epsilon_0 = 8.854*10**-12; #Absolute electrical permittivity of free space(F/m)\n", - "#given E=sin(120*math.pi*t) in volts\n", - "\n", - "#Calculation\n", - "x, y, z, t = symbols('x y z t')\n", - "k, m, n = symbols('k m n', integer=True)\n", - "f, g, h = symbols('f g h', cls=Function)\n", - "#J2 = epsilon*dE/dt\n", - "epsilon=epsilon_0*epsilon_r;\n", - "#let dE/dt be a\n", - "a=diff(sin(120*math.pi*t),t) #dE/dt\n", - "#value of dE/dt is 376.991118430775*cos(376.991118430775*t)\n", - "#for cosine function peak value occurs when 120*math.pi*t = 0\n", - "#therefore value of dE/dt becomes d = 376.991118430775\n", - "d = 376.991118430775; #value of dE/dt\n", - "J2=epsilon*d; #displacement current density(A/m**2)\n", - "\n", - "#Result\n", - "print \"value of dE/dt is\",a\n", - "print \"The peak value of displacement current density is\",J2, \"A/m**2\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nlamda = 590; #wavelength(nm)\nh = 6.625*10**-34; #planck's constant\nc = 3*10**8; #velocity of light(m/s)\nk = 1.38*10**-23; #boltzmann's constant\nT = 523; #temperature(Kelvin)\n\n#Calculation\nlamda = lamda*10**-9; #wavelength(m) \n#n1byn2 = math.exp(-(E2-E1)/(k*T))\n#but E2-E1 = h*new and new = c/lamda\n#therefore n1byn2 = math.exp(-h*c/(lamda*k*T))\nn1byn2 = math.exp(-h*c/(lamda*k*T));\n\n#Result\nprint \"relative population of Na atoms is\",n1byn2", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "value of dE/dt is 376.991118430775*cos(376.991118430775*t)\n", - "The peak value of displacement current density is 3.33787936259e-09 A/m**2\n" - ] + "text": "relative population of Na atoms is 5.36748316686e-21\n" } ], - "prompt_number": 3 + "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 2.3, Page number 47 (Theoritical proof)" - ] - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 2.4, Page number 47" - ] + "source": "Example number 2.2, Page number 53" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "from __future__ import division\n", - "import math\n", - "\n", - "#Variable declaration\n", - "p = 60; #Power rating of bulb(W)\n", - "d = 0.5; #Distance from the bulb(m)\n", - "\n", - "#Calculation\n", - "A=4*math.pi*d**2; #area(m**2)\n", - "P = p/A; #Value of Poynting vector(W/m**2)\n", - "P = math.ceil(P*100)/100; #rounding off value of P to 1 decimal\n", - "\n", - "#Result\n", - "print \"The value of Poynting vector is\",P, \"W/m**2\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nlamda = 590; #wavelength(nm)\nh = 6.625*10**-34; #planck's constant\nc = 3*10**8; #velocity of light(m/s)\nk = 1.38*10**-23; #boltzmann's constant\nT = 523; #temperature(Kelvin)\n\n#Calculation\nlamda = lamda*10**-9; #wavelength(m) \n#n21dashbyn21 = 1/(math.exp(h*new/(k*T))-1)\n#but new = c/lamda\n#therefore n21dashbyn21 = 1/(math.exp(h*c/(lamda*k*T))-1)\nA = math.exp(h*c/(lamda*k*T))-1;\nn21dashbyn21 = 1/A; \n\n#Result\nprint \"ratio of stimulated to spontaneous emission is\",n21dashbyn21\nprint \"answer given in the book is wrong\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The value of Poynting vector is 19.1 W/m**2\n" - ] + "text": "ratio of stimulated to spontaneous emission is 5.36748316686e-21\nanswer given in the book is wrong\n" } ], - "prompt_number": 4 + "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 2.5, Page number 47" - ] + "source": "Example number 2.3, Page number 53" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "from __future__ import division\n", - "import math\n", - "\n", - "#Variable declaration\n", - "E_peak = 6; #Peak value of electric field intensity(V/m)\n", - "c = 3*10**8; #Speed of electromagnetic wave in free space(m/s)\n", - "mew_0 = 4*math.pi*10**-7; #Absolute permeability of free space(Tm/A)\n", - "epsilon_0 = 8.854*10**-12; #Absolute permittivity of free space(F/m)\n", - "mew_r = 1; #Relative permeability of medium\n", - "epsilon_r = 3; #Relative permittivity of the medium\n", - "\n", - "#Calculation\n", - "v = c/math.sqrt(mew_r*epsilon_r); #Wave velocity(m/s)\n", - "v = v/10**8;\n", - "v = math.ceil(v*10**4)/10**4; #rounding off the value of v to 4 decimals\n", - "eta = math.sqrt((mew_0/epsilon_0)*(mew_r/epsilon_r)); #Intrinsic impedance of the medium(ohm)\n", - "eta = math.ceil(eta*10)/10; #rounding off the value of v to 1 decimal\n", - "H_P = E_peak/eta; #Peak value of the magnetic intensity(A/m)\n", - "H_P = H_P*10**2;\n", - "H_P = math.ceil(H_P*10**2)/10**2; #rounding off the value of v to 2 decimals\n", - "\n", - "#Result\n", - "print \"The wave velocity is\",v,\"*10**8 m/s\"\n", - "print \"The intrinsic impedance of the medium is\",eta, \"ohm\"\n", - "print \"The peak value of the magnetic intensity is\",H_P,\"*10**-2 A/m\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nlamda = 632.8; #wavelength of laser(nm)\nh = 6.625*10**-34; #planck's constant\nc = 3*10**8; #velocity of light(m/s)\np = 3.147; #output power(mW)\n\n#Calculation\np = p*10**-3; #output power(W)\nlamda = lamda*10**-9; #wavelength(m) \nnew = c/lamda; #frequency(Hz)\nE = h*new; #energy of each photon(J)\nEm = p*60; #energy emitted per minute(J/min)\nN = Em/E; #number of photons emitted per second\n\n#Result\nprint \"number of photons emitted per second is\",N", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The wave velocity is 1.7321 *10**8 m/s\n", - "The intrinsic impedance of the medium is 217.6 ohm\n", - "The peak value of the magnetic intensity is 2.76 *10**-2 A/m\n" - ] + "text": "number of photons emitted per second is 6.01183879245e+17\n" } ], - "prompt_number": 11 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [], - "language": "python", - "metadata": {}, - "outputs": [] + "prompt_number": 3 } ], "metadata": {} diff --git a/Engineering_Physics/Chapter3.ipynb b/Engineering_Physics/Chapter3.ipynb new file mode 100755 index 00000000..9e2d3109 --- /dev/null +++ b/Engineering_Physics/Chapter3.ipynb @@ -0,0 +1,83 @@ +{ + "metadata": { + "name": "Chapter3" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": "3: Fibre Optics and Applications" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 3.1, Page number 84" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nn1 = 1.5; #refractive index of core\nn2 = 1.47; #refractive index of cladding\nn0 = 1; #refractive index of air\na = 180/math.pi; #conversion factor of radian to degree\n\n#Calculation\nNA = math.sqrt((n1**2)-(n2**2)); #numerical aperture\nNA=math.ceil(NA*10)/10; #rounding off to 1 decimal\nalpha_m = math.asin(NA/n0); #acceptance angle(radian)\nalpha_m = alpha_m*a; #acceptance angle(degrees)\nalpha_m=math.ceil(alpha_m*10**2)/10**2; #rounding off to 2 decimals\nphi_m = math.asin(NA/n1); #phase angle(radian)\nphi_m = phi_m*a; #phase angle(degrees)\nphi_m=math.ceil(phi_m*10**2)/10**2; #rounding off to 2 decimals\ntheta_c = math.asin(n2/n1); #critical angle(radian)\ntheta_c = theta_c*a; #critical angle(degrees)\ntheta_c=math.ceil(theta_c*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"numerical aperture is\",NA\nprint \"acceptance angle is\",alpha_m,\"degrees\"\nprint \"phase angle is\",phi_m,\"degrees\"\nprint \"critical angle is\",theta_c,\"degrees\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "numerical aperture is 0.3\nacceptance angle is 17.46 degrees\nphase angle is 11.54 degrees\ncritical angle is 78.522 degrees\n" + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 3.2, Page number 85" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nn1 = 1.5; #refractive index of core\nn2 = 1.47; #refractive index of cladding\nc = 3*10**8; #velocity of light(m/sec)\n\n#Calculation\ndeltatbyL = (n1/n2)*((n1-n2)/c);\n\n#Result\nprint \"pulse broadening per unit length is\",deltatbyL,\"s/m\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "pulse broadening per unit length is 1.02040816327e-10 s/m\n" + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 3.3, Page number 85" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nphi_m = 11.54; #phase angle(degrees)\na = 0.5*10**-4;\nx = math.pi/180; #conversion factor from degrees to radians\n\n#Calculation\nphi_m = phi_m*x; #phase angle(radian)\nL = a/math.tan(phi_m); #length(m)\nn = 1/(2*L); #total number of internal reflections(m-1)\n\n#Result\nprint \"alpha = 0 rays have no reflection. hence there are zero reflections for 1 metre.\"\nprint \"alpha = alpha_m rays have\",int(n),\"m-1 internal reflections\"\nprint \"answer given in the book is wrong\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "alpha = 0 rays have no reflection. hence there are zero reflections for 1 metre.\nalpha = alpha_m rays have 2041 m-1 internal reflections\nanswer given in the book is wrong\n" + } + ], + "prompt_number": 7 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Engineering_Physics/Chapter3_1.ipynb b/Engineering_Physics/Chapter3_1.ipynb index 7f02f8be..9e2d3109 100755 --- a/Engineering_Physics/Chapter3_1.ipynb +++ b/Engineering_Physics/Chapter3_1.ipynb @@ -1,7 +1,6 @@ { "metadata": { - "name": "", - "signature": "sha256:366ab969956cd234404db0091b17960805856ec3ff44007e36b0efdbe1414f5e" + "name": "Chapter3" }, "nbformat": 3, "nbformat_minor": 0, @@ -12,452 +11,70 @@ "cell_type": "heading", "level": 1, "metadata": {}, - "source": [ - "3: Interference" - ] + "source": "3: Fibre Optics and Applications" }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 3.1, Page number 71" - ] + "source": "Example number 3.1, Page number 84" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "from __future__ import division\n", - "import math\n", - "\n", - "#Variable declaration\n", - "beta = 0.51; #Fringe width(mm)\n", - "d = 2.2; #Distance between the slits(mm)\n", - "D = 2; #Distance between the slits and the screen(m)\n", - "\n", - "#Calculation\n", - "beta = beta*10**-1; #Fringe width(cm)\n", - "d = d*10**-1; #Distance between the slits(cm)\n", - "D=D*10**2; #Distance between the slits and the screen(cm)\n", - "lamda = beta*d/D; #Wavelength of light(cm)\n", - "lamda = lamda*10**8; #Wavelength of light(A)\n", - "\n", - "#Result\n", - "print \"The wavelength of light is\",lamda, \"angstrom\"" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The wavelength of light is 5610.0 angstrom\n" - ] - } - ], - "prompt_number": 4 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 3.2, Page number 71" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "from __future__ import division\n", - "import math\n", - "\n", - "#Variable declaration\n", - "lambda1 = 4250; #First wavelength emitted by source of light(A)\n", - "lambda2 = 5050; #Second wavelength emitted by source of light(A)\n", - "D = 1.5; #Distance between the source and the screen(m)\n", - "d = 0.025; #Distance between the slits(mm)\n", - "n = 3; #Number of fringe from the centre\n", - "\n", - "#Calculation\n", - "lambda1 = lambda1*10**-10; #First wavelength emitted(m)\n", - "lambda2 = lambda2*10**-10; #Second wavelength emitted(m)\n", - "d = d*10**-3; #Distance between the slits(m)\n", - "x3 = n*lambda1*D/d; #Position of third bright fringe due to lambda1(m)\n", - "x3_prime = n*lambda2*D/d; #Position of third bright fringe due to lambda2(m)\n", - "x = x3_prime-x3; #separation between the third bright fringe(m)\n", - "x = x*10**2; #separation between the third bright fringe(cm)\n", - "\n", - "#Result\n", - "print \"The separation between the third bright fringe due to the two wavelengths is\",x, \"cm\"\n" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nn1 = 1.5; #refractive index of core\nn2 = 1.47; #refractive index of cladding\nn0 = 1; #refractive index of air\na = 180/math.pi; #conversion factor of radian to degree\n\n#Calculation\nNA = math.sqrt((n1**2)-(n2**2)); #numerical aperture\nNA=math.ceil(NA*10)/10; #rounding off to 1 decimal\nalpha_m = math.asin(NA/n0); #acceptance angle(radian)\nalpha_m = alpha_m*a; #acceptance angle(degrees)\nalpha_m=math.ceil(alpha_m*10**2)/10**2; #rounding off to 2 decimals\nphi_m = math.asin(NA/n1); #phase angle(radian)\nphi_m = phi_m*a; #phase angle(degrees)\nphi_m=math.ceil(phi_m*10**2)/10**2; #rounding off to 2 decimals\ntheta_c = math.asin(n2/n1); #critical angle(radian)\ntheta_c = theta_c*a; #critical angle(degrees)\ntheta_c=math.ceil(theta_c*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"numerical aperture is\",NA\nprint \"acceptance angle is\",alpha_m,\"degrees\"\nprint \"phase angle is\",phi_m,\"degrees\"\nprint \"critical angle is\",theta_c,\"degrees\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The separation between the third bright fringe due to the two wavelengths is 1.44 cm\n" - ] + "text": "numerical aperture is 0.3\nacceptance angle is 17.46 degrees\nphase angle is 11.54 degrees\ncritical angle is 78.522 degrees\n" } ], - "prompt_number": 5 + "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 3.3, Page number 71" - ] + "source": "Example number 3.2, Page number 85" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - " \n", - "#importing modules\n", - "import math\n", - "\n", - "#Variable declaration\n", - "lamda = 5.5*10**-5; #Wavelength emitted by source of light(cm)\n", - "n = 4; #Number of fringes shifted\n", - "t = 3.9*10**-4; #Thickness of the thin glass sheet(cm)\n", - "\n", - "#Calculation\n", - "mew = (n*lamda/t)+1; #Refractive index of the sheet of glass\n", - "mew = math.ceil(mew*10**4)/10**4; #rounding off the value of v to 4 decimals\n", - "\n", - "#Result\n", - "print \"The refractive index of the sheet of glass is\",mew" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nn1 = 1.5; #refractive index of core\nn2 = 1.47; #refractive index of cladding\nc = 3*10**8; #velocity of light(m/sec)\n\n#Calculation\ndeltatbyL = (n1/n2)*((n1-n2)/c);\n\n#Result\nprint \"pulse broadening per unit length is\",deltatbyL,\"s/m\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The refractive index of the sheet of glass is 1.5642\n" - ] + "text": "pulse broadening per unit length is 1.02040816327e-10 s/m\n" } ], - "prompt_number": 6 + "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 3.4, Page number 72" - ] + "source": "Example number 3.3, Page number 85" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "\n", - "#Variable declaration\n", - "lamda = 5893; #Wavelength of monochromatic lihgt used(A)\n", - "n = 1; #Number of fringe for the least thickness of the film\n", - "cosr = 1; #for normal incidence\n", - "mew = 1.42; #refractive index of the soap film\n", - "\n", - "#Calculation\n", - "#As for constructive interference, \n", - "#2*mew*t*cos(r) = (2*n-1)*lambda/2, solving for t\n", - "t = (2*n-1)*lamda/(4*mew*cosr); #Thickness of the film that appears bright(A)\n", - "#As for destructive interference, \n", - "#2*mu*t*cos(r) = n*lambda, solving for t\n", - "t1 = n*lamda/(2*mew*cosr); #Thickness of the film that appears bright(A)\n", - "\n", - "#Result\n", - "print \"The thickness of the film that appears bright is\",t, \"angstrom\"\n", - "print \"The thickness of the film that appears dark is\",t1, \"angstrom\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nphi_m = 11.54; #phase angle(degrees)\na = 0.5*10**-4;\nx = math.pi/180; #conversion factor from degrees to radians\n\n#Calculation\nphi_m = phi_m*x; #phase angle(radian)\nL = a/math.tan(phi_m); #length(m)\nn = 1/(2*L); #total number of internal reflections(m-1)\n\n#Result\nprint \"alpha = 0 rays have no reflection. hence there are zero reflections for 1 metre.\"\nprint \"alpha = alpha_m rays have\",int(n),\"m-1 internal reflections\"\nprint \"answer given in the book is wrong\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The thickness of the film that appears bright is 1037.5 angstrom\n", - "The thickness of the film that appears dark is 2075.0 angstrom\n" - ] + "text": "alpha = 0 rays have no reflection. hence there are zero reflections for 1 metre.\nalpha = alpha_m rays have 2041 m-1 internal reflections\nanswer given in the book is wrong\n" } ], "prompt_number": 7 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 3.5, Page number 72" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "\n", - "#Variable declaration\n", - "lamda = 5893; #Wavelength of monochromatic lihgt used(A)\n", - "n = 10; #Number of fringe that are found \n", - "d = 1; #Distance of 10 fringes(cm)\n", - "\n", - "#Calculation\n", - "beta = d/n; #Fringe width(cm)\n", - "lamda = lamda*10**-8; #Wavelength of monochromatic lihgt used(cm)\n", - "theta = lamda/(2*beta); #Angle of the wedge(rad)\n", - "theta = theta*10**4;\n", - "theta = math.ceil(theta*10**4)/10**4; #rounding off the value of theta to 4 decimals\n", - "\n", - "#Result\n", - "print \"The angle of the wedge is\",theta,\"*10**-4 rad\"" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The angle of the wedge is 2.9465 *10**-4 rad\n" - ] - } - ], - "prompt_number": 12 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 3.6, Page number 72" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - " \n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "lamda = 5900; #Wavelength of monochromatic lihgt used(A)\n", - "t = 0.010; #Spacer thickness(mm)\n", - "l = 10; #Wedge length(cm)\n", - "\n", - "#Calculation\n", - "t = t*10**-1; #Spacer thickness(cm)\n", - "theta = t/l; #Angle of the wedge(rad)\n", - "lamda = lamda*10**-8; #Wavelength of monochromatic lihgt used(cm)\n", - "beta = lamda/(2*theta); #Fringe width(cm)\n", - "\n", - "#Result\n", - "print \"The separation between consecutive bright fringes is\",beta, \"cm\"" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The separation between consecutive bright fringes is 0.295 cm\n" - ] - } - ], - "prompt_number": 13 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 3.7, Page number 72" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - " \n", - "import math\n", - "\n", - "#Variable declaration\n", - "D4 = 0.4; #Diameter of 4th dark ring(cm)\n", - "D12 = 0.7; #Diameter of 12th dark ring(cm)\n", - "\n", - "#Calculation\n", - "#We have (dn_plus_k**2)-Dn**2 = 4*k*R*lamda\n", - "#D12**2-D4**2 = 32*R*lamda and D20**2-D12**2 = 32*R*lamda for k = 8\n", - "#since RHS are equal, by equating the LHS we get D12**2-D4**2 = D20**2-D12**2\n", - "D20 = math.sqrt((2*D12**2)-D4**2); #Diameter of 20th dark ring(cm)\n", - "D20 = math.ceil(D20*10**4)/10**4; #rounding off the value of D20 to 4 decimals\n", - "\n", - "#Result\n", - "print \"The diameter of 20th dark ring is\",D20, \"cm\"" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The diameter of 20th dark ring is 0.9056 cm\n" - ] - } - ], - "prompt_number": 14 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 3.8, Page number 73" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "Dn = 0.30; #Diameter of nth dark ring with air film(cm)\n", - "dn = 0.25; #Diameter of nth dark ring with liquid film(cm)\n", - "\n", - "#Calculation\n", - "mew = (Dn/dn)**2; #Refractive index of the liquid\n", - "\n", - "#Result\n", - "print \"The refractive index of the liquid is\", mew\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The refractive index of the liquid is 1.44\n" - ] - } - ], - "prompt_number": 15 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 3.9, Page number 73" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "\n", - "#Variable declaration\n", - "x = 0.002945; #Distance through which movable mirror is shifted(cm)\n", - "N = 100; #Number of fringes shifted\n", - "\n", - "#Calculation\n", - "x = x*10**-2; #Distance through which movable mirror is shifted(m)\n", - "lamda = 2*x/N; #Wavelength of light(m)\n", - "lamda = lamda*10**10; #Wavelength of light(A)\n", - "\n", - "#Result\n", - "print \"The wavelength of light is\",lamda, \"angstrom\"" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The wavelength of light is 5890.0 angstrom\n" - ] - } - ], - "prompt_number": 16 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 3.10, Page number 73" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - " \n", - "import math\n", - "\n", - "#Variable declaration\n", - "lambda1 = 5896; #Wavelength of D1 line of sodium(A)\n", - "lambda2 = 5890; #Wavelength of D2 line of sodium(A)\n", - "\n", - "#Calculation\n", - "lamda = (lambda1+lambda2)/2;\n", - "x = (lamda**2)/(2*(lambda1-lambda2)); #Shift in movable mirror of Michelson Interferometer(A)\n", - "x = x*10**-7; #Shift in movable mirror of Michelson Interferometer(mm)\n", - "x = math.ceil(x*10**4)/10**4; #rounding off the value of D20 to 4 decimals\n", - "\n", - "#Result\n", - "print \"The shift in movable mirror is\",x, \"mm\"" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The shift in movable mirror is 0.2894 mm\n" - ] - } - ], - "prompt_number": 17 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [], - "language": "python", - "metadata": {}, - "outputs": [] } ], "metadata": {} diff --git a/Engineering_Physics/Chapter4.ipynb b/Engineering_Physics/Chapter4.ipynb new file mode 100755 index 00000000..5651b165 --- /dev/null +++ b/Engineering_Physics/Chapter4.ipynb @@ -0,0 +1,209 @@ +{ + "metadata": { + "name": "Chapter4" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": "4: Quantum Physics" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 4.1, Page number 117" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nc = 3*10**8; #velocity of light(m/sec)\nh = 6.62*10**-34; #planck's constant\nlamda = 1.2; #wavelength of photon(Angstrom)\ne = 1.6*10**-19; #conversion factor from J to eV\n\n#Calculation\nlamda = lamda*10**-10; #wavelength of photon(m)\nE = (h*c)/(lamda*e); #energy of photon(eV)\nE=math.ceil(E*10)/10; #rounding off to 1 decimal\np = h/lamda; #momentum of photon(kg m/s)\n\n#Result\nprint \"energy of the photon is\",E,\"eV\"\nprint \"momentum of the photon is\",p,\"kg m/s\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "energy of the photon is 10343.8 eV\nmomentum of the photon is 5.51666666667e-24 kg m/s\n" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 4.2, Page number 117" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nh = 6.625*10**-34; #planck's constant\nnew = 900; #frequency(kHz)\nE1 = 10; #power radiated(kW)\n\n#Calculation\nE1 = E1*10**3; #power radiated(W)\nnew = new*10**3; #frequency(Hz)\nE = h*new; #energy of photon(J)\nN = E1/E; #number of photons emitted \n\n#Result\nprint \"number of photons emitted per second is\",N", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "number of photons emitted per second is 1.67714884696e+31\n" + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 4.3, Page number 118" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nc = 3*10**8; #velocity of light(m/sec)\nh = 6.63*10**-34; #planck's constant\nlamda = 5893; #wavelength of photon(Angstrom)\nE1 = 100; #power of lamp(W) \n\n#Calculation\nlamda = lamda*10**-10; #wavelength of photon(m)\nE = h*c/lamda; #energy of photon(J)\nN = E1/E; #number of photons emitted \n\n#Result\nprint \"number of photons emitted per second is\",N\nprint \"answer given in the book is wrong\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "number of photons emitted per second is 2.96279537456e+20\nanswer given in the book is wrong\n" + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 4.4, Page number 118" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nc = 3*10**8; #velocity of light(m/sec)\nh = 6.6*10**-34; #planck's constant\nm0 = 9.1*10**-31; #mass of photon(kg)\ntheta = 30; #viewing angle(degrees)\nlamda = 2.8*10**-10; #wavelength of photon(m)\n\n#Calculation\nx = math.pi/180; #conversion factor from degrees to radians\ntheta = theta*x; #viewing angle(radian) \nlamda_dash = (2*h*(math.sin(theta/2))**2/(m0*c))+lamda; #wavelength of scattered radiation(m)\nlamda_dash = lamda_dash*10**10; #wavelength of scattered radiation(Angstrom)\nlamda_dash=math.ceil(lamda_dash*10**5)/10**5; #rounding off to 5 decimals\n\n#Result\nprint \"wavelength of scattered radiation is\",lamda_dash,\"Angstrom\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "wavelength of scattered radiation is 2.80324 Angstrom\n" + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 4.5, Page number 119" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nh = 6.6*10**-34; #planck's constant\nm = 0.040; #mass of bullet(kg)\nv = 1; #speed of bullet(km/s)\n\n#Calculation\nv = v*10**3; #speed of bullet(m/s)\np = m*v; #momemtun of bullet(kg m/s)\nlamda = h/p; #deBroglie wavelength(m)\nlamda = lamda*10**10; #deBroglie wavelength(Angstrom)\n\n#Result\nprint \"deBroglie wavelength is\",lamda,\"Angstrom\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "deBroglie wavelength is 1.65e-25 Angstrom\n" + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 4.6, Page number 119" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nn = 1; #lowest energy state\na = 0.1; #width of box(nm)\nh = 6.625*10**-34; #planck's constant\ne = 1.602*10**-19; #conversion factor from J to eV\nm = 9.11*10**-31; #mass of particle(kg)\n\n#Calculation\na = a*10**-9; #width of box(m)\nE = (n**2)*(h**2)/(8*m*(a**2)); #energy of particle(J)\nE_eV = E/e; #energy of particle(eV)\nE_eV=math.ceil(E_eV*10)/10; #rounding off to 1 decimal\n\n#Result\nprint \"energy of particle is\",E,\"J or\",E_eV,\"eV\" ", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "energy of particle is 6.02231407794e-18 J or 37.6 eV\n" + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 4.7, Page number 120" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nn = 1; #lowest energy state\na = 4; #width of well(nm)\nh = 6.625*10**-34; #planck's constant\ne = 1.6025*10**-19; #conversion factor from J to eV\nm = 9.11*10**-31; #mass of electron(kg)\n\n#Calculation\na = a*10**-9; #width of box(m)\nE = (n**2)*(h**2)/(8*m*(a**2)); #energy of particle(J)\nE_eV = E/e; #energy of particle(eV)\nE_eV=math.ceil(E_eV*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint \"minimum energy of electron is\",E,\"J or\",E_eV,\"eV\" ", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "minimum energy of electron is 3.76394629871e-21 J or 0.0235 eV\n" + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 4.8, Page number 120" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nn1 = 1; #lowest energy state\nn2 = 6; #for 6th excited state\na = 0.1; #width of box(nm)\nh = 6.625*10**-34; #planck's constant\ne = 1.602*10**-19; #conversion factor from J to eV\nm = 9.11*10**-31; #mass of electron(kg)\n\n#Calculation\na = a*10**-9; #width of box(m)\nE1 = (n1**2)*(h**2)/(8*m*(a**2)); #energy of electron in ground state(J)\nE6 = (n2**2)*(h**2)/(8*m*(a**2)); #energy of electron in excited state(J)\nE = E6-E1; #energy required to excite the electron(J)\nE_eV = E/e; #energy required to excite the electron(eV)\nE_eV=math.ceil(E_eV*10)/10; #rounding off to 1 decimal\n\n#Result\nprint \"energy required to excite the electron is\",E,\"J or\",E_eV,\"eV\" \nprint \"answer for energy in eV given in the book is wrong\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "energy required to excite the electron is 2.10780992728e-16 J or 1315.8 eV\nanswer for energy in eV given in the book is wrong\n" + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 4.9, Page number 121" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nh = 6.625*10**-34; #planck's constant\nc = 3*10**8; #velocity of light(m/sec)\nm0 = 9.11*10**-31; #rest mass of electron(kg)\nphi = 90; #angle of scattering(degrees)\nx = math.pi/180; #conversion factor from degrees to radians\n\n#Calculation\nphi = phi*x; ##angle of scattering(radian)\ndelta_lamda = h*(1-math.cos(phi))/(m0*c); #change in wavelength(m)\n\n#Result\nprint \"change in wavelength of X-ray photon is\",delta_lamda,\"m\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "change in wavelength of X-ray photon is 2.42407610684e-12 m\n" + } + ], + "prompt_number": 9 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Engineering_Physics/Chapter4_1.ipynb b/Engineering_Physics/Chapter4_1.ipynb index c2e7944f..5651b165 100755 --- a/Engineering_Physics/Chapter4_1.ipynb +++ b/Engineering_Physics/Chapter4_1.ipynb @@ -1,7 +1,6 @@ { "metadata": { - "name": "", - "signature": "sha256:bd975238ecc341317a545ed613e73ea0b105f0af115e6d7857237510924e96a0" + "name": "Chapter4" }, "nbformat": 3, "nbformat_minor": 0, @@ -12,61 +11,25 @@ "cell_type": "heading", "level": 1, "metadata": {}, - "source": [ - "4: Diffraction" - ] + "source": "4: Quantum Physics" }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 4.1, Page number 91" - ] + "source": "Example number 4.1, Page number 117" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "from __future__ import division\n", - "import math\n", - "\n", - "#Variable declaration\n", - "D = 50; #Distance between source and the screen(cm)\n", - "lamda = 6563; #Wavelength of light of parallel rays(A)\n", - "d = 0.385; #Width of the slit(mm)\n", - "n1 = 1; #Order of diffraction for first minimum\n", - "n2 = 5; #Order of diffraction for fifth minimum\n", - "\n", - "#Calculation\n", - "lamda = lamda*10**-8; #Wavelength of light of parallel rays(cm)\n", - "d = d*10**-1; #Width of the slit(cm)\n", - "#As sin(theta1) = n*lambda/d = x1/D, solving for x1\n", - "x1 = n1*lamda*D/d; #Distance from the centre of the principal maximum to the first minimum(cm)\n", - "x1 = x1*10; #Distance from the centre of the principal maximum to the first minimum(mm)\n", - "x1 = math.ceil(x1*10**3)/10**3; #rounding off the value of x1 to 3 decimals\n", - "x2 = n2*lamda*D/d; #Distance from the centre of the principal maximum to the fifth minimum(cm)\n", - "x2 = x2*10; #Distance from the centre of the principal maximum to the fifth minimum(mm)\n", - "x2 = math.ceil(x2*10**3)/10**3; #rounding off the value of x2 to 3 decimals\n", - "\n", - "#Result\n", - "print \"The Distance from the centre of the principal maximum to the first minimum is\",x1, \"mm\"\n", - "print \"The Distance from the centre of the principal maximum to the fifth minimum is\",x2, \"mm\"\n", - "\n", - "#answer for x2 given in the book is wrong" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nc = 3*10**8; #velocity of light(m/sec)\nh = 6.62*10**-34; #planck's constant\nlamda = 1.2; #wavelength of photon(Angstrom)\ne = 1.6*10**-19; #conversion factor from J to eV\n\n#Calculation\nlamda = lamda*10**-10; #wavelength of photon(m)\nE = (h*c)/(lamda*e); #energy of photon(eV)\nE=math.ceil(E*10)/10; #rounding off to 1 decimal\np = h/lamda; #momentum of photon(kg m/s)\n\n#Result\nprint \"energy of the photon is\",E,\"eV\"\nprint \"momentum of the photon is\",p,\"kg m/s\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The Distance from the centre of the principal maximum to the first minimum is 0.853 mm\n", - "The Distance from the centre of the principal maximum to the fifth minimum is 4.262 mm\n" - ] + "text": "energy of the photon is 10343.8 eV\nmomentum of the photon is 5.51666666667e-24 kg m/s\n" } ], "prompt_number": 1 @@ -75,405 +38,169 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 4.2, Page number 91" - ] + "source": "Example number 4.2, Page number 117" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "from __future__ import division\n", - "import math\n", - "\n", - "#Variable declaration\n", - "D = 0.04; #Diameter of circular aperture(cm)\n", - "f = 20; #Focal length of convex lens(cm)\n", - "lamda = 6000; #Wavelength of light used(A)\n", - "\n", - "#Calculation\n", - "lamda = lamda*10**-8; #Wavelength of light used(cm)\n", - "#We have sin(theta) = 1.22*lambda/D = theta, for small theta\n", - "#For first dark ring\n", - "theta = 1.22*lamda/D; #The half angular width at central maximum(rad)\n", - "r1 = theta*f; #The half width of central maximum for first dark ring(cm)\n", - "r1 = r1*10**2;\n", - "#We have sin(theta) = 5.136*lambda/(%pi*D) = theta, for small theta\n", - "#For second dark ring\n", - "theta = 5.136*lamda/(math.pi*D); #The half angular width at central maximum(rad)\n", - "r2 = theta*f; #The half width of central maximum for second dark ring(cm)\n", - "r2 = r2*10**2;\n", - "r2 = math.ceil(r2*100)/100; #rounding off the value of r2 to 2 decimals\n", - "\n", - "#Result\n", - "print \"The radius of first dark ring is\",r1,\"*10**-2 cm\"\n", - "print \"The radius of second dark ring is\",r2,\"*10**-2 cm\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nh = 6.625*10**-34; #planck's constant\nnew = 900; #frequency(kHz)\nE1 = 10; #power radiated(kW)\n\n#Calculation\nE1 = E1*10**3; #power radiated(W)\nnew = new*10**3; #frequency(Hz)\nE = h*new; #energy of photon(J)\nN = E1/E; #number of photons emitted \n\n#Result\nprint \"number of photons emitted per second is\",N", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The radius of first dark ring is 3.66 *10**-2 cm\n", - "The radius of second dark ring is 4.91 *10**-2 cm\n" - ] + "text": "number of photons emitted per second is 1.67714884696e+31\n" } ], - "prompt_number": 6 + "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 4.3, Page number 92" - ] + "source": "Example number 4.3, Page number 118" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "n = 2; #Order of diffraction\n", - "lamda = 650; #Wavelength of light used(nm)\n", - "d = 1.2*10**-3; #Distance between two consecutive slits of grating(cm)\n", - "\n", - "#Calculation\n", - "#We have sin(theta) = n*N*lambda = n*lambda/d, solving for theta\n", - "lamda = lamda*10**-9; #Wavelength of light used(m)\n", - "d = d*10**-2; #Distance between two consecutive slits of grating(m)\n", - "a=n*lamda/d;\n", - "theta = math.asin(a); #Angle at which the 650 nm light produces a second order maximum(rad)\n", - "theta = theta*57.2957795; #angle in degrees\n", - "theta = math.ceil(theta*10**2)/10**2; #rounding off the value of theta to 2 decimals\n", - "\n", - "#Result\n", - "print \"The angle at which the light produces a second order maximum is\",theta, \"degrees\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nc = 3*10**8; #velocity of light(m/sec)\nh = 6.63*10**-34; #planck's constant\nlamda = 5893; #wavelength of photon(Angstrom)\nE1 = 100; #power of lamp(W) \n\n#Calculation\nlamda = lamda*10**-10; #wavelength of photon(m)\nE = h*c/lamda; #energy of photon(J)\nN = E1/E; #number of photons emitted \n\n#Result\nprint \"number of photons emitted per second is\",N\nprint \"answer given in the book is wrong\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The angle at which the light produces a second order maximum is 6.22 degrees\n" - ] + "text": "number of photons emitted per second is 2.96279537456e+20\nanswer given in the book is wrong\n" } ], - "prompt_number": 7 + "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 4.4, Page number 92" - ] + "source": "Example number 4.4, Page number 118" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "lamda = 650; #Wavelength of light used(nm)\n", - "N = 6000; #Number of lines per cm on grating\n", - "theta = 90; #Angle at which the highest spectral order is obtained(degrees)\n", - "\n", - "#Calculation\n", - "theta = theta*0.0174532925; #Angle at which the highest spectral order is obtained(rad)\n", - "#We have sin(theta) = n*N*lambda, solving for n\n", - "lamda = lamda*10**-9; #Wavelength of light used(m)\n", - "N = N*10**2; #Number of lines per m on grating\n", - "n = math.sin(theta)/(N*lamda); #The highest order of spectra with diffraction grating\n", - "n = math.ceil(n*10**3)/10**3; #rounding off the value of theta to 3 decimals\n", - "i,d = divmod(n, 1); #divides the value of n into integer and decimal parts where i is integer\n", - "\n", - "#Result\n", - "print \"value of n is\",n\n", - "print \"The highest order of spectra obtained with diffraction grating is\",i\n" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nc = 3*10**8; #velocity of light(m/sec)\nh = 6.6*10**-34; #planck's constant\nm0 = 9.1*10**-31; #mass of photon(kg)\ntheta = 30; #viewing angle(degrees)\nlamda = 2.8*10**-10; #wavelength of photon(m)\n\n#Calculation\nx = math.pi/180; #conversion factor from degrees to radians\ntheta = theta*x; #viewing angle(radian) \nlamda_dash = (2*h*(math.sin(theta/2))**2/(m0*c))+lamda; #wavelength of scattered radiation(m)\nlamda_dash = lamda_dash*10**10; #wavelength of scattered radiation(Angstrom)\nlamda_dash=math.ceil(lamda_dash*10**5)/10**5; #rounding off to 5 decimals\n\n#Result\nprint \"wavelength of scattered radiation is\",lamda_dash,\"Angstrom\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "value of n is 2.565\n", - "The highest order of spectra obtained with diffraction grating is 2.0\n" - ] + "text": "wavelength of scattered radiation is 2.80324 Angstrom\n" } ], - "prompt_number": 8 + "prompt_number": 4 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 4.5, Page number 92" - ] + "source": "Example number 4.5, Page number 119" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "\n", - "#Variable declaration\n", - "N = 4000; #Number of lines per cm on grating\n", - "#For Blue Line\n", - "lamda1 = 450; #Wavelength of blue light(nm)\n", - "n1 = 3; #Order of diffraction spectrum\n", - "#For Red Line\n", - "lamda2 = 700; #Wavelength of red light(nm)\n", - "n2 = 2; #Order of diffraction spectrum\n", - "\n", - "#Calculation\n", - "N = N*10**2; #Number of lines per m on grating\n", - "lamda1 = lamda1*10**-9; #Wavelength of blue light(m)\n", - "lamda2 = lamda2*10**-9; #Wavelength of red light(m)\n", - "#We have sin(theta) = n*N*lambda, solving for sin(theta)\n", - "sin_theta_3 = n1*N*lamda1; #Sine of angle at third order diffraction \n", - "sin_theta_2 = n2*N*lamda2; #Sine of angle at second order diffraction\n", - "\n", - "#Result\n", - "print \"Sine of angle at third order diffraction is\",sin_theta_3\n", - "print \"Sine of angle at second order diffraction is\",sin_theta_2 \n", - "#Check for overlapping\n", - "if (sin_theta_2-sin_theta_3)<0.05:\n", - " print \"The two orders overlap\"\n", - "else:\n", - " print \"The two orders do not overlap\" " - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nh = 6.6*10**-34; #planck's constant\nm = 0.040; #mass of bullet(kg)\nv = 1; #speed of bullet(km/s)\n\n#Calculation\nv = v*10**3; #speed of bullet(m/s)\np = m*v; #momemtun of bullet(kg m/s)\nlamda = h/p; #deBroglie wavelength(m)\nlamda = lamda*10**10; #deBroglie wavelength(Angstrom)\n\n#Result\nprint \"deBroglie wavelength is\",lamda,\"Angstrom\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "Sine of angle at third order diffraction is 0.54\n", - "Sine of angle at second order diffraction is 0.56\n", - "The two orders overlap\n" - ] + "text": "deBroglie wavelength is 1.65e-25 Angstrom\n" } ], - "prompt_number": 9 + "prompt_number": 5 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 4.6, Page number 93" - ] + "source": "Example number 4.6, Page number 119" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "\n", - "#Variable declaration\n", - "n = 1; #Order of diffraction spectrum\n", - "N = 6000; #Number of lines per cm on diffraction grating\n", - "D = 2; #Distance of screen from the source(m)\n", - "lamda1 = 400; #Wavelength of blue light(nm)\n", - "lamda2 = 750; #Wavelength of blue light(nm)\n", - "\n", - "#Calculation\n", - "N = N*10**2; #Number of lines per m on grating\n", - "lamda1 = lamda1*10**-9; #Wavelength of blue light(m)\n", - "lamda2 = lamda2*10**-9; #Wavelength of blue light(m)\n", - "#We have sin(theta1) = n*N*lamda1, solving for theta1\n", - "theta1 = math.asin(n*N*lamda1); #Angle at first order diffraction for Blue light(rad)\n", - "theta1_d = theta1*57.2957795; #Angle at first order diffraction for Blue light(degrees)\n", - "theta2 = math.asin(n*N*lamda2); #Angle at first order diffraction for Red light(rad)\n", - "theta2_d = theta2*57.2957795; #Angle at first order diffraction for Red light(degrees)\n", - "x1 = D*math.tan(theta1); #Half width position at central maximum for blue color(m)\n", - "x2 = D*math.tan(theta2); #Half width position at central maximum for red color(m)\n", - "x = x2-x1; #width of first order spectrum on the screen(m)\n", - "x = x*10**2; #width of first order spectrum on the screen(cm)\n", - "x = math.ceil(x*10**2)/10**2; #rounding off the value of x to 2 decimals\n", - "\n", - "#Result\n", - "print \"The width of first order spectrum on the screen is\",x, \"cm\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nn = 1; #lowest energy state\na = 0.1; #width of box(nm)\nh = 6.625*10**-34; #planck's constant\ne = 1.602*10**-19; #conversion factor from J to eV\nm = 9.11*10**-31; #mass of particle(kg)\n\n#Calculation\na = a*10**-9; #width of box(m)\nE = (n**2)*(h**2)/(8*m*(a**2)); #energy of particle(J)\nE_eV = E/e; #energy of particle(eV)\nE_eV=math.ceil(E_eV*10)/10; #rounding off to 1 decimal\n\n#Result\nprint \"energy of particle is\",E,\"J or\",E_eV,\"eV\" ", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The width of first order spectrum on the screen is 51.34 cm\n" - ] + "text": "energy of particle is 6.02231407794e-18 J or 37.6 eV\n" } ], - "prompt_number": 10 + "prompt_number": 6 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 4.7, Page number 93" - ] + "source": "Example number 4.7, Page number 120" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "\n", - "#Variable declaration\n", - "w = 5; #Width of the grating(cm)\n", - "N = 32; #Number of lines per mm on grating\n", - "lamda = 640; #Wavelength of light(nm)\n", - "n = 2; #Order of diffraction\n", - "\n", - "#Calculation\n", - "N= N*10; #Number of lines per cm on grating\n", - "N0 = w*N; #Total number of lines on the grating\n", - "d_lambda = lamda/(n*N0); #Separation between wavelengths(nm)\n", - "\n", - "#Result\n", - "print \"The separation between wavelengths which the grating can just resolve is\",d_lambda, \"nm\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nn = 1; #lowest energy state\na = 4; #width of well(nm)\nh = 6.625*10**-34; #planck's constant\ne = 1.6025*10**-19; #conversion factor from J to eV\nm = 9.11*10**-31; #mass of electron(kg)\n\n#Calculation\na = a*10**-9; #width of box(m)\nE = (n**2)*(h**2)/(8*m*(a**2)); #energy of particle(J)\nE_eV = E/e; #energy of particle(eV)\nE_eV=math.ceil(E_eV*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint \"minimum energy of electron is\",E,\"J or\",E_eV,\"eV\" ", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The separation between wavelengths which the grating can just resolve is 0.2 nm\n" - ] + "text": "minimum energy of electron is 3.76394629871e-21 J or 0.0235 eV\n" } ], - "prompt_number": 11 + "prompt_number": 7 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 4.8, Page number 93" - ] + "source": "Example number 4.8, Page number 120" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "\n", - "#Variable declaration\n", - "lamda = 550; #Wavelength of light(nm)\n", - "D = 3.2; #Diameter of circular lens(cm)\n", - "f = 24; #Focal length of the lens(cm) \n", - "\n", - "#Calculation\n", - "lamda = lamda*10**-9; #Wavelength of light(m)\n", - "D = D*10**-2; #Diameter of circular lens(m)\n", - "theta_min = 1.22*lamda/D; #Minimum angle of resolution provided by the lens(rad)\n", - "#As delta_x/f = theta_min, solving for delta_x\n", - "f = f*10**-2; #Focal length of the lens(m) \n", - "delta_x = theta_min*f; #Separation of the centres of the images in the focal plane of lens(m)\n", - "delta_x = delta_x*10**6; #Separation of the centres of the images in the focal plane of lens(micro m)\n", - " \n", - "#Result\n", - "print \"The separation of the centres of the images in the focal plane is\",round(delta_x), \"micro-metre\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nn1 = 1; #lowest energy state\nn2 = 6; #for 6th excited state\na = 0.1; #width of box(nm)\nh = 6.625*10**-34; #planck's constant\ne = 1.602*10**-19; #conversion factor from J to eV\nm = 9.11*10**-31; #mass of electron(kg)\n\n#Calculation\na = a*10**-9; #width of box(m)\nE1 = (n1**2)*(h**2)/(8*m*(a**2)); #energy of electron in ground state(J)\nE6 = (n2**2)*(h**2)/(8*m*(a**2)); #energy of electron in excited state(J)\nE = E6-E1; #energy required to excite the electron(J)\nE_eV = E/e; #energy required to excite the electron(eV)\nE_eV=math.ceil(E_eV*10)/10; #rounding off to 1 decimal\n\n#Result\nprint \"energy required to excite the electron is\",E,\"J or\",E_eV,\"eV\" \nprint \"answer for energy in eV given in the book is wrong\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The separation of the centres of the images in the focal plane is 5.0 micro-metre\n" - ] + "text": "energy required to excite the electron is 2.10780992728e-16 J or 1315.8 eV\nanswer for energy in eV given in the book is wrong\n" } ], - "prompt_number": 12 + "prompt_number": 8 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 4.9, Page number 94" - ] + "source": "Example number 4.9, Page number 121" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "lamda = 550; #Wavelength of light(nm)\n", - "D = 20; #Diameter of objective of telescope(cm)\n", - "d = 6; #Distance of two points from the objective of telescope(km)\n", - "\n", - "#Calculation\n", - "lamda = lamda*10**-9; #Wavelength of light(m)\n", - "D = D*10**-2; #Diameter of objective of telescope(m)\n", - "d = d*10**3; #Distance of two points from the objective of telescope(m)\n", - "theta = 1.22*lamda/D; #Angular separation between two points(rad)\n", - "x = theta*d; #Linear separation between two points(m)\n", - "x = x*10**3; #Linear separation between two points(mm)\n", - "\n", - "#Result\n", - "print \"The linear separation between two points is\",x, \"mm\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nh = 6.625*10**-34; #planck's constant\nc = 3*10**8; #velocity of light(m/sec)\nm0 = 9.11*10**-31; #rest mass of electron(kg)\nphi = 90; #angle of scattering(degrees)\nx = math.pi/180; #conversion factor from degrees to radians\n\n#Calculation\nphi = phi*x; ##angle of scattering(radian)\ndelta_lamda = h*(1-math.cos(phi))/(m0*c); #change in wavelength(m)\n\n#Result\nprint \"change in wavelength of X-ray photon is\",delta_lamda,\"m\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The linear separation between two points is 20.13 mm\n" - ] + "text": "change in wavelength of X-ray photon is 2.42407610684e-12 m\n" } ], - "prompt_number": 13 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [], - "language": "python", - "metadata": {}, - "outputs": [] + "prompt_number": 9 } ], "metadata": {} diff --git a/Engineering_Physics/Chapter5.ipynb b/Engineering_Physics/Chapter5.ipynb new file mode 100755 index 00000000..ba6e0e69 --- /dev/null +++ b/Engineering_Physics/Chapter5.ipynb @@ -0,0 +1,152 @@ +{ + "metadata": { + "name": "Chapter5" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": "5: Crystal Physics" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 5.1, Page number 149, theoretical" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 5.2, Page number 150" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nn = 8; #number of atoms per cell\na = 5.43*10**-8; #lattice constant(cm)\nw = 28.1; #atomic weight(gm)\nN = 6.02*10**23; #avagadro number\n\n#Calculation\nac = n/(a**3); #atomic concentration(atoms/cm**3)\nd = ac*w/N; #density of Si(g/cm**3)\nd=math.ceil(d*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"density of Si is\",d,\"g/cm**3\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "density of Si is 2.333 g/cm**3\n" + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 5.3, Page number 151" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\na = 5; #lattice constant(Angstrom)\n\n#Calculation\na = a*10**-10; #lattice constant(m)\n#to calculate the planar concentration, only equilateral triangular region is considered of length a*math.sqrt(2) and height a*math.sqrt(3/2)\nl = a*math.sqrt(2); #length of face diagonal(m)\nh = a*math.sqrt(3/2); #height of triangle(m)\nA = l*h/2; #area of shaded portion(m**2)\n#every atom at the corner contributes 1/6 to this area.\nn111 = (3/6)*(1/A); #planar concentration(atoms/m**2)\n\n#Result\nprint \"surface density of atoms is\",n111,\"atoms/m**2\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "surface density of atoms is 2.30940107676e+18 atoms/m**2\n" + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 5.4, Page number 152" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\na = 4.049; #lattice constant(Angstrom)\nh = 2;\nk = 2;\nl = 0; #miller indices of(2 2 0)\n\n#Calculation\nd = a/math.sqrt(h**2+k**2+l**2); #spacing of planes(Angstrom)\nd=math.ceil(d*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"spacing of planes is\",d,\"Angstrom\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "spacing of planes is 1.432 Angstrom\n" + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 5.5, Page number 152" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nd110 = 2.03; #distance between planes(Angstrom)\nh = 1;\nk = 1;\nl = 0; #miller indices of(1 1 0)\n\n#Calculation\na = d110*math.sqrt(h**2+k**2+l**2); #size of unit cell(Angstrom)\na=math.ceil(a*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"size of unit cell is\",a,\"Angstrom\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "size of unit cell is 2.871 Angstrom\n" + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 5.6, Page number 152" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\na = 5.64; #lattice constant(Angstrom)\nh1 = 1;\nk1 = 0;\nl1 = 0; #miller indices of(1 0 0)\nh2 = 1;\nk2 = 1;\nl2 = 0; #miller indices of(1 1 0)\nh3 = 1;\nk3 = 1;\nl3 = 1; #miller indices of(1 1 1)\n\n#Calculation\nd100 = a/math.sqrt(h1**2+k1**2+l1**2); #spacing of planes[100](Angstrom)\nd110 = a/math.sqrt(h2**2+k2**2+l2**2); #spacing of planes[110](Angstrom)\nd111 = a/math.sqrt(h3**2+k3**2+l3**2); #spacing of planes[111](Angstrom)\nd111=math.ceil(d111*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint \"spacing of plane [100] is\",d100,\"Angstrom\"\nprint \"spacing of plane [110] is\",round(d110),\"Angstrom\"\nprint \"spacing of plane [111] is\",d111,\"Angstrom\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "spacing of plane [100] is 5.64 Angstrom\nspacing of plane [110] is 4.0 Angstrom\nspacing of plane [111] is 3.26 Angstrom\n" + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 5.7, Page number 153" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nr = 1.605; #radius of atom(Angstrom)\n\n\n#Calculation\nr = r*10**-10; #radius of atom(m)\na = 2*r; #size of unit cell(m)\nc = a*math.sqrt(8/3);\nV = 3*math.sqrt(3)*a**2*c/2; #volume of unit cell(m**3)\n\n#Result\nprint \"volume of unit cell is\",V,\"m**3\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "volume of unit cell is 1.40330266432e-28 m**3\n" + } + ], + "prompt_number": 7 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Engineering_Physics/Chapter5_1.ipynb b/Engineering_Physics/Chapter5_1.ipynb index 86db7d36..ba6e0e69 100755 --- a/Engineering_Physics/Chapter5_1.ipynb +++ b/Engineering_Physics/Chapter5_1.ipynb @@ -1,7 +1,6 @@ { "metadata": { - "name": "", - "signature": "sha256:7539e2f35ea93dc5f143cbd45df18f4d6a1bee4d35a1729fab5d759b4b27d8ff" + "name": "Chapter5" }, "nbformat": 3, "nbformat_minor": 0, @@ -12,281 +11,139 @@ "cell_type": "heading", "level": 1, "metadata": {}, - "source": [ - "5: Polarization" - ] + "source": "5: Crystal Physics" }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 5.1, Page number 113" - ] + "source": "Example number 5.1, Page number 149, theoretical" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 5.2, Page number 150" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "from __future__ import division\n", - "import math\n", - "\n", - "#Variable declaration\n", - "mew_g = 1.72; #Refractive index of glass\n", - "mew_w = 4/3; #Refractive index of water\n", - "\n", - "#Calculation\n", - "#For polarization to occur on flint glass, tan(i) = mew_g/mew_w\n", - "#Solving for i\n", - "i_g = math.atan(mew_g/mew_w); #angle of incidence for complete polarization for flint glass(rad)\n", - "a = 180/math.pi; #conversion factor from radians to degrees\n", - "i_g = i_g*a; #angle of incidence(degrees)\n", - "i_g = math.ceil(i_g*10**2)/10**2; #rounding off the value of i_g to 2 decimals\n", - "#For polarization to occur on water, tan(i) = mew_w/mew_g\n", - "#Solving for i\n", - "i_w = math.atan(mew_w/mew_g); #angle of incidence for complete polarization for water(rad)\n", - "i_w = i_w*a; #angle of incidence(degrees)\n", - "i_w = math.ceil(i_w*10**3)/10**3; #rounding off the value of i_w to 3 decimals\n", - "\n", - "#Result\n", - "print \"The angle of incidence for complete polarization to occur on flint glass is\",i_g, \"degrees\"\n", - "print \"The angle of incidence for complete polarization to occur on water is\",i_w, \"degrees\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nn = 8; #number of atoms per cell\na = 5.43*10**-8; #lattice constant(cm)\nw = 28.1; #atomic weight(gm)\nN = 6.02*10**23; #avagadro number\n\n#Calculation\nac = n/(a**3); #atomic concentration(atoms/cm**3)\nd = ac*w/N; #density of Si(g/cm**3)\nd=math.ceil(d*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"density of Si is\",d,\"g/cm**3\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The angle of incidence for complete polarization to occur on flint glass is 52.22 degrees\n", - "The angle of incidence for complete polarization to occur on water is 37.783 degrees\n" - ] + "text": "density of Si is 2.333 g/cm**3\n" } ], - "prompt_number": 5 + "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 5.2, Page number 113" - ] + "source": "Example number 5.3, Page number 151" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "from __future__ import division\n", - "import math\n", - "\n", - "#Variable declaration\n", - "I0 = 1; #For simplicity, we assume the intensity of light falling on the second Nicol prism to be unity(W/m**2)\n", - "theta = 30; #Angle through which the crossed Nicol is rotated(degrees)\n", - "\n", - "#Calculation\n", - "theeta = 90-theta; #angle between the planes of transmission after rotating through 30 degrees\n", - "a = math.pi/180; #conversion factor from degrees to radians\n", - "theeta = theeta*a; ##angle between the planes of transmission(rad)\n", - "I = I0*math.cos(theeta)**2; #Intensity of the emerging light from second Nicol(W/m**2)\n", - "T = (I/(2*I0))*100; #Percentage transmission of incident light\n", - "T = math.ceil(T*100)/100; #rounding off the value of T to 2 decimals\n", - "\n", - "#Result\n", - "print \"The percentage transmission of incident light after emerging through the Nicol prism is\",T, \"%\"" - ], + "input": "#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\na = 5; #lattice constant(Angstrom)\n\n#Calculation\na = a*10**-10; #lattice constant(m)\n#to calculate the planar concentration, only equilateral triangular region is considered of length a*math.sqrt(2) and height a*math.sqrt(3/2)\nl = a*math.sqrt(2); #length of face diagonal(m)\nh = a*math.sqrt(3/2); #height of triangle(m)\nA = l*h/2; #area of shaded portion(m**2)\n#every atom at the corner contributes 1/6 to this area.\nn111 = (3/6)*(1/A); #planar concentration(atoms/m**2)\n\n#Result\nprint \"surface density of atoms is\",n111,\"atoms/m**2\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The percentage transmission of incident light after emerging through the Nicol prism is 12.51 %\n" - ] + "text": "surface density of atoms is 2.30940107676e+18 atoms/m**2\n" } ], - "prompt_number": 6 + "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 5.3, Page number 113" - ] + "source": "Example number 5.4, Page number 152" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "from __future__ import division\n", - "import math\n", - "\n", - "#Variable declaration\n", - "lamda = 6000; #Wavelength of incident light(A)\n", - "mew_e = 1.55; #Refractive index of extraordinary ray\n", - "mew_o = 1.54; #Refractive index of ordinary ray\n", - "\n", - "#Calculation\n", - "lamda = lamda*10**-8; #Wavelength of incident light(cm)\n", - "t = lamda/(4*(mew_e-mew_o)); #Thickness of Quarter Wave plate of positive crystal(cm)\n", - "\n", - "#Result\n", - "print \"The thickness of Quarter Wave plate is\",t, \"cm\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\na = 4.049; #lattice constant(Angstrom)\nh = 2;\nk = 2;\nl = 0; #miller indices of(2 2 0)\n\n#Calculation\nd = a/math.sqrt(h**2+k**2+l**2); #spacing of planes(Angstrom)\nd=math.ceil(d*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"spacing of planes is\",d,\"Angstrom\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The thickness of Quarter Wave plate is 0.0015 cm\n" - ] + "text": "spacing of planes is 1.432 Angstrom\n" } ], - "prompt_number": 7 + "prompt_number": 4 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 5.4, Page number 114" - ] + "source": "Example number 5.5, Page number 152" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#Calculation\n", - "#the thickness of a half wave plate of calcite for wavelength lamda is\n", - "#t = lamda/(2*(mew_e - mew_o)) = (2*lamda)/(4*(mew_e - mew_o))\n", - "\n", - "#Result\n", - "print \"The half wave plate for lamda will behave as a quarter wave plate for 2*lamda for negligible variation of refractive index with wavelength\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nd110 = 2.03; #distance between planes(Angstrom)\nh = 1;\nk = 1;\nl = 0; #miller indices of(1 1 0)\n\n#Calculation\na = d110*math.sqrt(h**2+k**2+l**2); #size of unit cell(Angstrom)\na=math.ceil(a*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"size of unit cell is\",a,\"Angstrom\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The half wave plate for lamda will behave as a quarter wave plate for 2*lamda for negligible variation of refractive index with wavelength\n" - ] + "text": "size of unit cell is 2.871 Angstrom\n" } ], - "prompt_number": 8 + "prompt_number": 5 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 5.5, Page number 114" - ] + "source": "Example number 5.6, Page number 152" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "\n", - "#importing modules\n", - "from __future__ import division\n", - "import math\n", - "\n", - "#Variable declaration\n", - "lamda = 500; #Wavelength of incident light(nm)\n", - "mew_e = 1.5508; #Refractive index of extraordinary ray\n", - "mew_o = 1.5418; #Refractive index of ordinary ray\n", - "t = 0.032; #Thickness of quartz plate(mm)\n", - "\n", - "#Calculation\n", - "lamda = lamda*10**-9; #Wavelength of incident light(m)\n", - "t = t*10**-3; #Thickness of quartz plate(m)\n", - "dx = (mew_e - mew_o)*t; #Path difference between E-ray and O-ray(m)\n", - "dphi = (2*math.pi)/lamda*dx; #Phase retardation for quartz for given wavelength(rad)\n", - "dphi = dphi/math.pi;\n", - "\n", - "#Result\n", - "print \"The phase retardation for quartz for given wavelength is\",dphi, \"pi rad\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\na = 5.64; #lattice constant(Angstrom)\nh1 = 1;\nk1 = 0;\nl1 = 0; #miller indices of(1 0 0)\nh2 = 1;\nk2 = 1;\nl2 = 0; #miller indices of(1 1 0)\nh3 = 1;\nk3 = 1;\nl3 = 1; #miller indices of(1 1 1)\n\n#Calculation\nd100 = a/math.sqrt(h1**2+k1**2+l1**2); #spacing of planes[100](Angstrom)\nd110 = a/math.sqrt(h2**2+k2**2+l2**2); #spacing of planes[110](Angstrom)\nd111 = a/math.sqrt(h3**2+k3**2+l3**2); #spacing of planes[111](Angstrom)\nd111=math.ceil(d111*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint \"spacing of plane [100] is\",d100,\"Angstrom\"\nprint \"spacing of plane [110] is\",round(d110),\"Angstrom\"\nprint \"spacing of plane [111] is\",d111,\"Angstrom\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The phase retardation for quartz for given wavelength is 1.152 pi rad\n" - ] + "text": "spacing of plane [100] is 5.64 Angstrom\nspacing of plane [110] is 4.0 Angstrom\nspacing of plane [111] is 3.26 Angstrom\n" } ], - "prompt_number": 9 + "prompt_number": 6 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 5.6, Page number 114" - ] + "source": "Example number 5.7, Page number 153" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "\n", - "#Variable declaration\n", - "C = 52; #Critical angle for total internal reflection(degrees)\n", - "\n", - "#Calculation\n", - "a = math.pi/180; #conversion factor from degrees to radians\n", - "C = C*a; #Critical angle for total internal reflection(rad)\n", - "#From Brewster's law, math.tan(i_B) = 1_mew_2\n", - "#Also math.sin(C) = 1_mew_2, so that math.tan(i_B) = math.sin(C), solving for i_B\n", - "i_B = math.atan(math.sin(C)); #Brewster angle at the boundary(rad)\n", - "b = 180/math.pi; #conversion factor from radians to degrees\n", - "i_B = i_B*b; #Brewster angle at the boundary(degrees)\n", - "\n", - "#Result\n", - "print \"The Brewster angle at the boundary between two materials is\",int(i_B), \"degrees\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nr = 1.605; #radius of atom(Angstrom)\n\n\n#Calculation\nr = r*10**-10; #radius of atom(m)\na = 2*r; #size of unit cell(m)\nc = a*math.sqrt(8/3);\nV = 3*math.sqrt(3)*a**2*c/2; #volume of unit cell(m**3)\n\n#Result\nprint \"volume of unit cell is\",V,\"m**3\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The Brewster angle at the boundary between two materials is 38 degrees\n" - ] + "text": "volume of unit cell is 1.40330266432e-28 m**3\n" } ], - "prompt_number": 13 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 10 + "prompt_number": 7 } ], "metadata": {} diff --git a/Engineering_Physics/Chapter6.ipynb b/Engineering_Physics/Chapter6.ipynb new file mode 100755 index 00000000..768ed817 --- /dev/null +++ b/Engineering_Physics/Chapter6.ipynb @@ -0,0 +1,356 @@ +{ + "metadata": { + "name": "Chapter6" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": "6: Conducting Materials" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 6.1, Page number 170" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nm = 9.1*10**-31; #mass of electron\nvf = 1*10**6; #Fermi velocity(m/s)\ne = 1.6*10**-19; #conversion factor from J to eV\n\n#Calculation\nEF = m*(vf**2)/(2*e); #Fermi energy(eV)\nEF=math.ceil(EF*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint \"Fermi energy is\",EF,\"eV\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Fermi energy is 2.85 eV\n" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 6.2, Page number 170" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nEF0 = 7.04; #Fermi energy at 0K(eV)\nT = 300; #temperature(K)\nk = 1.38*10**-23; #boltzmann constant\ne = 1.6*10**-19; #conversion factor from J to eV\n\n#Calculation\nEF = EF0*(1-(((math.pi**2)/12)*(k*T/(EF0*e))**2)); #Fermi energy(eV)\nEF=math.ceil(EF*10**5)/10**5; #rounding off to 5 decimals\n\n#Result\nprint \"Fermi energy is\",EF,\"eV\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Fermi energy is 7.03993 eV\n" + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 6.3, Page number 171" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nd = 2.7*10**3; #density of Al(kg/m**3)\nMat = 27; #atomic weight of Al\ntow = 10**-14; #relaxation time(sec)\nNa = 6.022*10**23; #avagadro constant\na = 3*10**3; #number of free electrons per atom\ne = 1.6*10**-19; #charge of electron\nme = 9.1*10**-31; #mass of electron\n\n#Calculation\nn = d*Na*a/Mat; #concentration of atoms(per m**3)\nsigma = n*e**2*tow/me; #conductivity(ohm m)\nsigma = sigma*10**-7;\nsigma=math.ceil(sigma*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint \"conductivity of Al is\",sigma,\"*10**7 ohm m\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "conductivity of Al is 5.0824 *10**7 ohm m\n" + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 6.4, Page number 171" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nsigma = 5.87*10**7; #electrical conductivity(per ohm m)\nK = 390; #thermal conductivity(W/mK)\nT = 20; #temperature(C)\n\n#Calculation\nT = T+273; #temperature(K)\nL = K/(sigma*T); #Lorentz number(W ohm/K**2)\n\n#Result\nprint \"Lorentz number is\",L,\"W ohm/K**2\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Lorentz number is 2.26756051189e-08 W ohm/K**2\n" + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 6.5, Page number 172" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nd = 8900; #density of Cu(kg/m**3)\nMat = 63.5; #atomic weight of Cu\ntow = 10**-14; #relaxation time(sec)\nNa = 6.022*10**23; #avagadro constant\na = 1*10**3; #number of free electrons per atom\ne = 1.6*10**-19; #charge of electron\nme = 9.1*10**-31; #mass of electron\n\n#Calculation\nn = d*Na*a/Mat; #concentration of atoms(per m**3)\nsigma = n*e**2*tow/me; #electrical conductivity(ohm m)\nsigma = sigma*10**-7;\nsigma=math.ceil(sigma*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint \"electrical conductivity is\",sigma,\"*10**7 ohm m\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "electrical conductivity is 2.3745 *10**7 ohm m\n" + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 6.6, Page number 172" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nrho = 1.54*10**-8; #resistivity(ohm m)\nEF = 5.5; #fermi energy(eV)\nme = 9.1*10**-31; #mass of electron\nepsilon = 100;\ne = 1.6*10**-19; #charge of electron\nn = 5.8*10**28; #concentration of electrons(per m**3)\n\n#Calculation\ntow = me/(rho*n*e**2); #relaxation time(sec)\nmew = e*tow/me; #mobility of electrons(m**2/Vs)\nmew = mew*10**3;\nvd = e*tow*epsilon/me; #drift velocity(m/s)\nvd=math.ceil(vd*10)/10; #rounding off to 1 decimal\nEF = EF*e; #fermi energy((J)\nvF = math.sqrt(2*EF/me); #fermi velocity(m/s)\nvf = vF*10**-6;\nvf=math.ceil(vf*10**3)/10**3; #rounding off to 3 decimals\nlamda_m = vF*tow; #mean free path(m)\n\n#Result\nprint \"relaxation time of electrons is\",tow,\"sec\"\nprint \"mobility of electrons is\",mew,\"*10**-3 m**2/Vs\"\nprint \"drift velocity of electrons is\",vd,\"m/s\"\nprint \"drift velocity given in the book is wrong\"\nprint \"fermi velocity of electrons is\",vf,\"*10**6 m/s\"\nprint \"mean free path is\",lamda_m,\"m\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "relaxation time of electrons is 3.97972178683e-14 sec\nmobility of electrons is 6.9973130318 *10**-3 m**2/Vs\ndrift velocity of electrons is 0.7 m/s\ndrift velocity given in the book is wrong\nfermi velocity of electrons is 1.391 *10**6 m/s\nmean free path is 5.53462691011e-08 m\n" + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 6.7, Page number 174" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nrho = 1.72*10**-8; #electrical resistivity(ohm m)\nL = 2.26*10**-8; #Lorentz number(ohm W/K**2)\nT = 27; #temperature(C)\n\n#Calculation\nT = T+273; #temperature(K)\nK = L*T/rho; #thermal conductivity(W/mK)\n\n#Result\nprint \"thermal conductivity is\",int(K),\"W/mK\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "thermal conductivity is 394 W/mK\n" + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 6.8, Page number 174" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nsigma = 5.87*10**7; #electrical conductivity(per ohm m)\nK = 390; #thermal conductivity(W/mK)\nT = 20; #temperature(C)\n\n#Calculation\nT = T+273; #temperature(K)\nL = K/(sigma*T); #Lorentz number(W ohm/K**2)\n\n#Result\nprint \"Lorentz number is\",L,\"W ohm/K**2\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Lorentz number is 2.26756051189e-08 W ohm/K**2\n" + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 6.9, Page number 174" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nE_EF = 0.01; #energy(eV)\ne = 1.6*10**-19; #conversion factor from eV to J\nT = 200; #temperature(K)\nk = 1.38*10**-23; #boltzmann constant(J/K)\n\n#Calculation\nE_EF = E_EF*e; #energy(J)\nA = E_EF/(k*T);\nFofE = 1/(1+(math.exp(A))); #value of F(E)\nFofE=math.ceil(FofE*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint \"value of F(E) is\",FofE", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "value of F(E) is 0.36\n" + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 6.10, Page number 175" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nlamda = 4*10**-8; #mean free path(m)\nn = 8.4*10**28; #density(per m**3)\nvthbar = 1.6*10**6; #average thermal velocity(m/s)\ne = 1.6*10**-19; #charge of electron(c)\nm = 9.11*10**-31; #mass of electron\n\n#Calculation\nsigma = n*e**2*lamda/(m*vthbar); #electrical conductivity(ohm-1 m-1)\nsigma = sigma*10**-7;\nsigma=math.ceil(sigma*100)/100; #rounding off to 2 decimals\n\n#Result\nprint \"electrical conductivity is\",sigma,\"*10**7 ohm-1 m-1\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "electrical conductivity is 5.91 *10**7 ohm-1 m-1\n" + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 6.11, Page number 176" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\ntow = 10**-14; #relaxation time(sec)\nT = 300; #temperature(K)\nn = 6*10**28; #electron concentration(per m**3)\ne = 1.6*10**-19; #charge of electron(c)\nme = 9.1*10**-31; #mass of electron\nk = 1.38*10**-23; #boltzmann constant(J/K)\n\n#Calculation\nsigma = n*e**2*tow/me; #electrical conductivity(ohm-1 m-1)\nsigmaa = sigma*10**-7;\nsigmaa=math.ceil(sigmaa*100)/100; #rounding off to 2 decimals\nK = 3*n*(k**2)*tow*T/(2*me); #thermal conductivity(W/mK)\nK=math.ceil(K*10)/10; #rounding off to 1 decimal\nL = K/(sigma*T); #Lorentz number(W ohm/K**2)\n\n#Result\nprint \"electrical conductivity is\",sigmaa,\"*10**7 ohm-1 m-1\"\nprint \"thermal conductivity is\",K,\"W/mK\"\nprint \"Lorentz number is\",L,\"W ohm/K**2\"\nprint \"answer for thermal conductivity and Lorentz number given in the book are wrong\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "electrical conductivity is 1.69 *10**7 ohm-1 m-1\nthermal conductivity is 56.6 W/mK\nLorentz number is 1.11775173611e-08 W ohm/K**2\nanswer for thermal conductivity and Lorentz number given in the book are wrong\n" + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 6.12, Page number 177" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nn = 5.8*10**28; #electron concentration(per m**3)\ne = 1.6*10**-19; #charge of electron(c)\nm = 9.1*10**-31; #mass of electron\nrho = 1.54*10**-8; #resistivity of metal(ohm m)\n\n#Calculation\ntow = m/(n*rho*e**2); #relaxation time(sec)\n\n#Result\nprint \"relaxation time is\",tow,\"sec\"\nprint \"answer given in the book is wrong\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "relaxation time is 3.97972178683e-14 sec\nanswer given in the book is wrong\n" + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 6.13, Page number 177" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nrho = 1.54*10**-8; #resistivity(ohm m)\nE = 1; #electric field(V/cm)\nme = 9.1*10**-31; #mass of electron\ne = 1.6*10**-19; #charge of electron\nn = 5.8*10**28; #concentration of electrons(per m**3)\n\n#Calculation\nE = E*10**2; #electric field(V/m)\ntow = me/(rho*n*e**2); #relaxation time(sec)\nvd = e*E*tow/me; #drift velocity(m/s)\nvd=math.ceil(vd*10)/10; #rounding off to 1 decimal\nmew = vd/E; #mobility of electrons(m**2/Vs)\nmew = mew*10**2;\n\n#Result\nprint \"relaxation time of electrons is\",tow,\"sec\"\nprint \"drift velocity of electrons is\",vd,\"m/s\"\nprint \"mobility of electrons is\",mew,\"*10**-2 m**2/Vs\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "relaxation time of electrons is 3.97972178683e-14 sec\ndrift velocity of electrons is 0.7 m/s\nmobility of electrons is 0.7 *10**-2 m**2/Vs\n" + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 6.14, Page number 178" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nT = 300; #temperature(K)\nl = 2; #length of wire(m)\nR = 0.02; #resistance(ohm)\nI = 15; #current(amp)\nmew = 4.3*10**-3; #mobility(m**2/Vs)\n\n#Calculation\nV = I*R; #voltage drop(V)\nE = V/l; #electric field(V/m)\nvd = mew*E; #drift velocity(m/s)\nvd = vd*10**3;\nvd=math.ceil(vd*100)/100; #rounding off to 2 decimals\n\n#Result\nprint \"drift velocity of electrons is\",vd,\"*10**-3 m/s\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "drift velocity of electrons is 0.65 *10**-3 m/s\n" + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 6.15, Page number 179" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nvf = 0.86*10**6; #fermi velocity(m/s)\nm = 9.1*10**-31; #mass of electron(kg)\ne = 1.6*10**-19; #charge of electron(C)\nk = 1.38*10**-23; #boltzmann constant\n\n#Calculation\nEF = m*vf**2/(2*e); #fermi energy(eV)\nEF=math.ceil(EF*100)/100; #rounding off to 2 decimals\nTF = EF*e/k; #fermi temperature(K)\n\n#Result\nprint \"Fermi energy is\",EF,\"eV\"\nprint \"Fermi temperature is\",int(TF),\"K\"\nprint \"answer for fermi temperature given in the book is wrong due to rounding off the value of EF\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Fermi energy is 2.11 eV\nFermi temperature is 24463 K\nanswer for fermi temperature given in the book is wrong due to rounding off the value of EF\n" + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 6.16, Page number 179" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nTF = 2460; #fermi temperature(K)\nm = 9.11*10**-31; #mass of electron(kg)\nk = 1.38*10**-23; #boltzmann constant\n\n#Calculation\nvF = math.sqrt(2*k*TF/m); #fermi velocity(m/s)\nvF = vF*10**-5;\nvF=math.ceil(vF*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"Fermi velocity is\",vF,\"*10**5 m/s\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Fermi velocity is 2.731 *10**5 m/s\n" + } + ], + "prompt_number": 16 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Engineering_Physics/Chapter6_1.ipynb b/Engineering_Physics/Chapter6_1.ipynb index 63de6fa0..768ed817 100755 --- a/Engineering_Physics/Chapter6_1.ipynb +++ b/Engineering_Physics/Chapter6_1.ipynb @@ -1,7 +1,6 @@ { "metadata": { - "name": "", - "signature": "sha256:761cc333c24ab0bff41cc769407ab239595ed8749ad7bd7c5ee14e4e733b1604" + "name": "Chapter6" }, "nbformat": 3, "nbformat_minor": 0, @@ -12,50 +11,25 @@ "cell_type": "heading", "level": 1, "metadata": {}, - "source": [ - "6: Crystallography" - ] + "source": "6: Conducting Materials" }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 6.1, Page number 134" - ] + "source": "Example number 6.1, Page number 170" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "M = 23+35.5; #Molecular weight of NaCl(kg/k-mole)\n", - "d = 2.18*10**3; #Density of rock salt(kg/m**3)\n", - "n = 4; #Number of atoms per unit cell for an fcc lattice of NaCl crystal\n", - "N = 6.02*10**26; #Avogadro's No., atoms/k-mol\n", - "\n", - "#Calculation\n", - "a = (n*M/(d*N))**(1/3); #Lattice constant of unit cell of NaCl(m)\n", - "a = a*10**9; ##Lattice constant of unit cell of NaCl(nm)\n", - "a = math.ceil(a*10**3)/10**3; #rounding off the value of a to 3 decimals\n", - "\n", - "#Result\n", - "print \"Lattice parameter for the NaCl crystal is\",a, \"nm\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nm = 9.1*10**-31; #mass of electron\nvf = 1*10**6; #Fermi velocity(m/s)\ne = 1.6*10**-19; #conversion factor from J to eV\n\n#Calculation\nEF = m*(vf**2)/(2*e); #Fermi energy(eV)\nEF=math.ceil(EF*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint \"Fermi energy is\",EF,\"eV\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "Lattice parameter for the NaCl crystal is 0.563 nm\n" - ] + "text": "Fermi energy is 2.85 eV\n" } ], "prompt_number": 1 @@ -64,39 +38,19 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 6.2, Page number 134" - ] + "source": "Example number 6.2, Page number 170" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "\n", - "#Variable declaration\n", - "m = 3;\n", - "n = 2; \n", - "p = 1; #Coefficients of intercepts along three axes\n", - "\n", - "#Calculation\n", - "#reciprocals of the intercepts are 1/m, 1/n, 1/p i.e 1/3, 1/2, 1\n", - "#multiplying by LCM the reciprocals become 2, 3, 6\n", - "\n", - "#Result\n", - "print \"The required miller indices are : (2, 3, 6)\"\n" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nEF0 = 7.04; #Fermi energy at 0K(eV)\nT = 300; #temperature(K)\nk = 1.38*10**-23; #boltzmann constant\ne = 1.6*10**-19; #conversion factor from J to eV\n\n#Calculation\nEF = EF0*(1-(((math.pi**2)/12)*(k*T/(EF0*e))**2)); #Fermi energy(eV)\nEF=math.ceil(EF*10**5)/10**5; #rounding off to 5 decimals\n\n#Result\nprint \"Fermi energy is\",EF,\"eV\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The required miller indices are : (2, 3, 6)\n" - ] + "text": "Fermi energy is 7.03993 eV\n" } ], "prompt_number": 2 @@ -105,38 +59,19 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 6.3, Page number 135" - ] + "source": "Example number 6.3, Page number 171" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "import math\n", - "\n", - "#Variable declaration\n", - "m = 2; #Coefficient of intercept along x-axis\n", - "#n = infinite Coefficient of intercept along y-axis\n", - "p = 3/2; #Coefficient of intercept along z-axis\n", - "\n", - "#Calculation\n", - "#reciprocals of the intercepts are 1/m, 1/n, 1/p i.e 1/2, 0, 2/3\n", - "#multiplying by LCM the reciprocals become 3, 0, 4\n", - "\n", - "#Result\n", - "print \"The required miller indices are : (3, 0, 4)\"\n" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nd = 2.7*10**3; #density of Al(kg/m**3)\nMat = 27; #atomic weight of Al\ntow = 10**-14; #relaxation time(sec)\nNa = 6.022*10**23; #avagadro constant\na = 3*10**3; #number of free electrons per atom\ne = 1.6*10**-19; #charge of electron\nme = 9.1*10**-31; #mass of electron\n\n#Calculation\nn = d*Na*a/Mat; #concentration of atoms(per m**3)\nsigma = n*e**2*tow/me; #conductivity(ohm m)\nsigma = sigma*10**-7;\nsigma=math.ceil(sigma*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint \"conductivity of Al is\",sigma,\"*10**7 ohm m\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The required miller indices are : (3, 0, 4)\n" - ] + "text": "conductivity of Al is 5.0824 *10**7 ohm m\n" } ], "prompt_number": 3 @@ -145,59 +80,19 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 6.4, Sketching not possible" - ] - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 6.5, Page number 136" - ] + "source": "Example number 6.4, Page number 171" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "#For (110) planes\n", - "h1 = 1;\n", - "k1 = 1;\n", - "l1 = 0; #Miller Indices for planes in a cubic crystal\n", - "a1 = 0.43; #Interatomic spacing(nm)\n", - "#For (212) planes\n", - "h2 = 2; \n", - "k2 = 1;\n", - "l2 = 2; #Miller Indices for planes in a cubic crystal\n", - "a2 = 0.43; #Interatomic spacing(nm)\n", - "\n", - "#Calculation\n", - "d1 = a1/(h1**2+k1**2+l1**2)**(1/2); #The interplanar spacing for cubic crystals(nm)\n", - "d1 = math.ceil(d1*10**4)/10**4; #rounding off the value of d1 to 4 decimals\n", - "d2 = a2/(h2**2+k2**2+l2**2)**(1/2); #The interplanar spacing for cubic crystals(nm)\n", - "d2 = math.ceil(d2*10**4)/10**4; #rounding off the value of d2 to 4 decimals\n", - "\n", - "#Result\n", - "print \"The interplanar spacing between consecutive (110) planes is\",d1, \"nm\";\n", - "print \"The interplanar spacing between consecutive (212) planes is\",d2, \"nm\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nsigma = 5.87*10**7; #electrical conductivity(per ohm m)\nK = 390; #thermal conductivity(W/mK)\nT = 20; #temperature(C)\n\n#Calculation\nT = T+273; #temperature(K)\nL = K/(sigma*T); #Lorentz number(W ohm/K**2)\n\n#Result\nprint \"Lorentz number is\",L,\"W ohm/K**2\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The interplanar spacing between consecutive (110) planes is 0.3041 nm\n", - "The interplanar spacing between consecutive (212) planes is 0.1434 nm\n" - ] + "text": "Lorentz number is 2.26756051189e-08 W ohm/K**2\n" } ], "prompt_number": 4 @@ -206,42 +101,19 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 6.6, Page number 136" - ] + "source": "Example number 6.5, Page number 172" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "h = 2;\n", - "k = 3;\n", - "l = 1; #Miller Indices for planes in a cubic crystal\n", - "r = 0.175; #Atomic radius of fcc lattice(nm)\n", - "\n", - "#Calculation\n", - "a = 2*math.sqrt(2)*r; #Interatomic spacing of fcc lattice(nm)\n", - "d = a/(h**2+k**2+l**2)**(1/2); #The interplanar spacing for cubic crystals(nm)\n", - "d = math.ceil(d*10**4)/10**4; #rounding off the value of d to 4 decimals\n", - "\n", - "#Result\n", - "print \"The interplanar spacing between consecutive (231) planes is\",d, \"nm\"\n" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nd = 8900; #density of Cu(kg/m**3)\nMat = 63.5; #atomic weight of Cu\ntow = 10**-14; #relaxation time(sec)\nNa = 6.022*10**23; #avagadro constant\na = 1*10**3; #number of free electrons per atom\ne = 1.6*10**-19; #charge of electron\nme = 9.1*10**-31; #mass of electron\n\n#Calculation\nn = d*Na*a/Mat; #concentration of atoms(per m**3)\nsigma = n*e**2*tow/me; #electrical conductivity(ohm m)\nsigma = sigma*10**-7;\nsigma=math.ceil(sigma*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint \"electrical conductivity is\",sigma,\"*10**7 ohm m\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The interplanar spacing between consecutive (231) planes is 0.1323 nm\n" - ] + "text": "electrical conductivity is 2.3745 *10**7 ohm m\n" } ], "prompt_number": 5 @@ -250,47 +122,19 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 6.7, Page number 136" - ] + "source": "Example number 6.6, Page number 172" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "lamda = 1.44; #Wavelength of X-rays(A)\n", - "d = 2.8; #Interplanar spacing of rocksalt crystal(A)\n", - "n1 = 1; #For 1st Order diffraction\n", - "n2 = 2; #For 2nd Order diffraction\n", - "\n", - "#Calculation\n", - "theta1 = math.asin(n1*lamda/(2*d)); #Angle of diffraction(radians)\n", - "theeta1 = theta1*57.2957795; #Angle of diffraction(degrees)\n", - "theeta1 = math.ceil(theeta1*10**2)/10**2; #rounding off the value of theeta1 to 2 decimals\n", - "theta2 = math.asin(n2*lamda/(2*d)); #Angle of diffraction(radians)\n", - "theeta2 = theta2*57.2957795; #Angle of diffraction(degrees)\n", - "theeta2 = math.ceil(theeta2*10**2)/10**2; #rounding off the value of theeta2 to 2 decimals\n", - "\n", - "#Result\n", - "print \"The angle of diffraction for first order maxima is\",theeta1, \"degrees\"\n", - "print \"The angle of diffraction for second order maxima is\",theeta2, \"degrees\"\n" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nrho = 1.54*10**-8; #resistivity(ohm m)\nEF = 5.5; #fermi energy(eV)\nme = 9.1*10**-31; #mass of electron\nepsilon = 100;\ne = 1.6*10**-19; #charge of electron\nn = 5.8*10**28; #concentration of electrons(per m**3)\n\n#Calculation\ntow = me/(rho*n*e**2); #relaxation time(sec)\nmew = e*tow/me; #mobility of electrons(m**2/Vs)\nmew = mew*10**3;\nvd = e*tow*epsilon/me; #drift velocity(m/s)\nvd=math.ceil(vd*10)/10; #rounding off to 1 decimal\nEF = EF*e; #fermi energy((J)\nvF = math.sqrt(2*EF/me); #fermi velocity(m/s)\nvf = vF*10**-6;\nvf=math.ceil(vf*10**3)/10**3; #rounding off to 3 decimals\nlamda_m = vF*tow; #mean free path(m)\n\n#Result\nprint \"relaxation time of electrons is\",tow,\"sec\"\nprint \"mobility of electrons is\",mew,\"*10**-3 m**2/Vs\"\nprint \"drift velocity of electrons is\",vd,\"m/s\"\nprint \"drift velocity given in the book is wrong\"\nprint \"fermi velocity of electrons is\",vf,\"*10**6 m/s\"\nprint \"mean free path is\",lamda_m,\"m\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The angle of diffraction for first order maxima is 14.91 degrees\n", - "The angle of diffraction for second order maxima is 30.95 degrees\n" - ] + "text": "relaxation time of electrons is 3.97972178683e-14 sec\nmobility of electrons is 6.9973130318 *10**-3 m**2/Vs\ndrift velocity of electrons is 0.7 m/s\ndrift velocity given in the book is wrong\nfermi velocity of electrons is 1.391 *10**6 m/s\nmean free path is 5.53462691011e-08 m\n" } ], "prompt_number": 6 @@ -299,42 +143,19 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 6.8, Page number 136" - ] + "source": "Example number 6.7, Page number 174" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "a = 1; #For convenience, assume interatomic spacing to be unity(m)\n", - "\n", - "#Calculation\n", - "N = 8*(1/8) + 6*(1/2); #total number of spheres in a unit cell\n", - "r = a/(2*math.sqrt(2)); #The atomic radius(m)\n", - "V_atom = N*(4/3)*math.pi*r**3; #Volume of atoms(m**3)\n", - "V_uc = a**3; #Volume of unit cell(m**3)\n", - "PV = (V_atom/V_uc)*100; #percentage of actual volume\n", - "PV = math.ceil(PV*10)/10; #rounding off the value of PV to 1 decimal\n", - "\n", - "#Result\n", - "print \"The percentage of actual volume occupied by the spheres in fcc structure is\",PV, \"percent\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nrho = 1.72*10**-8; #electrical resistivity(ohm m)\nL = 2.26*10**-8; #Lorentz number(ohm W/K**2)\nT = 27; #temperature(C)\n\n#Calculation\nT = T+273; #temperature(K)\nK = L*T/rho; #thermal conductivity(W/mK)\n\n#Result\nprint \"thermal conductivity is\",int(K),\"W/mK\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The percentage of actual volume occupied by the spheres in fcc structure is 74.1 percent\n" - ] + "text": "thermal conductivity is 394 W/mK\n" } ], "prompt_number": 7 @@ -343,56 +164,40 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 6.9, Page number 137" - ] + "source": "Example number 6.8, Page number 174" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "#For (221) planes\n", - "h = 2; \n", - "k = 2; \n", - "l = 1; #Miller Indices for planes in a cubic crystal\n", - "a = 2.68; #Interatomic spacing(A)\n", - "n1 = 1; #First Order of diffraction \n", - "n2 = 2; #Second order of diffraction\n", - "theta1 = 8.5; #Glancing angle at which Bragg's reflection occurs(degrees)\n", - "\n", - "#Calculation\n", - "theta1 = theta1*0.0174532925; #Glancing angle at which Bragg's reflection occurs(radians)\n", - "a = a*10**-10; #Interatomic spacing(m)\n", - "d = a/(h**2+k**2+l**2)**(1/2); #The interplanar spacing for cubic crystal(m)\n", - "lamda = 2*d*math.sin(theta1)/n1; #Bragg's Law for wavelength of X-rays(m)\n", - "lamda_A = lamda*10**10; #Bragg's Law for wavelength of X-rays(A)\n", - "lamda_A = math.ceil(lamda_A*10**4)/10**4; #rounding off the value of lamda_A to 4 decimals\n", - "theta2 = math.asin(n2*lamda/(2*d)); #Angle at which second order Bragg reflection occurs(radians)\n", - "theta2 = theta2*57.2957795; #Angle at which second order Bragg reflection occurs(degrees)\n", - "theta2 = math.ceil(theta2*10)/10; #rounding off the value of theta2 to 1 decimal\n", - "\n", - "#Result\n", - "print \"The interplanar spacing between consecutive (221) planes is\",d, \"m\"\n", - "print \"The wavelength of X-rays is\",lamda_A, \"angstrom\"\n", - "print \"The angle at which second order Bragg reflection occurs is\",theta2, \"degrees\"" + "input": "#importing modules\nimport math\n\n#Variable declaration\nsigma = 5.87*10**7; #electrical conductivity(per ohm m)\nK = 390; #thermal conductivity(W/mK)\nT = 20; #temperature(C)\n\n#Calculation\nT = T+273; #temperature(K)\nL = K/(sigma*T); #Lorentz number(W ohm/K**2)\n\n#Result\nprint \"Lorentz number is\",L,\"W ohm/K**2\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Lorentz number is 2.26756051189e-08 W ohm/K**2\n" + } ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 6.9, Page number 174" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nE_EF = 0.01; #energy(eV)\ne = 1.6*10**-19; #conversion factor from eV to J\nT = 200; #temperature(K)\nk = 1.38*10**-23; #boltzmann constant(J/K)\n\n#Calculation\nE_EF = E_EF*e; #energy(J)\nA = E_EF/(k*T);\nFofE = 1/(1+(math.exp(A))); #value of F(E)\nFofE=math.ceil(FofE*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint \"value of F(E) is\",FofE", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The interplanar spacing between consecutive (221) planes is 8.93333333333e-11 m\n", - "The wavelength of X-rays is 0.2641 angstrom\n", - "The angle at which second order Bragg reflection occurs is 17.2 degrees\n" - ] + "text": "value of F(E) is 0.36\n" } ], "prompt_number": 9 @@ -401,45 +206,19 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 6.10, Page number 137" - ] + "source": "Example number 6.10, Page number 175" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "h = 1; \n", - "k = 1;\n", - "l = 0; #Miller Indices for planes in a cubic crystal\n", - "n = 1; #First Order of diffraction \n", - "theta = 25; #Glancing angle at which Bragg's reflection occurs(degrees)\n", - "lamda = 0.7; #Wavelength of X-rays(A)\n", - "\n", - "#Calculation\n", - "theta = theta*0.0174532925; #Glancing angle at which Bragg's reflection occurs(radians)\n", - "d = n*lamda/(2*math.sin(theta)); #Interplanar spacing of cubic crystal(A)\n", - "a = d*(h**2+k**2+l**2)**(1/2); #The lattice parameter for cubic crystal(A)\n", - "a = math.ceil(a*10**3)/10**3; #rounding off the value of a to 3 decimals\n", - "\n", - "#Result\n", - "print \"The lattice parameter for cubic crystal is\",a, \"angstrom\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nlamda = 4*10**-8; #mean free path(m)\nn = 8.4*10**28; #density(per m**3)\nvthbar = 1.6*10**6; #average thermal velocity(m/s)\ne = 1.6*10**-19; #charge of electron(c)\nm = 9.11*10**-31; #mass of electron\n\n#Calculation\nsigma = n*e**2*lamda/(m*vthbar); #electrical conductivity(ohm-1 m-1)\nsigma = sigma*10**-7;\nsigma=math.ceil(sigma*100)/100; #rounding off to 2 decimals\n\n#Result\nprint \"electrical conductivity is\",sigma,\"*10**7 ohm-1 m-1\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The lattice parameter for cubic crystal is 1.172 angstrom\n" - ] + "text": "electrical conductivity is 5.91 *10**7 ohm-1 m-1\n" } ], "prompt_number": 10 @@ -448,46 +227,19 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 6.11, Page number 138" - ] + "source": "Example number 6.11, Page number 176" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "d = 0.31; #Interplanar spacing(nm)\n", - "n = 1; #First Order of diffraction \n", - "theta = 9.25; #Glancing angle at which Bragg's reflection occurs(degrees)\n", - "theta_max = 90; #Maximum possible angle at which reflection can occur(degrees)\n", - "theta_max = theta_max*0.0174532925; #Maximum possible angle at which reflection can occur(radians)\n", - "\n", - "#Calculation\n", - "theta = theta*0.0174532925; #Glancing angle at which Bragg's reflection occurs(radians)\n", - "lamda = 2*d*math.sin(theta)/n; #Wavelength of X-rays(nm) (Bragg's Law)\n", - "lamda = math.ceil(lamda*10**5)/10**5; #rounding off the value of lamda to 5 decimals\n", - "n = 2*d*math.sin(theta_max)/lamda; #Maximum possible order of diffraction\n", - "\n", - "#Result\n", - "print \"The wavelength of X-rays is\",lamda, \"nm\"\n", - "print \"The Maximum possible order of diffraction is\",round(n)" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\ntow = 10**-14; #relaxation time(sec)\nT = 300; #temperature(K)\nn = 6*10**28; #electron concentration(per m**3)\ne = 1.6*10**-19; #charge of electron(c)\nme = 9.1*10**-31; #mass of electron\nk = 1.38*10**-23; #boltzmann constant(J/K)\n\n#Calculation\nsigma = n*e**2*tow/me; #electrical conductivity(ohm-1 m-1)\nsigmaa = sigma*10**-7;\nsigmaa=math.ceil(sigmaa*100)/100; #rounding off to 2 decimals\nK = 3*n*(k**2)*tow*T/(2*me); #thermal conductivity(W/mK)\nK=math.ceil(K*10)/10; #rounding off to 1 decimal\nL = K/(sigma*T); #Lorentz number(W ohm/K**2)\n\n#Result\nprint \"electrical conductivity is\",sigmaa,\"*10**7 ohm-1 m-1\"\nprint \"thermal conductivity is\",K,\"W/mK\"\nprint \"Lorentz number is\",L,\"W ohm/K**2\"\nprint \"answer for thermal conductivity and Lorentz number given in the book are wrong\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The wavelength of X-rays is 0.09967 nm\n", - "The Maximum possible order of diffraction is 6.0\n" - ] + "text": "electrical conductivity is 1.69 *10**7 ohm-1 m-1\nthermal conductivity is 56.6 W/mK\nLorentz number is 1.11775173611e-08 W ohm/K**2\nanswer for thermal conductivity and Lorentz number given in the book are wrong\n" } ], "prompt_number": 11 @@ -496,51 +248,19 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 6.12, Page number 138" - ] + "source": "Example number 6.12, Page number 177" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "#For (110) planes\n", - "h1 = 1;\n", - "k1 = 1;\n", - "l1 = 0; #Miller indices for (110) planes\n", - "d_110 = 0.195; #Interplanar spacing between (110) planes(nm)\n", - "#For (210) planes\n", - "h2 = 2;\n", - "k2 = 1; \n", - "l2 = 0; #Miller indices for (110) planes\n", - "n = 2; #Second Order of diffraction \n", - "lamda = 0.071; #Wavelength of X-rays(nm)\n", - "\n", - "#Calculation\n", - "a = d_110*(h1**2 + k1**2 + l1**2)**(1/2); #Lattice parameter for bcc crystal(nm)\n", - "d_210 = a/(h2**2 + k2**2 + l2**2)**(1/2); #Interplanar spacing between (210) planes(nm)\n", - "theta = math.asin(n*lamda/(2*d_210)); #Bragg reflection angle for the second order diffraction(radians)\n", - "theeta = theta*57.2957795; #Bragg reflection angle for the second order diffraction(degrees)\n", - "theeta = math.ceil(theeta*10**3)/10**3; #rounding off the value of theeta to 3 decimals\n", - "\n", - "#Result\n", - "print \"Bragg reflection angle for the second order diffraction is\",theeta, \"degrees\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nn = 5.8*10**28; #electron concentration(per m**3)\ne = 1.6*10**-19; #charge of electron(c)\nm = 9.1*10**-31; #mass of electron\nrho = 1.54*10**-8; #resistivity of metal(ohm m)\n\n#Calculation\ntow = m/(n*rho*e**2); #relaxation time(sec)\n\n#Result\nprint \"relaxation time is\",tow,\"sec\"\nprint \"answer given in the book is wrong\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "Bragg reflection angle for the second order diffraction is 35.149 degrees\n" - ] + "text": "relaxation time is 3.97972178683e-14 sec\nanswer given in the book is wrong\n" } ], "prompt_number": 12 @@ -549,44 +269,19 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 6.13, Page number 138" - ] + "source": "Example number 6.13, Page number 177" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "d = 2182; #Density of rock salt(kg/m**3)\n", - "n = 4; #Number of atoms per unit cell for an fcc lattice of NaCl crystal\n", - "N = 6.02*10**26; #Avogadro's number(atoms/k-mol)\n", - "\n", - "#Calculation\n", - "M = 23+35.5; #Molecular weight of NaCl(kg/k-mole)\n", - "#V = a^3 = M*n/(N*d)\n", - "a = (n*M/(d*N))**(1/3); #Lattice constant of unit cell of NaCl(m)\n", - "D = a/2; #distance between nearest neighbours(m)\n", - "D = D*10**9; #distance between nearest neighbours(nm)\n", - "D = math.ceil(D*10**4)/10**4; #rounding off the value of D to 4 decimals\n", - "\n", - "#Result\n", - "print \"The distance between nearest neighbours of NaCl structure is\",D, \"nm\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nrho = 1.54*10**-8; #resistivity(ohm m)\nE = 1; #electric field(V/cm)\nme = 9.1*10**-31; #mass of electron\ne = 1.6*10**-19; #charge of electron\nn = 5.8*10**28; #concentration of electrons(per m**3)\n\n#Calculation\nE = E*10**2; #electric field(V/m)\ntow = me/(rho*n*e**2); #relaxation time(sec)\nvd = e*E*tow/me; #drift velocity(m/s)\nvd=math.ceil(vd*10)/10; #rounding off to 1 decimal\nmew = vd/E; #mobility of electrons(m**2/Vs)\nmew = mew*10**2;\n\n#Result\nprint \"relaxation time of electrons is\",tow,\"sec\"\nprint \"drift velocity of electrons is\",vd,\"m/s\"\nprint \"mobility of electrons is\",mew,\"*10**-2 m**2/Vs\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The distance between nearest neighbours of NaCl structure is 0.2814 nm\n" - ] + "text": "relaxation time of electrons is 3.97972178683e-14 sec\ndrift velocity of electrons is 0.7 m/s\nmobility of electrons is 0.7 *10**-2 m**2/Vs\n" } ], "prompt_number": 13 @@ -595,59 +290,64 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 6.14, Page number 139" - ] + "source": "Example number 6.14, Page number 178" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "r1 = 1.258; #Atomic radius of bcc structure of iron(A)\n", - "N1 = 2; #Number of atoms per unit cell in bcc structure\n", - "#For fcc structure\n", - "r2 = 1.292; #Atomic radius of fcc structure of iron(A)\n", - "N2 = 4; #Number of atoms per unit cell in fcc structure\n", - "\n", - "#Calculation\n", - "a1 = 4*r1/math.sqrt(3); #Lattice parameter of bcc structure of iron(A)\n", - "V1 = a1**3; #Volume of bcc unit cell(A)\n", - "V_atom_bcc = V1/N1; #Volume occupied by one atom(A)\n", - "a2 = 2*math.sqrt(2)*r2; #Lattice parameter of fcc structure of iron(A)\n", - "V2 = a2**3; #Volume of fcc unit cell(A)\n", - "V_atom_fcc = V2/N2; #Volume occupied by one atom(A)\n", - "delta_V = (V_atom_bcc-V_atom_fcc)/V_atom_bcc*100; #Percentage change in volume due to structural change of iron\n", - "delta_V = math.ceil(delta_V*10**3)/10**3; #rounding off the value of delta_V to 3 decimals\n", - "\n", - "#Result\n", - "print \"The percentage change in volume of iron is\",delta_V, \"percent\"" + "input": "#importing modules\nimport math\n\n#Variable declaration\nT = 300; #temperature(K)\nl = 2; #length of wire(m)\nR = 0.02; #resistance(ohm)\nI = 15; #current(amp)\nmew = 4.3*10**-3; #mobility(m**2/Vs)\n\n#Calculation\nV = I*R; #voltage drop(V)\nE = V/l; #electric field(V/m)\nvd = mew*E; #drift velocity(m/s)\nvd = vd*10**3;\nvd=math.ceil(vd*100)/100; #rounding off to 2 decimals\n\n#Result\nprint \"drift velocity of electrons is\",vd,\"*10**-3 m/s\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "drift velocity of electrons is 0.65 *10**-3 m/s\n" + } ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 6.15, Page number 179" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nvf = 0.86*10**6; #fermi velocity(m/s)\nm = 9.1*10**-31; #mass of electron(kg)\ne = 1.6*10**-19; #charge of electron(C)\nk = 1.38*10**-23; #boltzmann constant\n\n#Calculation\nEF = m*vf**2/(2*e); #fermi energy(eV)\nEF=math.ceil(EF*100)/100; #rounding off to 2 decimals\nTF = EF*e/k; #fermi temperature(K)\n\n#Result\nprint \"Fermi energy is\",EF,\"eV\"\nprint \"Fermi temperature is\",int(TF),\"K\"\nprint \"answer for fermi temperature given in the book is wrong due to rounding off the value of EF\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The percentage change in volume of iron is 0.494 percent\n" - ] + "text": "Fermi energy is 2.11 eV\nFermi temperature is 24463 K\nanswer for fermi temperature given in the book is wrong due to rounding off the value of EF\n" } ], "prompt_number": 15 }, { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 6.16, Page number 179" + }, + { "cell_type": "code", "collapsed": false, - "input": [], + "input": "#importing modules\nimport math\n\n#Variable declaration\nTF = 2460; #fermi temperature(K)\nm = 9.11*10**-31; #mass of electron(kg)\nk = 1.38*10**-23; #boltzmann constant\n\n#Calculation\nvF = math.sqrt(2*k*TF/m); #fermi velocity(m/s)\nvF = vF*10**-5;\nvF=math.ceil(vF*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"Fermi velocity is\",vF,\"*10**5 m/s\"", "language": "python", "metadata": {}, - "outputs": [] + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Fermi velocity is 2.731 *10**5 m/s\n" + } + ], + "prompt_number": 16 } ], "metadata": {} diff --git a/Engineering_Physics/Chapter7.ipynb b/Engineering_Physics/Chapter7.ipynb new file mode 100755 index 00000000..d6a7ab3d --- /dev/null +++ b/Engineering_Physics/Chapter7.ipynb @@ -0,0 +1,468 @@ +{ + "metadata": { + "name": "Chapter7", + "signature": "sha256:043709ddd748250fcd3232cc251c6d71d665f281189e172a4c8d9b59233bdcee" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": "7: Semiconducting Materials" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.1, Page number 208" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nme = 9.11*10**-31; #mass of electron(kg)\nepsilon_r = 13.2; \nepsilon0 = 8.85*10**-12;\nh = 6.63*10**-34;\ne = 1.6*10**-19; #charge of electron(C)\n\n#Calculation\nm_nc = 0.067*me;\nE = m_nc*e**4/(8*(epsilon0*epsilon_r*h)**2); #energy(J)\nE = E/e; #energy(eV)\nE = math.ceil(E*10**5)/10**5; #rounding off to 5 decimals\nE_meV = E*10**3; #energy(meV)\n\n#Result\nprint \"donor binding energy is\",E,\"eV or\",E_meV,\"meV\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "donor binding energy is 0.00521 eV or 5.21 meV\n" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.2, Page number 208" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nimport numpy as np\n\n#Variable declaration\nNd = 10**16; #donor concentration(atoms/cm**3)\nni = 1.5*10**10; #concentration(per cm**3)\nT = 300; #temperature(K)\nkT = 0.0259;\n\n#Calculation\nn0 = Nd; #for Nd>>ni, assume n0=Nd\np0 = ni**2/n0; #equilibrium hole concentration(per cm**3)\np0 = p0*10**-4;\nEF_Ei = kT*np.log(n0/ni);\nEF_Ei = math.ceil(EF_Ei*10**4)/10**4; #rounding off to 4 decimals\n\n\n#Result\nprint \"equilibrium hole concentration is\",p0,\"*10**4 per cm**3\"\nprint \"value of EF-Ei is\",EF_Ei,\"eV\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "equilibrium hole concentration is 2.25 *10**4 per cm**3\nvalue of EF-Ei is 0.3474 eV\n" + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.3, Page number 209" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\ne = 1.6*10**-19; #charge of electron(C)\nNd = 10**14; #donor density(atoms/cm**3)\nmew_n = 3900;\n\n#Calculation\nn = Nd;\nsigma = n*e*mew_n; #conductivity(ohm-1 cm-1)\nrho = 1/sigma; #resistivity(ohm cm)\nrho = math.ceil(rho*100)/100; #rounding off to 2 decimals\n\n\n#Result\nprint \"resistivity of sample is\",rho,\"ohm cm\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "resistivity of sample is 16.03 ohm cm\n" + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.4, Page number 209" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\ne = 1.6*10**-19; #charge of electron(C)\nn0 = 5*10**16; #donor density(atoms/cm**3)\nmew_0 = 800;\nIx = 2; #current(mA)\nBz = 5*10**-5;\nd = 200; #thickness(micrometre)\n\n#Calculation\nIx = Ix*10**-3; #current(A)\nd = d*10**-4; #thickness(m)\nsigma = e*n0*mew_0; #conductivity(ohm-1 cm-1)\nrho = 1/sigma; #resistivity(ohm cm)\nrho = math.ceil(rho*10**4)/10**4; #rounding off to 4 decimals\nRH = -1/(e*n0); #Hall coefficient(cm**3/C)\nVH = Ix*Bz*RH/d; #Hall voltage(V)\nVH = VH*10**5;\n\n\n#Result\nprint \"resistivity of sample is\",rho,\"ohm cm\"\nprint \"Hall coefficient is\",RH,\"cm**3/C\"\nprint \"Hall voltage is\",VH,\"*10**-5 V\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "resistivity of sample is 0.1563 ohm cm\nHall coefficient is -125.0 cm**3/C\nHall voltage is -62.5 *10**-5 V\n" + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.5, Page number 210" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nT = 300; #temperature(K)\nmew_n = 0.4; #electron mobility(m**2/Vs)\nmew_p = 0.2; #hole mobility(m**2/Vs)\nEg = 0.7; #band gap(eV)\nme = 9.11*10**-31; #mass of electron(kg)\nk = 1.38*10**-23; #boltzmann constant\nT = 300; #temperature(K)\nh = 6.625*10**-34;\nkT = 0.0259;\ne = 1.6*10**-19; #charge of electron(C)\n\n#Calculation\nmn_star = 0.55*me; #electron effective mass(kg)\nmp_star = 0.37*me; #hole effective mass(kg)\na = (2*math.pi*k*T/(h**2))**(3/2);\nb = (mn_star*mp_star)**(3/4);\nc = math.exp(-Eg/(2*kT));\nni = 2*a*b*c; #intrinsic concentration(per m**3)\nsigma = ni*e*(mew_n+mew_p); #intrinsic conductivity(per ohm m)\nsigma = math.ceil(sigma*10**4)/10**4; #rounding off to 4 decimals\nrho = 1/sigma; #intrinsic resistivity(ohm m)\nrho = math.ceil(rho*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint \"intrinsic concentration is\",ni,\"per m**3\"\nprint \"intrinsic conductivity is\",sigma,\"per ohm m\"\nprint \"intrinsic resistivity is\",rho,\"ohm m\"\nprint \"answers given in the book are wrong\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "intrinsic concentration is 1.02825111151e+19 per m**3\nintrinsic conductivity is 0.9872 per ohm m\nintrinsic resistivity is 1.013 ohm m\nanswers given in the book are wrong\n" + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.6, Page number 211" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nimport numpy as np\nfrom __future__ import division\n\n#Variable declaration\nNd = 10**16; #donor concentration(per cm**3)\nni = 1.45*10**10; #concentration(per cm**3)\nkT = 0.0259;\n\n#Calculation\n#ni = Nc*math.exp(-(Ec-Ei)/kT)\n#Nd = Nc*(math.exp(-(Ec-Efd)/kT)\n#dividing Nd/ni we get \nEFd_Ei = kT*np.log(Nd/ni);\nEFd_Ei = math.ceil(EFd_Ei*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint \"Fermi energy is\",EFd_Ei,\"eV\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Fermi energy is 0.3482 eV\n" + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.7, Page number 211, theoretical" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.8, Page number 212" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nimport numpy as np\nfrom __future__ import division\n\n#Variable declaration\nT = 300; #temperature(K)\nmew_n = 0.36; #electron mobility(m**2/Vs)\nmew_p = 0.17; #hole mobility(m**2/Vs)\nrho = 2.12; #resistivity(ohm m)\nme = 9.11*10**-31; #mass of electron(kg)\nkT = 0.0259;\nh = 6.625*10**-34;\nk = 1.38*10**-23; #boltzmann constant\ne = 1.6*10**-19; #charge of electron(C)\n\n#Calculation\nmn_star = 0.55*me; #electron effective mass(kg)\nmp_star = 0.37*me; #hole effective mass(kg)\nsigma = 1/rho; #conductivity(per ohm m)\nsigma = math.ceil(sigma*10**3)/10**3; #rounding off to 3 decimals\nni = sigma/(e*(mew_n+mew_p)); #concentration of electrons(per m**3)\na = (2*math.pi*kT/(h**2))**(3/2);\nNc = 2*a*(mn_star**(3/2)); \nNv = 2*a*(mp_star**(3/2)); \nb = (Nc*Nv)**(1/2);\nEg = 2*kT*np.log(b/ni);\n\n#Result\nprint \"forbidden energy gap is\",Eg,\"eV\"\nprint \"answer given in the book is wrong\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "forbidden energy gap is 4.09465494989 eV\nanswer given in the book is wrong\n" + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.9, Page number 213" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nni = 2.4*10**19; #concentration(per m**3)\nmew_n = 0.39; #electron mobility(m**2/Vs)\nmew_p = 0.19; #hole mobility(m**2/Vs)\ne = 1.6*10**-19; #charge of electron(C)\n\n#Calculation\nsigma = ni*e*(mew_n+mew_p); #conductivity(per ohm m)\nsigma = math.ceil(sigma*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"conductivity of sample is\",sigma,\"ohm-1 m-1\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "conductivity of sample is 2.228 ohm-1 m-1\n" + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.10, Page number 214" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nEc = 0.3; #initial position(eV)\nT1 = 300; #initial temperature(K)\nT2 = 330; #increased temperature\n\n#Calculation\n#Ec/T1 = Ec_EF330/T2\nEc_EF330 = Ec*T2/T1; #new position of Fermi level(eV)\n\n#Result\nprint \"new position of Fermi level is\",Ec_EF330,\"eV\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "new position of Fermi level is 0.33 eV\n" + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.11, Page number 214" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nk = 1.38*10**-23; #boltzmann constant\nT = 300; #temperature(K)\nme = 9.1*10**-31; #mass of electron(kg)\nh = 6.63*10**-34; #planck's constant\nEc_Ev = 1.1; #energy gap(eV)\ne = 1.6*10**-19; #charge of electron(C)\n\n#Calculation\nme_star = 0.31*me;\nA = (2*math.pi*k*T*me_star/(h**2))**(3/2);\nB = math.exp(-(Ec_Ev*e)/(2*k*T));\nni = A*B; #concentration in conduction band(per m**3)\n\n#Result\nprint \"intrinsic electron concentration is\",ni,\"per m**3\"\nprint \"answer given in the book is wrong\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "intrinsic electron concentration is 1.26605935487e+15 per m**3\nanswer given in the book is wrong\n" + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.12, Page number 214" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nRH = 0.55*10**-10; #Hall coefficient(m**3/As)\nsigma = 5.9*10**7; #conductivity(ohm-1 m-1)\n\n#Calculation\nmew = RH*sigma; #drift mobility(m**2/Vs)\nmew = mew*10**3;\nmew = math.ceil(mew*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint \"drift mobility of electrons is\",mew,\"*10**-3 m**2/Vs\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "drift mobility of electrons is 3.25 *10**-3 m**2/Vs\n" + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.13, Page number 215" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nA = 6.022*10**23; #avagadro constant\nd = 8.96*10**-9; #density(kg/m**3)\nn = 9.932*10**14; #no. of free electrons per atom\nsigma = 5.9*10**7; #conductivity(ohm-1 m-1)\ne = 1.6*10**-19; #electron charge(C)\nmew = 3.2*10**-3; #drift mobility(m**2/Vs)\nw = 63.5; #atomic weight of Cu(kg)\n\n#Calculation\nni = sigma/(mew*e); #conductivity(per m**3)\nN = A*d*n/w; #concentration of free electrons in pure Cu\nAN = ni/N; #average number of electrons contributed per Cu atom\n\n#Result\nprint \"concentration of free electrons in pure Cu is\",N,\"per m**3\"\nprint \"average number of electrons contributed per Cu atom is\",int(AN)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "concentration of free electrons in pure Cu is 8.43940339906e+28 per m**3\naverage number of electrons contributed per Cu atom is 1\n" + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.14, Page number 215" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nRH = 3.66*10**-11; #hall coefficient(m**3/As)\ne = 1.6*10**-19; #electron charge(C)\nsigma = 112*10**7; #conductivity(ohm-1 m-1)\n\n#Calculation\nn = 1/(e*RH); #charge carrier density(per m**3)\nmew_n = sigma/(n*e); #electron mobility(m**2/As)\nmew_n = math.ceil(mew_n*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"charge carrier density is\",n,\"per m**3\"\nprint \"electron mobility is\",mew_n,\"m**2/As\"\nprint \"answers given in the book are wrong\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "charge carrier density is 1.70765027322e+29 per m**3\nelectron mobility is 0.041 m**2/As\nanswers given in the book are wrong\n" + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.15, Page number 216" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\ne = 1.6*10**-19; #electron charge(C)\nB = 1.5; #magnetic field(T)\nI = 50; #current(Amp)\nn = 8.4*10**28; #free electron concentration(per m**3)\nd = 0.2; #thickness of slab(cm)\n\n#Calculation\nd = d*10**-2; #thickness of slab(m)\nVH = B*I/(n*e*d); #hall voltage(V)\n\n#Result\nprint \"magnitude of Hall voltage is\",VH,\"V\"\nprint \"answer given in the book is wrong\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "magnitude of Hall voltage is 2.79017857143e-06 V\nanswer given in the book is wrong\n" + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.16, Page number 216" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\ne = 1.6*10**-19; #electron charge(C)\nn = 2.5*10**19; #free electron concentration(per m**3)\nmew_n = 0.39; #electron mobility(m**2/Vs)\nmew_p = 0.19; #hole mobility(m**2/Vs)\nL = 1; #length(cm)\nw = 1; #width(mm)\nt = 1; #thickness(mm)\n\n#Calculation\nL = L*10**-2; #length(m)\nw = w*10**-3; #width(m)\nt = t*10**-3; #thickness(m)\nA = w*t; #area(m**2)\nsigma = n*e*(mew_n+mew_p); #conductivity(ohm-1 m-1)\nR = L/(sigma*A); #resistance(ohm)\n\n#Result\nprint \"resistance of intrinsic Ge rod is\",int(R),\"ohm\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "resistance of intrinsic Ge rod is 4310 ohm\n" + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.17, Page number 216" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nimport numpy as np\nfrom __future__ import division\n\n#Variable declaration\ne = 1.6*10**-19; #electron charge(C)\nEg = 1.12; #band gap(eV)\nme = 1;\nmn_star = 0.12*me; #electron mobility(m**2/Vs)\nmp_star = 0.28*me; #hole mobility(m**2/Vs)\nk = 1.38*10**-23; #boltzmann constant\nT = 300; #temperature\n\n#Calculation\na = mp_star/mn_star;\nEF = (Eg/2)+((3*k*T/(4*e))*np.log(a));\nEF = math.ceil(EF*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"position of Fermi level is\",EF,\"eV\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "position of Fermi level is 0.577 eV\n" + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.18, Page number 217" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\ne = 1.6*10**-19; #electron charge(C)\nni = 1.5*10**16; #intrinsic carrier density(per m**3)\nmew_n = 0.13; #electron mobility(m**2/Vs)\nmew_p = 0.05; #hole mobility(m**2/Vs)\n\n#Calculation\nsigma = ni*e*(mew_n+mew_p); #electrical conductivity\nsigma = sigma*10**4;\n\n#Result\nprint \"electrical conductivity is\",sigma,\"*10**-4 ohm-1 m-1\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "electrical conductivity is 4.32 *10**-4 ohm-1 m-1\n" + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.19, Page number 217" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\ne = 1.6*10**-19; #electron charge(C)\nni = 2.15*10**-13; #intrinsic carrier density(per cm**3)\nmew_n = 3900; #electron mobility(cm**2/Vs)\nmew_p = 1900; #hole mobility(cm**2/Vs)\n\n#Calculation\nsigmai = ni*e*(mew_n+mew_p); #electrical conductivity(ohm-1 cm-1)\nrhoi = 1/sigmai; #intrinsic resistivity(ohm cm)\n\n#Result\nprint \"intrinsic resistivity is\",rhoi,\"ohm cm\"\nprint \"answer given in the book is wrong\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "intrinsic resistivity is 5.01202886929e+27 ohm cm\nanswer given in the book is wrong\n" + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.20, Page number 217" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\ne = 1.6*10**-19; #electron charge(C)\nni = 2.1*10**19; #intrinsic carrier density(per m**3)\nmew_n = 0.4; #electron mobility(m**2/Vs)\nmew_p = 0.2; #hole mobility(m**2/Vs)\n\n#Calculation\nsigma = ni*e*(mew_n+mew_p); #electrical conductivity\n\n#Result\nprint \"intrinsic resistivity is\",sigma,\"ohm-1 m-1\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "intrinsic resistivity is 2.016 ohm-1 m-1\n" + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.21, Page number 218" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\ne = 1.6*10**-19; #electron charge(C)\nV = 1.35; #voltage supply(V)\nI = 5; #current(mA)\nb = 5; #breadth(mm)\nd = 1; #thickness(mm)\nL = 1; #length(cm)\nH = 0.45; #magnetic field(Wb/m**2)\nVy =20; #Hall voltage(mV)\n\n#Calculation\nVy = Vy*10**-3; #Hall voltage(V)\nL = L*10**-2; #length(m)\nd = d*10**-3; #thickness(m)\nb = b*10**-3; #breadth(m)\nI = I*10**-3; #current(A)\nR = V/I; #resistance(ohm)\nA = b*d; #area(m**2)\nrho = R*A/L; #resistivity(ohm m)\nEy = Vy/d; #Hall field(V/m)\nJx = I/A; \na = Ey/(H*Jx); #current density(m**3/C).Here a is 1/ne \nRH = a; #Hall coefficient(m**3/C)\nRH = math.ceil(RH*10**4)/10**4; #rounding off to 4 decimals\nmew_n = RH/rho; #electron mobility(m**2/Vs)\nmew_n = math.ceil(mew_n*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint \"Hall coefficient is\",RH,\"m**3/C\"\nprint \"electron mobility is\",mew_n,\"m**2/Vs\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Hall coefficient is 0.0445 m**3/C\nelectron mobility is 0.33 m**2/Vs\n" + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.22, Page number 219" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\ne = 1.6*10**-19; #electron charge(C)\nIx = 200; #current(A)\nBz = 1.5; #magnetic field(Wb/m**2)\np = 8.4*10**28; #electron concentration(per m**3)\nd = 1; #thickness(mm)\n\n#Calculation\nd = d*10**-3; #thickness(m)\nVH = Ix*Bz/(e*p*d); #Hall potential(V)\nVH = VH*10**6; #Hall potential(micro V)\n\n#Result\nprint \"Hall potential is\",int(VH),\"micro V\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Hall potential is 22 micro V\n" + } + ], + "prompt_number": 22 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Engineering_Physics/Chapter7_1.ipynb b/Engineering_Physics/Chapter7_1.ipynb index cd558c19..d6a7ab3d 100755 --- a/Engineering_Physics/Chapter7_1.ipynb +++ b/Engineering_Physics/Chapter7_1.ipynb @@ -1,7 +1,7 @@ { "metadata": { - "name": "", - "signature": "sha256:7187247d22d4e816cffb8e16cb739591c46b8ff453a1af7a76514de7cc4fae35" + "name": "Chapter7", + "signature": "sha256:043709ddd748250fcd3232cc251c6d71d665f281189e172a4c8d9b59233bdcee" }, "nbformat": 3, "nbformat_minor": 0, @@ -12,48 +12,25 @@ "cell_type": "heading", "level": 1, "metadata": {}, - "source": [ - "7: Superconductivity" - ] + "source": "7: Semiconducting Materials" }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 7.1, Page number 152" - ] + "source": "Example number 7.1, Page number 208" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "from __future__ import division\n", - "import math\n", - "\n", - "#Variable declaration\n", - "Tc=3.722; #critical temperature(K)\n", - "T=2; #temperature(K)\n", - "Bc_0=0.0305; #critical field(T)\n", - "\n", - "#Calculation\n", - "Bc_T=Bc_0*(1-(T/Tc)**2); #critical field at 2K(T)\n", - "Bc_T = math.ceil(Bc_T*10**4)/10**4; #rounding off the value of Bc_T to 4 decimals\n", - "\n", - "#Result\n", - "print \"The critical field at 2K is\",Bc_T, \"T\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nme = 9.11*10**-31; #mass of electron(kg)\nepsilon_r = 13.2; \nepsilon0 = 8.85*10**-12;\nh = 6.63*10**-34;\ne = 1.6*10**-19; #charge of electron(C)\n\n#Calculation\nm_nc = 0.067*me;\nE = m_nc*e**4/(8*(epsilon0*epsilon_r*h)**2); #energy(J)\nE = E/e; #energy(eV)\nE = math.ceil(E*10**5)/10**5; #rounding off to 5 decimals\nE_meV = E*10**3; #energy(meV)\n\n#Result\nprint \"donor binding energy is\",E,\"eV or\",E_meV,\"meV\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The critical field at 2K is 0.0217 T\n" - ] + "text": "donor binding energy is 0.00521 eV or 5.21 meV\n" } ], "prompt_number": 1 @@ -62,42 +39,19 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 7.2, Page number 152" - ] + "source": "Example number 7.2, Page number 208" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "from __future__ import division\n", - "import math\n", - "\n", - "#Variable declaration\n", - "V = 1; #DC voltage applied across the Josephson junction(micro-volt)\n", - "e = 1.6*10**-19; #Charge on an electron(C)\n", - "h = 6.626*10**-34; #Planck's constant(Js)\n", - "\n", - "#Calculation\n", - "V = V*10**-6; #DC voltage applied across the Josephson junction(V)\n", - "f = 2*e*V/h; #Frequency of Josephson current(Hz)\n", - "f = f*10**-6; #Frequency of Josephson current(MHz)\n", - "f = math.ceil(f*10**2)/10**2; #rounding off the value of f to 2 decimals\n", - "\n", - "#Result\n", - "print \"The frequency of Josephson current is\",f, \"MHz\"" - ], + "input": "#importing modules\nimport math\nimport numpy as np\n\n#Variable declaration\nNd = 10**16; #donor concentration(atoms/cm**3)\nni = 1.5*10**10; #concentration(per cm**3)\nT = 300; #temperature(K)\nkT = 0.0259;\n\n#Calculation\nn0 = Nd; #for Nd>>ni, assume n0=Nd\np0 = ni**2/n0; #equilibrium hole concentration(per cm**3)\np0 = p0*10**-4;\nEF_Ei = kT*np.log(n0/ni);\nEF_Ei = math.ceil(EF_Ei*10**4)/10**4; #rounding off to 4 decimals\n\n\n#Result\nprint \"equilibrium hole concentration is\",p0,\"*10**4 per cm**3\"\nprint \"value of EF-Ei is\",EF_Ei,\"eV\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The frequency of Josephson current is 482.95 MHz\n" - ] + "text": "equilibrium hole concentration is 2.25 *10**4 per cm**3\nvalue of EF-Ei is 0.3474 eV\n" } ], "prompt_number": 2 @@ -106,41 +60,109 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 7.3, Page number 152" - ] + "source": "Example number 7.3, Page number 209" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\ne = 1.6*10**-19; #charge of electron(C)\nNd = 10**14; #donor density(atoms/cm**3)\nmew_n = 3900;\n\n#Calculation\nn = Nd;\nsigma = n*e*mew_n; #conductivity(ohm-1 cm-1)\nrho = 1/sigma; #resistivity(ohm cm)\nrho = math.ceil(rho*100)/100; #rounding off to 2 decimals\n\n\n#Result\nprint \"resistivity of sample is\",rho,\"ohm cm\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "resistivity of sample is 16.03 ohm cm\n" + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.4, Page number 209" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\ne = 1.6*10**-19; #charge of electron(C)\nn0 = 5*10**16; #donor density(atoms/cm**3)\nmew_0 = 800;\nIx = 2; #current(mA)\nBz = 5*10**-5;\nd = 200; #thickness(micrometre)\n\n#Calculation\nIx = Ix*10**-3; #current(A)\nd = d*10**-4; #thickness(m)\nsigma = e*n0*mew_0; #conductivity(ohm-1 cm-1)\nrho = 1/sigma; #resistivity(ohm cm)\nrho = math.ceil(rho*10**4)/10**4; #rounding off to 4 decimals\nRH = -1/(e*n0); #Hall coefficient(cm**3/C)\nVH = Ix*Bz*RH/d; #Hall voltage(V)\nVH = VH*10**5;\n\n\n#Result\nprint \"resistivity of sample is\",rho,\"ohm cm\"\nprint \"Hall coefficient is\",RH,\"cm**3/C\"\nprint \"Hall voltage is\",VH,\"*10**-5 V\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "resistivity of sample is 0.1563 ohm cm\nHall coefficient is -125.0 cm**3/C\nHall voltage is -62.5 *10**-5 V\n" + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.5, Page number 210" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "from __future__ import division\n", - "import math\n", - "\n", - "#Variable declaration\n", - "T_c = 0.517; #Critical temperature for cadmium(K)\n", - "k = 1.38*10**-23; #Boltzmann constant(J/K)\n", - "e = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\n", - "\n", - "#Calculation\n", - "E_g = 3.5*k*T_c/e; #Superconducting energy gap at absolute zero(eV)\n", - "E_g = E_g*10**4;\n", - "E_g = math.ceil(E_g*10**3)/10**3; #rounding off the value of E_g to 3 decimals\n", - "\n", - "#Result\n", - "print \"The superconducting energy gap for Cd at absolute zero is\",E_g,\"*10**-4 eV\"" + "input": "#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nT = 300; #temperature(K)\nmew_n = 0.4; #electron mobility(m**2/Vs)\nmew_p = 0.2; #hole mobility(m**2/Vs)\nEg = 0.7; #band gap(eV)\nme = 9.11*10**-31; #mass of electron(kg)\nk = 1.38*10**-23; #boltzmann constant\nT = 300; #temperature(K)\nh = 6.625*10**-34;\nkT = 0.0259;\ne = 1.6*10**-19; #charge of electron(C)\n\n#Calculation\nmn_star = 0.55*me; #electron effective mass(kg)\nmp_star = 0.37*me; #hole effective mass(kg)\na = (2*math.pi*k*T/(h**2))**(3/2);\nb = (mn_star*mp_star)**(3/4);\nc = math.exp(-Eg/(2*kT));\nni = 2*a*b*c; #intrinsic concentration(per m**3)\nsigma = ni*e*(mew_n+mew_p); #intrinsic conductivity(per ohm m)\nsigma = math.ceil(sigma*10**4)/10**4; #rounding off to 4 decimals\nrho = 1/sigma; #intrinsic resistivity(ohm m)\nrho = math.ceil(rho*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint \"intrinsic concentration is\",ni,\"per m**3\"\nprint \"intrinsic conductivity is\",sigma,\"per ohm m\"\nprint \"intrinsic resistivity is\",rho,\"ohm m\"\nprint \"answers given in the book are wrong\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "intrinsic concentration is 1.02825111151e+19 per m**3\nintrinsic conductivity is 0.9872 per ohm m\nintrinsic resistivity is 1.013 ohm m\nanswers given in the book are wrong\n" + } ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.6, Page number 211" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nimport numpy as np\nfrom __future__ import division\n\n#Variable declaration\nNd = 10**16; #donor concentration(per cm**3)\nni = 1.45*10**10; #concentration(per cm**3)\nkT = 0.0259;\n\n#Calculation\n#ni = Nc*math.exp(-(Ec-Ei)/kT)\n#Nd = Nc*(math.exp(-(Ec-Efd)/kT)\n#dividing Nd/ni we get \nEFd_Ei = kT*np.log(Nd/ni);\nEFd_Ei = math.ceil(EFd_Ei*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint \"Fermi energy is\",EFd_Ei,\"eV\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The superconducting energy gap for Cd at absolute zero is 1.561 *10**-4 eV\n" - ] + "text": "Fermi energy is 0.3482 eV\n" + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.7, Page number 211, theoretical" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.8, Page number 212" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nimport numpy as np\nfrom __future__ import division\n\n#Variable declaration\nT = 300; #temperature(K)\nmew_n = 0.36; #electron mobility(m**2/Vs)\nmew_p = 0.17; #hole mobility(m**2/Vs)\nrho = 2.12; #resistivity(ohm m)\nme = 9.11*10**-31; #mass of electron(kg)\nkT = 0.0259;\nh = 6.625*10**-34;\nk = 1.38*10**-23; #boltzmann constant\ne = 1.6*10**-19; #charge of electron(C)\n\n#Calculation\nmn_star = 0.55*me; #electron effective mass(kg)\nmp_star = 0.37*me; #hole effective mass(kg)\nsigma = 1/rho; #conductivity(per ohm m)\nsigma = math.ceil(sigma*10**3)/10**3; #rounding off to 3 decimals\nni = sigma/(e*(mew_n+mew_p)); #concentration of electrons(per m**3)\na = (2*math.pi*kT/(h**2))**(3/2);\nNc = 2*a*(mn_star**(3/2)); \nNv = 2*a*(mp_star**(3/2)); \nb = (Nc*Nv)**(1/2);\nEg = 2*kT*np.log(b/ni);\n\n#Result\nprint \"forbidden energy gap is\",Eg,\"eV\"\nprint \"answer given in the book is wrong\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "forbidden energy gap is 4.09465494989 eV\nanswer given in the book is wrong\n" } ], "prompt_number": 8 @@ -149,84 +171,103 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 7.4, Page number 152" - ] + "source": "Example number 7.9, Page number 213" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "from __future__ import division\n", - "import math\n", - "\n", - "#Variable declaration\n", - "e = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\n", - "c = 3*10**8; #Speed of light in free space(m/s)\n", - "h = 6.626*10**-34; #Planck's constant(Js)\n", - "E_g = 1.5*10**-4; #Superconducting energy gap for a material(eV)\n", - "\n", - "#Calculation\n", - "#As E_g = h*new = h*c/lamda, solving for lambda\n", - "lamda = h*c/(E_g*e); #Wavelength of photon to break up a Cooper-pair(m)\n", - "lamda = lamda*10**3;\n", - "lamda = math.ceil(lamda*10**3)/10**3; #rounding off the value of lamda to 3 decimals\n", - "\n", - "#Result\n", - "print \"The wavelength of photon to break up a Cooper-pair is\",lamda,\"*10**-3 m\"" + "input": "#importing modules\nimport math\n\n#Variable declaration\nni = 2.4*10**19; #concentration(per m**3)\nmew_n = 0.39; #electron mobility(m**2/Vs)\nmew_p = 0.19; #hole mobility(m**2/Vs)\ne = 1.6*10**-19; #charge of electron(C)\n\n#Calculation\nsigma = ni*e*(mew_n+mew_p); #conductivity(per ohm m)\nsigma = math.ceil(sigma*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"conductivity of sample is\",sigma,\"ohm-1 m-1\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "conductivity of sample is 2.228 ohm-1 m-1\n" + } ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.10, Page number 214" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nEc = 0.3; #initial position(eV)\nT1 = 300; #initial temperature(K)\nT2 = 330; #increased temperature\n\n#Calculation\n#Ec/T1 = Ec_EF330/T2\nEc_EF330 = Ec*T2/T1; #new position of Fermi level(eV)\n\n#Result\nprint \"new position of Fermi level is\",Ec_EF330,\"eV\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The wavelength of photon to break up a Cooper-pair is 8.283 *10**-3 m\n" - ] + "text": "new position of Fermi level is 0.33 eV\n" } ], - "prompt_number": 12 + "prompt_number": 10 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 7.5, Page number 153" - ] + "source": "Example number 7.11, Page number 214" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "from __future__ import division\n", - "import math\n", - "\n", - "#Variable declaration\n", - "lambda_0 = 37; #Penetration depth of lead at 0 kelvin(nm)\n", - "T_c = 7.193; #Critical temperature of superconducting transition for lead(kelvin)\n", - "T = 5.2; #Temperature at which penetration depth for lead becomes lambda_T(kelvin) \n", - "\n", - "#Calculation\n", - "lambda_T = lambda_0*(1-(T/T_c)**4)**(-1/2); #Penetration depth of lead at 5.2 kelvin(nm)\n", - "lambda_T = math.ceil(lambda_T*10)/10; #rounding off the value of lamda_T to 1 decimal\n", - "\n", - "#Result\n", - "print \"The penetration depth of lead is\",lambda_T, \"nm\"" + "input": "#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nk = 1.38*10**-23; #boltzmann constant\nT = 300; #temperature(K)\nme = 9.1*10**-31; #mass of electron(kg)\nh = 6.63*10**-34; #planck's constant\nEc_Ev = 1.1; #energy gap(eV)\ne = 1.6*10**-19; #charge of electron(C)\n\n#Calculation\nme_star = 0.31*me;\nA = (2*math.pi*k*T*me_star/(h**2))**(3/2);\nB = math.exp(-(Ec_Ev*e)/(2*k*T));\nni = A*B; #concentration in conduction band(per m**3)\n\n#Result\nprint \"intrinsic electron concentration is\",ni,\"per m**3\"\nprint \"answer given in the book is wrong\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "intrinsic electron concentration is 1.26605935487e+15 per m**3\nanswer given in the book is wrong\n" + } ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.12, Page number 214" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nRH = 0.55*10**-10; #Hall coefficient(m**3/As)\nsigma = 5.9*10**7; #conductivity(ohm-1 m-1)\n\n#Calculation\nmew = RH*sigma; #drift mobility(m**2/Vs)\nmew = mew*10**3;\nmew = math.ceil(mew*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint \"drift mobility of electrons is\",mew,\"*10**-3 m**2/Vs\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The penetration depth of lead is 43.4 nm\n" - ] + "text": "drift mobility of electrons is 3.25 *10**-3 m**2/Vs\n" + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.13, Page number 215" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nA = 6.022*10**23; #avagadro constant\nd = 8.96*10**-9; #density(kg/m**3)\nn = 9.932*10**14; #no. of free electrons per atom\nsigma = 5.9*10**7; #conductivity(ohm-1 m-1)\ne = 1.6*10**-19; #electron charge(C)\nmew = 3.2*10**-3; #drift mobility(m**2/Vs)\nw = 63.5; #atomic weight of Cu(kg)\n\n#Calculation\nni = sigma/(mew*e); #conductivity(per m**3)\nN = A*d*n/w; #concentration of free electrons in pure Cu\nAN = ni/N; #average number of electrons contributed per Cu atom\n\n#Result\nprint \"concentration of free electrons in pure Cu is\",N,\"per m**3\"\nprint \"average number of electrons contributed per Cu atom is\",int(AN)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "concentration of free electrons in pure Cu is 8.43940339906e+28 per m**3\naverage number of electrons contributed per Cu atom is 1\n" } ], "prompt_number": 13 @@ -235,52 +276,190 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 7.6, Page number 153" - ] + "source": "Example number 7.14, Page number 215" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nRH = 3.66*10**-11; #hall coefficient(m**3/As)\ne = 1.6*10**-19; #electron charge(C)\nsigma = 112*10**7; #conductivity(ohm-1 m-1)\n\n#Calculation\nn = 1/(e*RH); #charge carrier density(per m**3)\nmew_n = sigma/(n*e); #electron mobility(m**2/As)\nmew_n = math.ceil(mew_n*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"charge carrier density is\",n,\"per m**3\"\nprint \"electron mobility is\",mew_n,\"m**2/As\"\nprint \"answers given in the book are wrong\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "charge carrier density is 1.70765027322e+29 per m**3\nelectron mobility is 0.041 m**2/As\nanswers given in the book are wrong\n" + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.15, Page number 216" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "from __future__ import division\n", - "import math\n", - "\n", - "#Variable declaration\n", - "M1 = 199; #Mass of an isotope of mercury(amu)\n", - "T_C1 = 4.185; #Transition temperature of the isoptope of Hg(K)\n", - "T_C2 = 4.153; #Transition temperature of another isoptope of Hg(K)\n", - "alpha = 0.5; #Isotope coefficient\n", - "\n", - "#Calculation\n", - "M2 = M1*(T_C1/T_C2)**(1/alpha); #Mass of another isotope of mercury(amu)\n", - "M2 = math.ceil(M2*100)/100; #rounding off the value of M2 to 2 decimals\n", - "\n", - "#Result\n", - "print \"The mass of another isotope of mercury is\",M2, \"amu\"" + "input": "#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\ne = 1.6*10**-19; #electron charge(C)\nB = 1.5; #magnetic field(T)\nI = 50; #current(Amp)\nn = 8.4*10**28; #free electron concentration(per m**3)\nd = 0.2; #thickness of slab(cm)\n\n#Calculation\nd = d*10**-2; #thickness of slab(m)\nVH = B*I/(n*e*d); #hall voltage(V)\n\n#Result\nprint \"magnitude of Hall voltage is\",VH,\"V\"\nprint \"answer given in the book is wrong\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "magnitude of Hall voltage is 2.79017857143e-06 V\nanswer given in the book is wrong\n" + } ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.16, Page number 216" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\ne = 1.6*10**-19; #electron charge(C)\nn = 2.5*10**19; #free electron concentration(per m**3)\nmew_n = 0.39; #electron mobility(m**2/Vs)\nmew_p = 0.19; #hole mobility(m**2/Vs)\nL = 1; #length(cm)\nw = 1; #width(mm)\nt = 1; #thickness(mm)\n\n#Calculation\nL = L*10**-2; #length(m)\nw = w*10**-3; #width(m)\nt = t*10**-3; #thickness(m)\nA = w*t; #area(m**2)\nsigma = n*e*(mew_n+mew_p); #conductivity(ohm-1 m-1)\nR = L/(sigma*A); #resistance(ohm)\n\n#Result\nprint \"resistance of intrinsic Ge rod is\",int(R),\"ohm\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The mass of another isotope of mercury is 202.08 amu\n" - ] + "text": "resistance of intrinsic Ge rod is 4310 ohm\n" } ], "prompt_number": 16 }, { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.17, Page number 216" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nimport numpy as np\nfrom __future__ import division\n\n#Variable declaration\ne = 1.6*10**-19; #electron charge(C)\nEg = 1.12; #band gap(eV)\nme = 1;\nmn_star = 0.12*me; #electron mobility(m**2/Vs)\nmp_star = 0.28*me; #hole mobility(m**2/Vs)\nk = 1.38*10**-23; #boltzmann constant\nT = 300; #temperature\n\n#Calculation\na = mp_star/mn_star;\nEF = (Eg/2)+((3*k*T/(4*e))*np.log(a));\nEF = math.ceil(EF*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"position of Fermi level is\",EF,\"eV\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "position of Fermi level is 0.577 eV\n" + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.18, Page number 217" + }, + { "cell_type": "code", "collapsed": false, - "input": [], + "input": "#importing modules\nimport math\n\n#Variable declaration\ne = 1.6*10**-19; #electron charge(C)\nni = 1.5*10**16; #intrinsic carrier density(per m**3)\nmew_n = 0.13; #electron mobility(m**2/Vs)\nmew_p = 0.05; #hole mobility(m**2/Vs)\n\n#Calculation\nsigma = ni*e*(mew_n+mew_p); #electrical conductivity\nsigma = sigma*10**4;\n\n#Result\nprint \"electrical conductivity is\",sigma,\"*10**-4 ohm-1 m-1\"", "language": "python", "metadata": {}, - "outputs": [] + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "electrical conductivity is 4.32 *10**-4 ohm-1 m-1\n" + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.19, Page number 217" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\ne = 1.6*10**-19; #electron charge(C)\nni = 2.15*10**-13; #intrinsic carrier density(per cm**3)\nmew_n = 3900; #electron mobility(cm**2/Vs)\nmew_p = 1900; #hole mobility(cm**2/Vs)\n\n#Calculation\nsigmai = ni*e*(mew_n+mew_p); #electrical conductivity(ohm-1 cm-1)\nrhoi = 1/sigmai; #intrinsic resistivity(ohm cm)\n\n#Result\nprint \"intrinsic resistivity is\",rhoi,\"ohm cm\"\nprint \"answer given in the book is wrong\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "intrinsic resistivity is 5.01202886929e+27 ohm cm\nanswer given in the book is wrong\n" + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.20, Page number 217" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\ne = 1.6*10**-19; #electron charge(C)\nni = 2.1*10**19; #intrinsic carrier density(per m**3)\nmew_n = 0.4; #electron mobility(m**2/Vs)\nmew_p = 0.2; #hole mobility(m**2/Vs)\n\n#Calculation\nsigma = ni*e*(mew_n+mew_p); #electrical conductivity\n\n#Result\nprint \"intrinsic resistivity is\",sigma,\"ohm-1 m-1\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "intrinsic resistivity is 2.016 ohm-1 m-1\n" + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.21, Page number 218" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\ne = 1.6*10**-19; #electron charge(C)\nV = 1.35; #voltage supply(V)\nI = 5; #current(mA)\nb = 5; #breadth(mm)\nd = 1; #thickness(mm)\nL = 1; #length(cm)\nH = 0.45; #magnetic field(Wb/m**2)\nVy =20; #Hall voltage(mV)\n\n#Calculation\nVy = Vy*10**-3; #Hall voltage(V)\nL = L*10**-2; #length(m)\nd = d*10**-3; #thickness(m)\nb = b*10**-3; #breadth(m)\nI = I*10**-3; #current(A)\nR = V/I; #resistance(ohm)\nA = b*d; #area(m**2)\nrho = R*A/L; #resistivity(ohm m)\nEy = Vy/d; #Hall field(V/m)\nJx = I/A; \na = Ey/(H*Jx); #current density(m**3/C).Here a is 1/ne \nRH = a; #Hall coefficient(m**3/C)\nRH = math.ceil(RH*10**4)/10**4; #rounding off to 4 decimals\nmew_n = RH/rho; #electron mobility(m**2/Vs)\nmew_n = math.ceil(mew_n*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint \"Hall coefficient is\",RH,\"m**3/C\"\nprint \"electron mobility is\",mew_n,\"m**2/Vs\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Hall coefficient is 0.0445 m**3/C\nelectron mobility is 0.33 m**2/Vs\n" + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 7.22, Page number 219" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\ne = 1.6*10**-19; #electron charge(C)\nIx = 200; #current(A)\nBz = 1.5; #magnetic field(Wb/m**2)\np = 8.4*10**28; #electron concentration(per m**3)\nd = 1; #thickness(mm)\n\n#Calculation\nd = d*10**-3; #thickness(m)\nVH = Ix*Bz/(e*p*d); #Hall potential(V)\nVH = VH*10**6; #Hall potential(micro V)\n\n#Result\nprint \"Hall potential is\",int(VH),\"micro V\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Hall potential is 22 micro V\n" + } + ], + "prompt_number": 22 } ], "metadata": {} diff --git a/Engineering_Physics/Chapter8.ipynb b/Engineering_Physics/Chapter8.ipynb new file mode 100755 index 00000000..54d83b1d --- /dev/null +++ b/Engineering_Physics/Chapter8.ipynb @@ -0,0 +1,125 @@ +{ + "metadata": { + "name": "Chapter8" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": "8: Magnetic Materials" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 8.1, Page number 238" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nI = 12; #current(Ampere)\nA = 7.5*10**-4 #area of loop(m**2)\n\n#Calculation\nM = I*A; #magnetic moment(Am**2)\nM = M*10**3;\n\n#Result\nprint \"magnetic moment is\",M,\"*10**-3 Am**2\"\nprint \"magnetic moment is in opposite direction from the observer\"\nprint \"M is perpendicular to the plane\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "magnetic moment is 9.0 *10**-3 Am**2\nmagnetic moment is in opposite direction from the observer\nM is perpendicular to the plane\n" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 8.2, Page number 238" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nr = 0.5; #radius of orbit(Angstrom)\ne = 1.6*10**-19; #charge of electron(C)\nnew = 10**16; #frequency(rps)\n\n#Calculation\nr = r*10**-10; #radius of orbit(m)\nI = e*new; #current(Ampere)\nA = math.pi*r**2; #area enclosed(m**2)\nM = I*A; #magnetic moment(Am**2)\n\n#Result\nprint \"magnetic moment is\",M,\"Am**2\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "magnetic moment is 1.25663706144e-23 Am**2\n" + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 8.3, Page number 239" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nmew_r = 5000; #relative permeability\n\n#Calculation\nchi_m = mew_r-1; #magnetic susceptibility\n\n#Result\nprint \"magnetic susceptibility is\",chi_m", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "magnetic susceptibility is 4999\n" + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 8.4, Page number 239" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nH = 1800; #magnetic field(A/m)\nphi = 3*10**-5; #magnetic flux(Wb)\nA = 0.2; #cross sectional area(cm**2)\n\n#Calculation\nA = A*10**-4; #cross sectional area(m**2)\nB = phi/A; #magnetic flux density(Wb/m**2)\nmew = B/H; #permeability(H/m)\nmew = mew*10**4;\nmew=math.ceil(mew*100)/100; #rounding off to 2 decimals\n\n#Result\nprint \"permeability is\",mew,\"*10**-4 H/m\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "permeability is 8.34 *10**-4 H/m\n" + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 8.5, Page number 239" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nB = 0.65; #magnetic induction(Wb/m**2)\nrho = 8906; #density(kg/m**3)\nM = 58.7; #atomic weight\nmew0 = 4*math.pi*10**-7;\nmb = 9.27*10**-24;\nNa = 6.023*10**26; #avagadro constant\n\n#Calculation\nN = rho*Na/M; #number of atoms per unit volume(atoms/m**3)\nmew_r = B/(N*mew0); #relative permeability(A/m**2)\nM = mew_r/mb; #magnetic moment in mew_B \nM=math.ceil(M*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"magnetic moment is\",M,\"mew_B\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "magnetic moment is 0.611 mew_B\n" + } + ], + "prompt_number": 5 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Engineering_Physics/Chapter8_1.ipynb b/Engineering_Physics/Chapter8_1.ipynb index 809f0bc8..54d83b1d 100755 --- a/Engineering_Physics/Chapter8_1.ipynb +++ b/Engineering_Physics/Chapter8_1.ipynb @@ -1,7 +1,6 @@ { "metadata": { - "name": "", - "signature": "sha256:6cf74f56ec30435213713191af54de81cab98f4f30811b6d81fe0fb6a9021553" + "name": "Chapter8" }, "nbformat": 3, "nbformat_minor": 0, @@ -12,49 +11,25 @@ "cell_type": "heading", "level": 1, "metadata": {}, - "source": [ - "8: Special Theory of Relativity" - ] + "source": "8: Magnetic Materials" }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 8.1, Page number 171" - ] + "source": "Example number 8.1, Page number 238" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "L_0 = 1; #For simplicity, we assume classical length to be unity(m)\n", - "c = 1; #For simplicity assume speed of light to be unity(m/s)\n", - "\n", - "#Calculation\n", - "L = (1-1/100)*L_0; #Relativistic length(m)\n", - "#Relativistic length contraction gives L = L_0*sqrt(1-v^2/c^2), solving for v\n", - "v = math.sqrt(1-(L/L_0)**2)*c; #Speed at which relativistic length is 1 percent of the classical length(m/s)\n", - "v = math.ceil(v*10**4)/10**4; #rounding off the value of v to 4 decimals\n", - "\n", - "#Result\n", - "print \"The speed at which relativistic length is 1 percent of the classical length is\",v, \"c\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nI = 12; #current(Ampere)\nA = 7.5*10**-4 #area of loop(m**2)\n\n#Calculation\nM = I*A; #magnetic moment(Am**2)\nM = M*10**3;\n\n#Result\nprint \"magnetic moment is\",M,\"*10**-3 Am**2\"\nprint \"magnetic moment is in opposite direction from the observer\"\nprint \"M is perpendicular to the plane\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The speed at which relativistic length is 1 percent of the classical length is 0.1411 c\n" - ] + "text": "magnetic moment is 9.0 *10**-3 Am**2\nmagnetic moment is in opposite direction from the observer\nM is perpendicular to the plane\n" } ], "prompt_number": 1 @@ -63,39 +38,19 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 8.2, Page number 171" - ] + "source": "Example number 8.2, Page number 238" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "c = 1; #For simplicity assume speed of light to be unity(m/s)\n", - "delta_t = 5*10**-6; #Mean lifetime of particles as observed in the lab frame(s)\n", - "\n", - "#Calculation\n", - "v = 0.9*c; #Speed at which beam of particles travel(m/s)\n", - "delta_tau = delta_t*math.sqrt(1-(v/c)**2); #Proper lifetime of particle as per Time Dilation rule(s)\n", - "\n", - "#Result\n", - "print \"The proper lifetime of particle is\",delta_tau, \"s\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nr = 0.5; #radius of orbit(Angstrom)\ne = 1.6*10**-19; #charge of electron(C)\nnew = 10**16; #frequency(rps)\n\n#Calculation\nr = r*10**-10; #radius of orbit(m)\nI = e*new; #current(Ampere)\nA = math.pi*r**2; #area enclosed(m**2)\nM = I*A; #magnetic moment(Am**2)\n\n#Result\nprint \"magnetic moment is\",M,\"Am**2\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The proper lifetime of particle is 2.17944947177e-06 s\n" - ] + "text": "magnetic moment is 1.25663706144e-23 Am**2\n" } ], "prompt_number": 2 @@ -104,549 +59,64 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 8.3, Page number 171. theoritical proof" - ] - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 8.4, Page number 172" - ] + "source": "Example number 8.3, Page number 239" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "c = 1; #For simplicity assume speed of light to be unity(m/s)\n", - "\n", - "#Calculation\n", - "v = 0.6*c; #Speed with which the rocket leaves the earth(m/s)\n", - "u_prime = 0.9*c; #Relative speed of second rocket w.r.t. the first rocket(m/s)\n", - "u1 = (u_prime+v)/(1+(u_prime*v)/c**2); #Speed of second rocket for same direction of firing as per Velocity Addition Rule(m/s)\n", - "u1 = math.ceil(u1*10**4)/10**4; #rounding off the value of u1 to 4 decimals\n", - "u2 = (-u_prime+v)/(1-(u_prime*v)/c**2); #Speed of second rocket for opposite direction of firing as per Velocity Addition Rule(m/s)\n", - "u2 = math.ceil(u2*10**4)/10**4; #rounding off the value of u2 to 4 decimals\n", - "\n", - "#Result\n", - "print \"The speed of second rocket for same direction of firing is\",u1,\"c\"\n", - "print \"The speed of second rocket for opposite direction of firing is\",u2,\"c\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nmew_r = 5000; #relative permeability\n\n#Calculation\nchi_m = mew_r-1; #magnetic susceptibility\n\n#Result\nprint \"magnetic susceptibility is\",chi_m", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The speed of second rocket for same direction of firing is 0.9741 c\n", - "The speed of second rocket for opposite direction of firing is -0.6521 c\n" - ] + "text": "magnetic susceptibility is 4999\n" } ], - "prompt_number": 4 + "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 8.5, Page number 172" - ] + "source": "Example number 8.4, Page number 239" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "c = 1; #For simplicity assume speed of light to be unity(m/s)\n", - "L0 = 1; #For simplicity assume length in spaceship's frame to be unity(m)\n", - "tau = 1; #Unit time in the spaceship's frame(s)\n", - "\n", - "#Calculation\n", - "L = 1/2*L0; #Length as observed on earth(m)\n", - "#Relativistic length contraction gives L = L_0*sqrt(1-v^2/c^2), solving for v\n", - "v = math.sqrt(1-(L/L0)**2)*c; #Speed at which length of spaceship is observed as half from the earth frame(m/s)\n", - "t = tau/math.sqrt(1-(v/c)**2); #Time dilation of the spaceship's unit time(s)\n", - "v = math.ceil(v*10**4)/10**4; #rounding off the value of v to 4 decimals\n", - "\n", - "#Result\n", - "print \"The speed at which length of spaceship is observed as half from the earth frame is\",v, \"c\"\n", - "print \"The time dilation of the spaceship unit time is\",t,\"delta_tau\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nH = 1800; #magnetic field(A/m)\nphi = 3*10**-5; #magnetic flux(Wb)\nA = 0.2; #cross sectional area(cm**2)\n\n#Calculation\nA = A*10**-4; #cross sectional area(m**2)\nB = phi/A; #magnetic flux density(Wb/m**2)\nmew = B/H; #permeability(H/m)\nmew = mew*10**4;\nmew=math.ceil(mew*100)/100; #rounding off to 2 decimals\n\n#Result\nprint \"permeability is\",mew,\"*10**-4 H/m\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The speed at which length of spaceship is observed as half from the earth frame is 0.8661 c\n", - "The time dilation of the spaceship unit time is 2.0 delta_tau\n" - ] + "text": "permeability is 8.34 *10**-4 H/m\n" } ], - "prompt_number": 5 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 8.6, Page number 172" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "c = 3*10**8; #Speed of light in vacuum(m/s)\n", - "t1 = 2*10**-7; #Time for which first event occurs(s)\n", - "t2 = 3*10**-7; #Time for which second event occurs(s)\n", - "x1 = 10; #Position at which first event occurs(m)\n", - "x2 = 40; #Position at which second event occurs(m)\n", - "\n", - "#Calculation\n", - "v = 0.6*c; #Velocity with which S2 frame moves relative to S1 frame(m/s)\n", - "L_factor = 1/math.sqrt(1-(v/c)**2); #Lorentz factor\n", - "delta_t = L_factor*(t2 - t1)+L_factor*v/c**2*(x1 - x2); #Time difference between the events(s)\n", - "delta_x = L_factor*(x2 - x1)-L_factor*v*(t2 - t1); #Distance between the events(m)\n", - "\n", - "#Result\n", - "print \"The time difference between the events is\",delta_t, \"s\" \n", - "print \"The distance between the events is\",delta_x, \"m\"" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The time difference between the events is 5e-08 s\n", - "The distance between the events is 15.0 m\n" - ] - } - ], - "prompt_number": 6 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 8.7, Page number 173" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "c = 3*10**8; #Speed of light in vacuum(m/s)\n", - "tau = 2.6*10**-8; #Mean lifetime the particle in its own frame(s)\n", - "d = 20; #Distance which the unstable particle travels before decaying(m)\n", - "\n", - "#Calculation\n", - "#As t = d/v and also t = tau/sqrt(1-(v/c)^2), so that\n", - "#d/v = tau/sqrt(1-(v/c)^2), solving for v\n", - "v = math.sqrt(d**2/(tau**2+(d/c)**2)); #Speed of the unstable particle in lab frame(m/s)\n", - "v = v/10**8;\n", - "v = math.ceil(v*10)/10; #rounding off the value of v to 1 decimal\n", - "\n", - "#Result\n", - "print \"The speed of the unstable particle in lab frame is\",v,\"*10**8 m/s\"\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The speed of the unstable particle in lab frame is 2.8 *10**8 m/s\n" - ] - } - ], - "prompt_number": 9 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 8.8, Page number 174" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "c = 1; #For simplicity assume speed of light to be unity(m/s)\n", - "me = 1; #For simplicity assume mass of electron to be unity(kg)\n", - "tau = 2.3*10**-6; #Average lifetime of mu-meson in rest frame(s)\n", - "t = 6.9*10**-6; #Average lifetime of mu-meson in laboratory frame(s)\n", - "e = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\n", - "C = 3*10**8; #Speed of light in vacuum(m/s)\n", - "m_e = 9.1*10**-31; #Mass of an electron(kg)\n", - "\n", - "#Calculation\n", - "#Fromm Time Dilation Rule, tau = t*sqrt(1-(v/c)^2), solving for v\n", - "v = c*math.sqrt(1-(tau/t)**2); #Speed of mu-meson in the laboratory frame(m/s)\n", - "v = math.ceil(v*10**5)/10**5; #rounding off the value of v to 5 decimals\n", - "m0 = 207*me; #Rest mass of mu-meson(kg)\n", - "m = m0/math.sqrt(1-(v/c)**2); #Relativistic variation of mass with velocity(kg)\n", - "m = math.ceil(m*10)/10; #rounding off the value of m to 1 decimal\n", - "T = (m*m_e*C**2 - m0*m_e*C**2)/e; #Kinetic energy of mu-meson(eV)\n", - "T = T*10**-6; #Kinetic energy of mu-meson(MeV)\n", - "T = math.ceil(T*100)/100; #rounding off the value of T to 2 decimals\n", - " \n", - "#Result\n", - "print \"The speed of mu-meson in the laboratory frame is\",v, \"c\"\n", - "print \"The effective mass of mu-meson is\",m, \"me\"\n", - "print \"The kinetic energy of mu-meson is\",T, \"MeV\"\n" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The speed of mu-meson in the laboratory frame is 0.94281 c\n", - "The effective mass of mu-meson is 621.1 me\n", - "The kinetic energy of mu-meson is 211.97 MeV\n" - ] - } - ], - "prompt_number": 13 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 8.9, Page number 174" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "c = 1; #For simplicity assume speed of light to be unity(m/s)\n", - "m0 = 1; #For simplicity assume rest mass to be unity(kg)\n", - "\n", - "#Calculation\n", - "m = (20/100+1)*m0; #Mass in motion(kg)\n", - "#As m = m0/sqrt(1-(u/c)^2), solving for u\n", - "u = math.sqrt(1-(m0/m)**2)*c; #Speed of moving mass(m/s) \n", - "u = math.ceil(u*10**3)/10**3; #rounding off the value of u to 3 decimals\n", - "\n", - "#Result\n", - "print \"The speed of moving body is\",u, \"c\"" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The speed of moving body is 0.553 c\n" - ] - } - ], - "prompt_number": 14 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 8.10, Page number 175" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "c = 3*10**8; #Speed of light in vacuum(m/s)\n", - "dE = 4*10**26; #Energy radiated per second my the sun(J/s)\n", - "\n", - "#Calculation\n", - "dm = dE/c**2; #Rate of decrease of mass of sun(kg/s)\n", - "dm = dm/10**9;\n", - "dm = math.ceil(dm*10**3)/10**3; #rounding off the value of dm to 3 decimals\n", - "\n", - "#Result\n", - "print \"The rate of decrease of mass of sun is\",dm,\"*10**9 kg/s\"" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The rate of decrease of mass of sun is 4.445 *10**9 kg/s\n" - ] - } - ], - "prompt_number": 18 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 8.11, Page number 175" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "c = 1; #For simplicity assume speed of light to be unity(m/s)\n", - "m0 = 9.1*10**-31; #Mass of the electron(kg)\n", - "E0 = 0.512; #Rest energy of electron(MeV)\n", - "T = 10; #Kinetic energy of electron(MeV)\n", - "\n", - "#Calculation\n", - "E = T + E0; #Total energy of electron(MeV)\n", - "# From Relativistic mass-energy relation E^2 = c^2*p^2 + m0^2*c^4, solving for p\n", - "p = math.sqrt(E**2-m0**2*c**4)/c; #Momentum of the electron(MeV)\n", - "p = math.ceil(p*100)/100; #rounding off the value of p to 2 decimals\n", - "#As E = E0/sqrt(1-(u/c)^2), solving for u\n", - "u = math.sqrt(1-(E0/E)**2)*c; #Velocity of the electron(m/s)\n", - "u = math.ceil(u*10**4)/10**4; #rounding off the value of u to 4 decimals\n", - "\n", - "#Result\n", - "print \"The momentum of the electron is\",p,\"/c MeV\"\n", - "print \"The velocity of the electron is\",u, \"c\"\n", - "\n", - "#answer for velocity given in the book is wrong" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The momentum of the electron is 10.52 /c MeV\n", - "The velocity of the electron is 0.9989 c\n" - ] - } - ], - "prompt_number": 19 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 8.12, Page number 175. theoritical proof" - ] - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 8.13, Page number 176" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "c = 3*10**8; #Speed of light in vacuum(m/s)\n", - "E = 4.5*10**17; #Total energy of object(J)\n", - "px = 3.8*10**8; #X-component of momentum(kg-m/s)\n", - "py = 3*10**8; #Y-component of momentum(kg-m/s)\n", - "pz = 3*10**8; #Z-component of momentum(kg-m/s)\n", - "\n", - "#Calculation\n", - "p = math.sqrt(px**2+py**2+pz**2); #Total momentum of the object(kg-m/s)\n", - "#From Relativistic mass-energy relation E^2 = c^2*p^2 + m0^2*c^4, solving for m0\n", - "m0 = math.sqrt(E**2/c**4 - p**2/c**2); #Rest mass of the body(kg)\n", - "m0 = math.ceil(m0*100)/100; #rounding off the value of m0 to 2 decimals\n", - "\n", - "#Result\n", - "print \"The rest mass of the body is\",m0, \"kg\"" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The rest mass of the body is 4.63 kg\n" - ] - } - ], - "prompt_number": 20 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 8.14, Page number 176" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "\n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "c = 3*10**8; #Speed of light in vacuum(m/s)\n", - "m = 50000; #Mass of high speed probe(kg)\n", - "\n", - "#Calculation\n", - "u = 0.8*c; #Speed of the probe(m/s)\n", - "p = m*u/math.sqrt(1-(u/c)**2); #Momentum of the probe(kg-m/s)\n", - "\n", - "#Result\n", - "print \"The momentum of the high speed probe is\",p, \"kg-m/s\"" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The momentum of the high speed probe is 2e+13 kg-m/s\n" - ] - } - ], - "prompt_number": 21 + "prompt_number": 4 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 8.15, Page number 177" - ] + "source": "Example number 8.5, Page number 239" }, { "cell_type": "code", "collapsed": false, - "input": [ - "\n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "e = 1.6*10**-19; #Electronic charge, C = Energy equivalent of 1 eV(J/eV)\n", - "m0 = 9.11*10**-31; #Rest mass of electron(kg)\n", - "c = 3*10**8; #Speed of light in vacuum(m/s)\n", - "\n", - "#Calculation\n", - "u1 = 0.98*c; #Inital speed of electron(m/s)\n", - "u2 = 0.99*c; #Final speed of electron(m/s)\n", - "m1 = m0/math.sqrt(1-(u1/c)**2); #Initial relativistic mass of electron(kg)\n", - "m2 = m0/math.sqrt(1-(u2/c)**2); #Final relativistic mass of electron(kg)\n", - "dm = m2 - m1; #Change in relativistic mass of the electron(kg)\n", - "W = dm*c**2/e; #Work done on the electron to change its velocity(eV)\n", - "W = W*10**-6; #Work done on the electron to change its velocity(MeV)\n", - "W = math.ceil(W*100)/100; #rounding off the value of W to 2 decimals\n", - "#As W = eV, V = accelerating potential, solving for V\n", - "V = W*10**6; #Accelerating potential(volt)\n", - "V = V/10**6;\n", - "\n", - "#Result\n", - "print \"The change in relativistic mass of the electron is\",dm, \"kg\"\n", - "print \"The work done on the electron to change its velocity is\",W, \"MeV\"\n", - "print \"The accelerating potential is\",V, \"*10**6 volt\"\n", - "\n", - "#answers given in the book are wrong" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nB = 0.65; #magnetic induction(Wb/m**2)\nrho = 8906; #density(kg/m**3)\nM = 58.7; #atomic weight\nmew0 = 4*math.pi*10**-7;\nmb = 9.27*10**-24;\nNa = 6.023*10**26; #avagadro constant\n\n#Calculation\nN = rho*Na/M; #number of atoms per unit volume(atoms/m**3)\nmew_r = B/(N*mew0); #relative permeability(A/m**2)\nM = mew_r/mb; #magnetic moment in mew_B \nM=math.ceil(M*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"magnetic moment is\",M,\"mew_B\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The change in relativistic mass of the electron is 1.87996052912e-30 kg\n", - "The work done on the electron to change its velocity is 1.06 MeV\n", - "The accelerating potential is 1.06 *10**6 volt\n" - ] + "text": "magnetic moment is 0.611 mew_B\n" } ], - "prompt_number": 24 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [], - "language": "python", - "metadata": {}, - "outputs": [] + "prompt_number": 5 } ], "metadata": {} diff --git a/Engineering_Physics/Chapter9.ipynb b/Engineering_Physics/Chapter9.ipynb new file mode 100755 index 00000000..ff53dd34 --- /dev/null +++ b/Engineering_Physics/Chapter9.ipynb @@ -0,0 +1,62 @@ +{ + "metadata": { + "name": "Chapter9" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": "9: Superconducting Materials" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 9.1, Page number 255" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nH0 = 6.5*10**4; #magnetic field intensity(A/m)\nT = 4.2; #temperature(K)\nTc = 7.18; #critical temperature(K)\n\n#Calculation\nHc = H0*(1-((T**2)/(Tc**2))); #critical magnetic field intensity(A/m)\nHc = Hc*10**-4;\nHc=math.ceil(Hc*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"critical magnetic field intensity is\",Hc,\"*10**4 A/m\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "critical magnetic field intensity is 4.276 *10**4 A/m\n" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 9.2, Page number 255" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#importing modules\nimport math\n\n#Variable declaration\nTc1 = 4.185; #critical temperature for M1(K)\nTc2 = 4.133; #critical temperature for M2(K)\nM1 = 199.5; #isotopic mass\nalpha = 0.5;\n\n#Calculation\nA = math.pow(M1,alpha)*Tc1/Tc2;\nM2 = math.pow(A,1/alpha); #isotopic mass\nM2=math.ceil(M2*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"isotopic mass is\",M2\nprint \"answer given in the book is wrong\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "isotopic mass is 204.552\nanswer given in the book is wrong\n" + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Engineering_Physics/Chapter9_1.ipynb b/Engineering_Physics/Chapter9_1.ipynb index bea06702..ff53dd34 100755 --- a/Engineering_Physics/Chapter9_1.ipynb +++ b/Engineering_Physics/Chapter9_1.ipynb @@ -1,7 +1,6 @@ { "metadata": { - "name": "", - "signature": "sha256:1c769d85a6ecede1e3083e9252f10446216c71537365688b1cba3c5693bdfee6" + "name": "Chapter9" }, "nbformat": 3, "nbformat_minor": 0, @@ -12,45 +11,25 @@ "cell_type": "heading", "level": 1, "metadata": {}, - "source": [ - "9: Quantum Mechanics" - ] + "source": "9: Superconducting Materials" }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 9.1, Page number 202" - ] + "source": "Example number 9.1, Page number 255" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "V = 100; #Accelerating potential for electron(volt)\n", - "\n", - "#Calculation\n", - "lamda = math.sqrt(150/V)*10**-10; #de-Broglie wavelength of electron(m)\n", - "\n", - "#Result\n", - "print \"The De-Broglie wavelength of electron is\",lamda, \"m\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nH0 = 6.5*10**4; #magnetic field intensity(A/m)\nT = 4.2; #temperature(K)\nTc = 7.18; #critical temperature(K)\n\n#Calculation\nHc = H0*(1-((T**2)/(Tc**2))); #critical magnetic field intensity(A/m)\nHc = Hc*10**-4;\nHc=math.ceil(Hc*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"critical magnetic field intensity is\",Hc,\"*10**4 A/m\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The De-Broglie wavelength of electron is 1.22474487139e-10 m\n" - ] + "text": "critical magnetic field intensity is 4.276 *10**4 A/m\n" } ], "prompt_number": 1 @@ -59,296 +38,22 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 9.2, Page number 203" - ] + "source": "Example number 9.2, Page number 255" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "e = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\n", - "h = 6.626*10**-34; #Planck's constant(Js)\n", - "m = 9.11*10**-31; #Mass of the electron(kg)\n", - "Ek = 10; #Kinetic energy of electron(eV)\n", - "\n", - "#Calculation\n", - "p = math.sqrt(2*m*Ek*e); #Momentum of the electron(kg-m/s)\n", - "lamda = h/p ; #de-Broglie wavelength of electron from De-Broglie relation(m)\n", - "lamda = lamda*10**9; #de-Broglie wavelength of electron from De-Broglie relation(nm)\n", - "lamda = math.ceil(lamda*10**2)/10**2; #rounding off the value of lamda to 2 decimals\n", - "\n", - "#Result\n", - "print \"The de-Broglie wavelength of electron is\",lamda, \"nm\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nTc1 = 4.185; #critical temperature for M1(K)\nTc2 = 4.133; #critical temperature for M2(K)\nM1 = 199.5; #isotopic mass\nalpha = 0.5;\n\n#Calculation\nA = math.pow(M1,alpha)*Tc1/Tc2;\nM2 = math.pow(A,1/alpha); #isotopic mass\nM2=math.ceil(M2*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"isotopic mass is\",M2\nprint \"answer given in the book is wrong\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The de-Broglie wavelength of electron is 0.39 nm\n" - ] + "text": "isotopic mass is 204.552\nanswer given in the book is wrong\n" } ], "prompt_number": 2 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 9.3, Page number 203. theoritical proof" - ] - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 9.4, Page number 203" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "h = 6.626*10**-34; #Planck's constant(Js)\n", - "m = 9.11*10**-31; #Mass of the electron(kg)\n", - "v = 1.1*10**6; #Speed of the electron(m/s)\n", - "pr = 0.1; #precision in percent\n", - "\n", - "#Calculation\n", - "p = m*v; #Momentum of the electron(kg-m/s)\n", - "dp = pr/100*p; #Uncertainty in momentum(kg-m/s)\n", - "h_bar = h/(2*math.pi); #Reduced Planck's constant(Js)\n", - "dx = h_bar/(2*dp); #Uncertainty in position(m)\n", - "\n", - "#Result\n", - "print \"The uncertainty in position of electron is\",dx, \"m\"" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The uncertainty in position of electron is 5.26175358211e-08 m\n" - ] - } - ], - "prompt_number": 3 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 9.5, Page number 203" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "e = 1.6*10**-19; #Energy equivalent of 1 eV(J/eV)\n", - "h = 6.626*10**-34; #Planck's constant(Js)\n", - "dt = 10**-8; #Uncertainty in time(s)\n", - "\n", - "#Calculation\n", - "h_bar = h/(2*math.pi); #Reduced Planck's constant(Js)\n", - "dE = h_bar/(2*dt*e); #Uncertainty in energy of the excited state(m)\n", - "\n", - "#Result\n", - "print \"The uncertainty in energy of the excited state is\",dE, \"eV\"\n", - "\n", - "#answer given in the book is wrong" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The uncertainty in energy of the excited state is 3.2955020404e-08 eV\n" - ] - } - ], - "prompt_number": 4 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 9.6, Page number 204" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "\n", - "#Variable declaration\n", - "c = 3*10**8; #Speed of light(m/s)\n", - "dt = 10**-8; #Average lifetime(s)\n", - "lamda = 400; #Wavelength of spectral line(nm)\n", - "\n", - "#Calculation\n", - "lamda = lamda*10**-9; #Wavelength of spectral line(m)\n", - "#From Heisenberg uncertainty principle,\n", - "#dE = h_bar/(2*dt) and also dE = h*c/lambda^2*d_lambda, which give\n", - "#h_bar/(2*dt) = h*c/lambda^2*d_lambda, solving for d_lambda\n", - "d_lamda = (lamda**2)/(4*math.pi*c*dt); #Width of spectral line(m)\n", - "\n", - "#Result\n", - "print \"The width of spectral line is\",d_lamda, \"m\"" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The width of spectral line is 4.24413181578e-15 m\n" - ] - } - ], - "prompt_number": 5 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 9.7, Page number 204. theoritical proof" - ] - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 9.8, Page number 204. theoritical proof" - ] - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 9.9, Page number 205. theoritical proof" - ] - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 9.10, Page number 205. theoritical proof" - ] - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 9.11, Page number 205. theoritical proof" - ] - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 9.12, Page number 206. theoritical proof" - ] - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 9.13, Page number 206. theoritical proof " - ] - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 9.14, Page number 207" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "import math\n", - "from __future__ import division\n", - "from scipy.integrate import quad\n", - "\n", - "#Variable declaration\n", - "a = 2*10**-10; # Width of 1D box(m)\n", - "x1=0; # Position of first extreme of the box(m)\n", - "x2=1*10**-10; # Position of second extreme of the box(m)\n", - "\n", - "#Calculation\n", - "def intg(x):\n", - " return ((2/a)*(math.sin(2*math.pi*x/a))**2)\n", - "S=quad(intg,x1,x2)[0]\n", - "\n", - "#Result\n", - "print \"The probability of finding the electron between x = 0 and x = 10**-10 is\",S" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "The probability of finding the electron between x = 0 and x = 10**-10 is 0.5\n" - ] - } - ], - "prompt_number": 7 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [], - "language": "python", - "metadata": {}, - "outputs": [] } ], "metadata": {} diff --git a/Engineering_Physics/README.txt b/Engineering_Physics/README.txt index a2116ca8..bd7c4bfa 100755 --- a/Engineering_Physics/README.txt +++ b/Engineering_Physics/README.txt @@ -1,10 +1,10 @@ -Contributed By: ADITYA DHARMASAGAR KALIDAS +Contributed By: KRISHNA CHAITANYA Course: btech -College/Institute/Organization: vaageswari college of engineering -Department/Designation: ECE +College/Institute/Organization: JNTUH +Department/Designation: Computer Science Book Title: Engineering Physics -Author: Dr. K. Vijaya Kumar -Publisher: S. Chand & Company Ltd., New Delhi -Year of publication: 2011 -Isbn: 81-219-3852-X +Author: D. K. Bhattacharya & A. Bhaskaran +Publisher: Oxford University Press, New Delhi +Year of publication: 2013 +Isbn: 9780198065425 Edition: 1
\ No newline at end of file diff --git a/Engineering_Physics/screenshots/Untitled1.png b/Engineering_Physics/screenshots/Untitled1.png Binary files differindex f9ffad82..2584f5af 100755 --- a/Engineering_Physics/screenshots/Untitled1.png +++ b/Engineering_Physics/screenshots/Untitled1.png diff --git a/Engineering_Physics/screenshots/Untitled1_1.png b/Engineering_Physics/screenshots/Untitled1_1.png Binary files differnew file mode 100755 index 00000000..6c937ec4 --- /dev/null +++ b/Engineering_Physics/screenshots/Untitled1_1.png diff --git a/Engineering_Physics/screenshots/Untitled2.png b/Engineering_Physics/screenshots/Untitled2.png Binary files differnew file mode 100755 index 00000000..7461d551 --- /dev/null +++ b/Engineering_Physics/screenshots/Untitled2.png diff --git a/Engineering_Physics/screenshots/Untitled2_1.png b/Engineering_Physics/screenshots/Untitled2_1.png Binary files differnew file mode 100755 index 00000000..a47a6ec9 --- /dev/null +++ b/Engineering_Physics/screenshots/Untitled2_1.png diff --git a/Engineering_Physics/screenshots/Untitled3.png b/Engineering_Physics/screenshots/Untitled3.png Binary files differindex f06b09bb..492ad660 100755 --- a/Engineering_Physics/screenshots/Untitled3.png +++ b/Engineering_Physics/screenshots/Untitled3.png diff --git a/Engineering_Physics/screenshots/Untitled3_1.png b/Engineering_Physics/screenshots/Untitled3_1.png Binary files differnew file mode 100755 index 00000000..cdbc1a6f --- /dev/null +++ b/Engineering_Physics/screenshots/Untitled3_1.png diff --git a/Surveying_Volume_3/Chapter1.ipynb b/Surveying_Volume_3/Chapter1.ipynb new file mode 100755 index 00000000..015050ae --- /dev/null +++ b/Surveying_Volume_3/Chapter1.ipynb @@ -0,0 +1,83 @@ +{ + "metadata": { + "name": "S3-C1" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": "Electronic Distance Measurement" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 1.1,Page 22" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nT=273+25.0#temperature \np=752.0;#pressure mm Hg\nNo=294.0e-6;\nns=1.000284;\nD1=1438.254;#recorded distance in m\nh=263.42-243.25;#height difference in m\nR=6370e3;#radius of earth in m\n\n#calculation\nn=1+No*(273/T)*(p/760);\nD=D1*ns/n;\ncg=-h**2/2/D;\nHm=263.42/2+243.25/2;\nD=D+cg;\nch=-D*Hm/R\nEL=D+ch;\n\n#result\nprint \"equivalent length in m\",round(EL,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "equivalent length in m 1438.081\n" + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 1.2,Page 22" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nT=273+18.8;#temperature\np=713;\ne=3;\nc=299792.5e3;#speed of light in km/s\nf=11e6;#frequency in Hz\n\n#calculation\nn=1+(103.49/T*(p-e)+86.26/T*(1+5748.0/T)*e)/1e6;\nV=c/n;\nl=V/f;\n\n#result\nprint \"wavelenght of light in m\",round(l,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "27.247 wavelenght of light in m\n" + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 1.3,Page 23" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nT=273.0+30.0;#temperature\nl=0.85;#wavelength in m\np=752.4;\nc=299792.5e3;#speed of light in km/s\nf=24e6;#frequency in Hz\n\n#calculation\nno=1+(287.604+4.8864/l**2+0.068/l**4)/1e6;\nns=1+(no-1)*273/T*p/760;\nV=c/ns;\nl=V/f;\n\n#result\nprint \"wavelength of light in m\",round(l,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "wavelenght of light in m 12.488\n" + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Surveying_Volume_3/Chapter1_1.ipynb b/Surveying_Volume_3/Chapter1_1.ipynb new file mode 100755 index 00000000..015050ae --- /dev/null +++ b/Surveying_Volume_3/Chapter1_1.ipynb @@ -0,0 +1,83 @@ +{ + "metadata": { + "name": "S3-C1" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": "Electronic Distance Measurement" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 1.1,Page 22" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nT=273+25.0#temperature \np=752.0;#pressure mm Hg\nNo=294.0e-6;\nns=1.000284;\nD1=1438.254;#recorded distance in m\nh=263.42-243.25;#height difference in m\nR=6370e3;#radius of earth in m\n\n#calculation\nn=1+No*(273/T)*(p/760);\nD=D1*ns/n;\ncg=-h**2/2/D;\nHm=263.42/2+243.25/2;\nD=D+cg;\nch=-D*Hm/R\nEL=D+ch;\n\n#result\nprint \"equivalent length in m\",round(EL,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "equivalent length in m 1438.081\n" + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 1.2,Page 22" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nT=273+18.8;#temperature\np=713;\ne=3;\nc=299792.5e3;#speed of light in km/s\nf=11e6;#frequency in Hz\n\n#calculation\nn=1+(103.49/T*(p-e)+86.26/T*(1+5748.0/T)*e)/1e6;\nV=c/n;\nl=V/f;\n\n#result\nprint \"wavelenght of light in m\",round(l,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "27.247 wavelenght of light in m\n" + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 1.3,Page 23" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nT=273.0+30.0;#temperature\nl=0.85;#wavelength in m\np=752.4;\nc=299792.5e3;#speed of light in km/s\nf=24e6;#frequency in Hz\n\n#calculation\nno=1+(287.604+4.8864/l**2+0.068/l**4)/1e6;\nns=1+(no-1)*273/T*p/760;\nV=c/ns;\nl=V/f;\n\n#result\nprint \"wavelength of light in m\",round(l,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "wavelenght of light in m 12.488\n" + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Surveying_Volume_3/Chapter3.ipynb b/Surveying_Volume_3/Chapter3.ipynb new file mode 100755 index 00000000..4c4c37ac --- /dev/null +++ b/Surveying_Volume_3/Chapter3.ipynb @@ -0,0 +1,104 @@ +{ + "metadata": { + "name": "S3-C3" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": "Trilateration" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 3.1,Page 47" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos\nAB=25145.32;\nR=6370.0e3;#radius of earth\nha=325.14;\n\n#calculation\ntheta=AB*cos(3+9.0/60+40.0/3600)/R;\nAB_dash=AB/sin(pi/2+theta/2)*sin(pi/2-theta/2-(3+9.0/60+40.0/3600)*pi/180);\nCD=AB_dash-AB_dash*ha/R;\nS=CD+CD**3/24.0/R**2;\n\n#result\nprint \"sea level length in m\",round(S,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "sea level length in m 25108.53\n" + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 3.2,Page 50" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,asin\nAB=31325.14\nR=6370.0e3;#radius of earth\nha=1582.15;\nh=2669.17\n\n#calculation\nAB_dash=AB-h**2/2/AB;\ntheta=2*asin(AB_dash/2/R);\nAB_dash=AB-(h*sin(theta/2)+h**2/AB/2)\nCD=AB_dash-AB_dash*ha/R;\nS=CD+CD**3/24.0/R**2;\n\n#result\nprint \"sea level length in m\",round(S,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "sea level length in m 31197.163\n" + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 3.3,Page 53" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin, acos\nAB=1525.456;\nBC=2176.945;\nCD=1697.435;\nAD=2401.435;\nAC=3073.845;\nBD=2483.115;\n\n#calculation\n#alpha=A and beta=B and those are angles\nA1=acos((CD**2+AC**2-AD**2)/(2*CD*AC));\nA1=A1*180/pi;\nA2=acos((AD**2+BD**2-AB**2)/(2*AD*BD));\nA2=A2*180/pi;\nA3=acos((AB**2+AC**2-BC**2)/(2*AB*AC));\nA3=A3*180/pi;\nA4=acos((BC**2+BD**2-CD**2)/(2*BC*BD));\nA4=A4*180/pi;\nB1=acos((CD**2+BD**2-BC**2)/(2*CD*BD));\nB1=B1*180/pi;\nB2=acos((AD**2+AC**2-CD**2)/(2*AD*AC));\nB2=B2*180/pi;\nB3=acos((AB**2+BD**2-AD**2)/(2*AB*BD));\nB3=B3*180/pi;\nB4=acos((AC**2+BC**2-AB**2)/(2*AC*BC));\nB4=B4*180/pi;\ne1=360-A1-A2-A3-A4-B1-B2-B3-B4;#error\ne2=A1+B1-A3-B3;#error\ne3=A2+B2-A4-B4;#error\n#angle update\nA1=A1+e1/8-e2/4;\nA3=A3+e1/8+e2/4;\nB1=B1+e1/8-e2/4;\nB3=B3+e1/8+e2/4;\nA2=A2+e1/8-e3/4;\nB2=B2+e1/8-e3/4;\nA4=A4+e1/8+e3/4;\nB4=B4+e1/8+e3/4;\n#updating sides\nAD=1525.456*sin(B3*pi/180)/sin(A2*pi/180);\nBD=1525.456*sin(A3*pi/180+B3*pi/180)/sin(A2*pi/180);\nAC=1525.456*sin(A4*pi/180+B3*pi/180)/sin(B4*pi/180);\nBC=1525.456*sin(A3*pi/180)/sin(B4*pi/180);\nCD=BC*sin(A4*pi/180)/sin(B1*pi/180)\n\n#result\n\nprint \"equation for B2 is wrong\"\nprint \"corrected length of AD in m \",round(AD,3)\nprint \"corrected length of AC in m \",round(AC,3)\nprint \"corrected length of BD in m \",round(BD,3)\nprint \"corrected length of BC in m \",round(BC,3)\nprint \"corrected length of CD in m \",round(CD,3)\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "27.5965629411\nequation for B2 is wrong\ncorrected length of AD in m 2401.251\ncorrected length of AC in m 3073.446\ncorrected length of BD in m 2413.581\ncorrected length of BC in m 2176.758\ncorrected length of CD in m 1697.416\n" + } + ], + "prompt_number": 25 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 3.4,Page 59" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,log,sin\n#angles found by cosine law\n#alpha=A and beta=B and those are angles\nA1=45.801596;\nA2=40.605250;\nA3=50.143258;\nA4=43.077646;\nB1=48.779868;\nB2=44.141587;\nB3=49.733152;\nB4=37.737035;\n\n#calculation\ne1=360-A1-A2-A3-A4-B1-B2-B3-B4;#error\n#angle update\nA1=A1+e1/8;\nA3=A3+e1/8;\nB1=B1+e1/8;\nB3=B3+e1/8;\nA2=A2+e1/8;\nB2=B2+e1/8;\nA4=A4+e1/8;\nB4=B4+e1/8;\nE2=log(sin(A1*pi/180),10)*log(sin(A2*pi/180),10)*log(sin(A3*pi/180),10)*log(sin(A4*pi/180),10)-log(sin(B1*pi/180),10)*log(sin(B2*pi/180),10)*log(sin(B3*pi/180),10)*log(sin(B4*pi/180),10);\nc3=E2/17.1;\nc4=E2/17.0;\nA1=A1-c3;\nB1=B1+c3;\n\n#result\nprint \"corrected angle A1 in degrees\",A1,\"corrected angle B1 in degrees\",B1", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "corrected angle A1 in degrees 45.7991704812 corrected angle B1 in degrees 48.7774455188\n" + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Surveying_Volume_3/Chapter4.ipynb b/Surveying_Volume_3/Chapter4.ipynb new file mode 100755 index 00000000..f2b5c7ec --- /dev/null +++ b/Surveying_Volume_3/Chapter4.ipynb @@ -0,0 +1,970 @@ +{ + "metadata": { + "name": "S3-C4" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": "Principles of Field Astronomy" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.1,Page 81" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\ntheta=25+14.0/60;\nR=6370.0;\n\n#calculation\nAB=cos(theta*pi/180)*(16+10.0/60)\ndis=2*pi*R*AB/360.0;\n\n#result\nprint \"distance of AB in m \",round(dis,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "distance of AB in m 1625.863\n" + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.2,Page 81" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nimport numpy as np\nfrom scipy import linalg\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nLongA=52+24.0/60;\nLongB=55+30.0/60;\nlatA=18+10.0/60;\nlatB=15.0;\nR=6370.0;#radius of earth\n\n#calculation\nP=LongB-LongA;\nPA=90-latA;\nPB=90-latB;\nAB=acos(cos(PB*pi/180)*cos(PA*pi/180)+sin(PB*pi/180)*sin(PA*pi/180)*cos(P*pi/180));\ndis=AB*R;\n#solving for A\na = np.array([[0.5,0.5], [0.5,-0.5]])\nb = np.array([atan(cos((PB/2-PA/2)*pi/180)/tan(P*pi/180)/cos((PB/2+PA/2)*pi/180))*180/pi,atan(sin((PB/2-PA/2)*pi/180)/tan(P*pi/180)/sin((PB/2+PA/2)*pi/180))*180/pi])\nx = np.linalg.solve(a, b)\nA=x[0];\nA=deg_to_dms(A);\n\n#result\nprint \"distance of AB in km \",round(dis,2)\nprint \"direction of B to A in deg min sec\",A", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "distance of AB in km 482.72\ndirection of B to A in deg min sec [117, 8, 30.72]\n" + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.3,Page 83" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nb=40.0;\np=6.0;\n\n#calculation\na=pi/2-asin(cos(b*pi/180)*cos(p*pi/180));\nBC=a*180/pi-b;\nBC=BC*1.853*60;\nB=asin(sin(b*pi/180)/sin(a))\nB=deg_to_dms(B*180/pi);\n\n#result\nprint \"distance BC in km\",round(BC,2)\nprint \"angle of B deg min sec\",B", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "distance BC in km 41.43\nangle of B deg min sec [82, 53, 56.83]\n" + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.4,Page 105" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\ncoal=90.0-28.0-24.0/60;#coaltitude\ncola=90.0-48.0-30.0/60;#colatitude\n\n\n#calculation\ndelta=pi/2-acos((cos(coal*pi/180)*cos(cola*pi/180)+sin(coal*pi/180)*sin(cola*pi/180)*cos(50*pi/180)));\nH=acos(cos(coal*pi/180)/(sin(cola*pi/180)*cos(delta))-tan(delta)/tan(cola*pi/180));\nH=deg_to_dms(H*180/pi); \ndelta=deg_to_dms(delta*180/pi); \n\n#result\nprint \"H in deg min sec\",H\nprint \"declination in deg mi sec\",delta", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "H in deg min sec [99, 7, 55.94]\ndelta in deg mi sec [46, 57, 38.26]\n" + } + ], + "prompt_number": 25 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.5,Page 107" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\ndelta=22+45.0/60;\ntheta=55.0;\nH=45+15.0/60;\n\n#calculation\nalpha=asin((cos(H*pi/180)+tan(theta*pi/180)*tan(delta*pi/180))*cos(theta*pi/180)*cos(delta*pi/180));\nalpha=alpha*180/pi;\nA=acos(sin(delta*pi/180)/(cos(theta*pi/180)*cos(alpha*pi/180))-tan(alpha*pi/180)*tan(theta*pi/180));\nA=deg_to_dms(360-A*180/pi);\n\n#result\nprint \"azimuth in deg mi sec\",A", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "azimuth in deg mi sec [244, 40, 8.11]\n" + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.6,Page 109" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\ncoal=42.0;\ncode=100+40.0/60;#co-declination\n\n#calculation\nalpha=pi/2-acos((cos(coal*pi/180)*cos(code*pi/180)+sin(coal*pi/180)*sin(code*pi/180)*cos(35*pi/180)));\nA=acos((cos(code*pi/180)-cos(coal*pi/180)*cos(pi/2-alpha))/(sin(coal*pi/180)*sin(pi/2-alpha)));\nA=deg_to_dms(A*180/pi);\nalpha=deg_to_dms(alpha*180/pi);\n\n#result\nprint \"azimuth in deg min sec\",A\nprint \"alpha in deg min sec\",alpha", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "azimuth in deg mi sec [142, 1, 26.46]\nalpha in deg min sec [23, 38, 48.21]\n" + } + ], + "prompt_number": 33 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.7,Page 113" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\ntheta=33+42.0/60+34.0/3600;\ndelta=81+55.0/60+14.0/3600;\n\n#calculation\nH1=acos(tan(theta*pi/180)/tan(delta*pi/180));\nH1=deg_to_dms(360-H1*180/pi);\nalpha=asin(sin(theta*pi/180)/sin(delta*pi/180));\nalpha=deg_to_dms(alpha*180/pi);\nA=asin(cos(delta*pi/180)/cos(theta*pi/180));\nA=deg_to_dms(A*180/pi);\n\n\n#result\nprint \"azimuth in deg min sec\",A\nprint \"alpha in deg min sec\",alpha\nprint \"hour angle in deg min sec\",H1", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "azimuth in deg min sec [9, 43, 37.11]\nalpha in deg min sec [34, 5, 36.7]\nhour angle in deg min sec [275, 26, 3.85]\n" + } + ], + "prompt_number": 41 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.8,Page 114" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nalpha=0.0;\ntheta=25+45.0/60;\n\n#calculation\ndelta=asin(sin(alpha)/sin(theta*pi/180));\n\n#result\nprint \"declination in degrees\",delta", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "declination in degrees 0.0\n" + } + ], + "prompt_number": 42 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.9,Page 116" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\ncola=90.0-49.0;#colatitude\ncode=90.0+19.0;#codeclination\n\n#calculation\nA1=acos((cos(code*pi/180)-cos(cola*pi/180)*cos(pi/2))/sin(cola*pi/180)/sin(pi/2));\nA1=deg_to_dms(360-A1*180/pi);\nH=acos((0-cos(cola*pi/180)*cos(code*pi/180))/sin(cola*pi/180)*sin(code*pi/180));\nH=deg_to_dms(H*180/pi)\n\n#result\nprint \"azimuth in deg min sec\",A1\nprint \"hour angle in deg min sec\",H", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "azimuth in deg min sec [240, 14, 52.45]\nhour angle in deg min sec [69, 15, 38.0]\n" + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.10,Page 120" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\n#part1\ndelta=38+15.0/60;\ntheta=25+10.0/60;\n\n#calculation\nz=delta-theta;\nalpha=90-z;\nz=deg_to_dms(z);\nalpha=deg_to_dms(alpha);\n\n#result\nprint \"zenith distance in deg min sec\",z\nprint \"altitude in deg min sec\",alpha\n\n#part2\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\ndelta=22+40.0/60;\ntheta=25+10.0/60;\n\n#calculation\nz=-delta+theta;\nalpha=90-z;\nz=deg_to_dms(z);\nalpha=deg_to_dms(alpha);\n\n#result\nprint \"zenith distance in deg min sec\",z\nprint \"altitude in deg min sec\",alpha\n\n#part3\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md+1)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\ndelta=70+20.0/60;\ntheta=25+10.0/60;\n\n#calculation\nz=delta-theta;\nz=deg_to_dms(z);\n\n\n#result\nprint \"zenith distance in deg min sec\",z\n\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "zenith distance in deg min sec [13, 4, 60.0]\naltitude in deg min sec [76, 55, 0.0]\nzenith distance in deg min sec [2, 30, 0.0]\naltitude in deg min sec [87, 30, 0.0]\nzenith distance in deg min sec [45, 10, -0.0]\n" + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.11,Page 122" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\ntheta=42+50.0/60;\ndelta=83+40.0/60;\n\n#calculation\nz=180-delta-theta;\nalpha=90-z;\nz=deg_to_dms(z);\nalpha=deg_to_dms(alpha);\n\n#result\nprint \"zenith distance in deg min sec\",z\nprint \"altitude in deg min sec\",alpha", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "zenith distance in deg min sec [53, 29, 60.0]\naltitude in deg min sec [36, 30, 0.0]\n" + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.12,Page 133" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\n#part1\ndol=110-82-30.0/60; #differnce in longitude\nST=18+35.0/60+10.0/3600;#standard time\n\n#calculation\nLMT=ST+dol/15.0;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hr min sec\",LMT\n\n#part2\ndol=82+30.0/60+30; #differnce in longitude\nST=18+35.0/60+10.0/3600;#standard time\n\n#calculation\nLMT=ST-dol/15.0;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hr min sec\",LMT\n\n#part1\ndol=82+30.0/60-30; #differnce in longitude\nST=18+35.0/60+10.0/3600;#standard time\n\n#calculation\nLMT=ST-dol/15.0;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hr min sec\",LMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LMT in hr min sec [20, 25, 10.0]\nLMT in hr min sec [11, 5, 10.0]\nLMT in hr min sec [15, 5, 10.0]\n" + } + ], + "prompt_number": 66 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.13,Page 134" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\n#part1\nLMT=8+30.0/60+15.0/3600;\nLong=45+30.0/60;\n\n#calculation\nGMT=LMT+Long/15.0;\nGMT=deg_to_dms(GMT)\n\n#result\nprint \"GMT in hr min sec (AM)\",GMT\n\n\n#part2\nLMT=6+40.0/60+10.0/3600;\nLong=55+30.0/60;\n\n#calculation\nGMT=LMT-Long/15.0;\nGMT=deg_to_dms(GMT)\n\n#result\nprint \"GMT in hr min sec (PM)\",GMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "GMT in hr min sec (AM) [11, 32, 15.0]\nGMT in hr min sec (PM) [2, 58, 10.0]\n" + } + ], + "prompt_number": 71 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.14,Page 134" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\n#part1\nGMT=20+30.0/60+15.0/3600;\nLong=82+30.0/60;\n\n#calculation\nLMT=GMT+Long/15.0-24;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hr min sec (next day)\",LMT\n\n#part1\nGMT=20+30.0/60+15.0/3600;\nLong=120.0;\n\n#calculation\nLMT=GMT-Long/15.0;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hr min sec (same day)\",LMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LMT in hr min sec (next day) [2, 0, 15.0]\nLMT in hr min sec (same day) [12, 30, 15.0]\n" + } + ], + "prompt_number": 74 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.15,Page 135" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\n#part1\nRA=6+15.0/60+20.0/3600;\nHA=8+10.0/60+30.0/3600;\n\n#calculation\nLST=RA+HA;\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST in hr min sec\",LST\n\n#part2\nRA=8+40.0/60+15.0/3600;\nHA=3+50.0/60+20.0/3600;\n\n#calculation\nLST=RA-HA;\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST in hr min sec\",LST\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LST in hr min sec [14, 25, 50.0]\nLST in hr min sec [4, 49, 55.0]\n" + } + ], + "prompt_number": 76 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.16,Page 135" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\n#part1\nLHA=6+30.0/60+10.0/3600;\n\n#calculation\nLAT=LHA+12;\nLAT=deg_to_dms(LAT);\n\n#result\nprint \"LAT in hr min sec\",LAT;\n\n#part2\nLHA=18+40.0/60+20.0/3600;\n\n#calculation\nLAT=LHA+12-24;\nLAT=deg_to_dms(LAT);\n\n#result\nprint \"LAT in hr min sec\",LAT;", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LAT in hr min sec [18, 30, 10.0]\nLAT in hr min sec [6, 40, 20.0]\n" + } + ], + "prompt_number": 78 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.17,Page 136" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=60.0;\nLHA=5+30.0/60+20.0/3600;\n\n#calculation\nGMT=LHA+12-Long/15.0;\nGMT=deg_to_dms(GMT);\n\n#result\nprint \"GMT in hr min sec\",GMT\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "GMT in hr min sec [13, 30, 20.0]\n" + } + ], + "prompt_number": 79 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.18,Page 138" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\n#parta\nGMT=0;\nET=10.0/60+1.8/3600;\n\n#calculaion\nGAT=GMT+ET;\nGAT=deg_to_dms(GAT);\n\n#result\nprint \"GAT in hr min sec\",GAT\n\n#partb\nGMT=0;\nET=-13.0/60-28.5/3600;\n\n#calculaion\nGAT=GMT+ET+24;\nGAT=deg_to_dms(GAT);\n\n#result\nprint \"GAT in hr min sec\",GAT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "GAT in hr min sec [0, 10, 1.8]\nGAT in hr min sec [23, 46, 31.5]\n" + } + ], + "prompt_number": 81 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.19,Page 138" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nET1=-3.0/60-51.4/3600; #ET at april 2\nET2=-3.0/60-33.5/3600; #ET at april 3\n\n#calculation\ndET=(ET2-ET1)*18.0/24; #change in ET\nET=ET1+dET;\nET=deg_to_dms(ET);\n\n#result\nprint \"ET (-ve) in hr min s\",ET", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "ET in hr min s [0, 3, 37.97]\n" + } + ], + "prompt_number": 83 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.20,Page 138" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLAT=15+12.0/60+40.0/3600;\nLong=20+3.0/60;\nGMN=5.0/60+10.65/3600;\n\n#calculation\nGAT=LAT+Long/15.0;\ne1=(GAT-12)*0.22/3600+GMN;\nLAT=GAT+e1-Long/15.0;\nLAT=deg_to_dms(LAT);\n\n#result\nprint \"LAT in hr min sec\",LAT\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LAT in hr min sec [15, 17, 51.65]\n" + } + ], + "prompt_number": 84 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.21,Page 139" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=56+35.0/60;\nLMT=7+15.0/60+25.0/3600;\nGMN=3.0/60+54.0/3600;\n\n#calculation\nGMT=LMT-Long/15.0;\ne1=GMN+(12-GMN)*0.25/3600;\nLAT=GMT+Long/15.0+e1;\nLAT=deg_to_dms(LAT);\n\n#result\nprint \"LAT in hr min sec\",LAT\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LAT in hr min sec [7, 19, 21.98]\n" + } + ], + "prompt_number": 86 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.22,Page 142" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nST=7+15.0/60+30.0/3600;\n\n#calculation\ntr=9.8296/3600*ST;\nST=ST-tr;\nST=deg_to_dms(ST);\n\n#result\nprint \"solar mean time in hr min sec\",ST", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "solar mean time in hr min sec [7, 14, 18.65]\n" + } + ], + "prompt_number": 87 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.23,Page 142" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nST=7+45.0/60+50.0/3600;\n\n#calculation\ntr=9.8565/3600*ST;\nST=ST+tr;\nST=deg_to_dms(ST);\n\n#result\nprint \"solar mean time in hr min sec\",ST", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "solar mean time in hr min sec [7, 47, 6.52]\n" + } + ], + "prompt_number": 90 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.24,Page 143" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding LST\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=140+35.0/60+20.0/3600;\nGST=13+15.0/60+30.0/3600;\n\n#calculation\nLST=GST+9.8565/3600*Long/15.0;\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST in deg min sec\",LST\n\n#part2\nLong=160+45.0/60+30.0/3600;\nGST=13+15.0/60+30.0/3600;\n\n#calculation\nLST=GST-9.8565/3600*Long/15.0;\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST in deg min sec\",LST", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LST in deg min sec [13, 17, 2.38]\nLST in deg min sec [13, 13, 44.37]\n" + } + ], + "prompt_number": 93 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.25,Page 145" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=75.0;\nGST=15+55.0/60+13.0/3600;\nLMT=11.0;\n\n#calculation\nLST=GST+Long/15.0*9.8565/3600+LMT+9.8565/3600*LMT;\nLST=LST-24;\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST of next day in deg min sec\",LST", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LST of next day in deg min sec [2, 57, 50.7]\n" + } + ], + "prompt_number": 95 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.26,Page 145" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=75.0;\nGST=5+25.0/60+15.0/3600;\nLMT=5.0+40.0/60;\n\n#calculation\nLST=GST-Long/15.0*9.8565/3600+LMT+9.8565/3600*(LMT);\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST of next day in deg min sec\",LST", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LST of next day in deg min sec [11, 5, 21.57]\n" + } + ], + "prompt_number": 96 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.27,Page 146" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=75.0;\nGST=11+45.0/60+10.0/3600;\nLST=26+35.0/60+42.0/3600;\n\n#calculation\nLMM=GST+Long/15*9.8565/3600;\nLMT=LST-LMM-(LST-LMM)*9.8296/3600;\nLMT=deg_to_dms(LMT-12)\n\n#result\nprint \"LMT in hr min sec (PM)\",LMT \n\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LMT in hr min sec (PM) [2, 47, 16.96]\n" + } + ], + "prompt_number": 97 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.28,Page 147" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=90.0;\nGST=9+15.0/60+14.0/3600;\nLST=31+35.0/60+12.0/3600;\n\n#calculation\nLMM=GST-Long/15*9.8565/3600;\nLMT=LST-LMM-(LST-LMM)*9.8296/3600;\nLMT=deg_to_dms(LMT-12)\n\n#result\nprint \"LMT in hr min sec (PM)\",LMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LMT in hr min sec (PM) [10, 17, 17.46]\n" + } + ], + "prompt_number": 100 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.29,Page 149" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=150.0;\nGST=12+25.0/60+15.0/3600;\nLST=30+15.0/60+10.0/3600;\nLMN=18+15.0/60+10.0/3600;\n\n#calculation\nLMM=GST+Long/15*9.8565/3600;\nLMT=LMN-LMM-(LMN-LMM)*9.8296/3600;\nLMT=deg_to_dms(LMT)\n\n#result\nprint \"LMT in hr min sec (PM)\",LMT\n\n#part2\nLMM=GST+Long/15*9.8565/3600;\nLMT=LST-LMM-(LST-LMM)*9.8296/3600;\nLMT=deg_to_dms(LMT-12)\n\n#result\nprint \"LMT in hr min sec (AM)\",LMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LMT in hr min sec (PM) [5, 47, 19.38]\nLMT in hr min sec (AM) [5, 45, 21.42]\n" + } + ], + "prompt_number": 102 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.30,Page 150 " + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\ntheta=35+15.0/60+20.0/3600;\ndelta=88+15.0/60+45.0/3600;\nRA=1+45.0/60+15.0/3600;\n\n#calculation\nH=acos(tan(theta*pi/180)/tan(delta*pi/180));\nH=H*180/pi/15;\nLST=RA+H;\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST in hr min sec\",LST", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LST in hr min sec [7, 40, 20.12]\n" + } + ], + "prompt_number": 103 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.31,Page 151" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nRA=22+25.0/60+10.0/3600;\nST=14+45.0/60;#sidereal time\nLong=90.0;\nGMT=27+15.0/60;\nLMN=15+21.0/60+15.0/3600;\n\n#calculation\nMT=12+24-GMT+Long/15;#mean time interval\nacc=9.8565/3600*MT;\nHA=LMN-acc-MT;\nLST=HA+24-RA;\nLST=deg_to_dms(LST);\n\n#result\nprint \"LST in hr min sec\",LST\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LST in hr min sec [2, 8, 39.62]\n" + } + ], + "prompt_number": 105 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.32,Page 152" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=60;\nGMT=11+15.0/60+20.0/3600;\n\n#calculation\nLMT=GMT-Long/15*9.8296/3600;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hr min sec \",LMT\n\n#part2\nLong=45;\nGMT=11+15.0/60+20.0/3600;\n\n#calculation\nLMT=GMT+Long/15*9.8296/3600;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hr min sec \",LMT\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LMT in hr min sec [11, 14, 40.68]\nLMT in hr min sec [11, 15, 49.49]\n" + } + ], + "prompt_number": 107 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 4.33,Page 153" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=75;\nGMT=6+18.0/60+20.0/3600;\nLST=10+25.0/60+15.0/3600;\n\n#calculation\nLMT=GMT+Long/15*9.8296/3600;\nLST=LST-9.8296/3600*LST;\nLMT=LMT+LST;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hr min sec \",LMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LMT in hr min sec [16, 42, 41.72]\n" + } + ], + "prompt_number": 111 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.34,Page 154" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nGST=7+35.0/60+40.0/3600;\n\n#calculation\nGMT=24-GST-(24-GST)*9.8296/3600;\nGMT=deg_to_dms(GMT);\n\n#result\nprint \"GMT in hr min sec\",GMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "GMT in hr min sec [16, 21, 38.74]\n" + } + ], + "prompt_number": 112 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": "Example 4.34,Page 154" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding LMT\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=120.0;\nGMT=12+3.0/60+24.6/3600;\n\n#calculation\nLMT=GMT-17.8/24*Long/15.0/3600;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT of LAN in hr min sec\",LMT\n\n#part2\nLong=45;\nGMT=12+3.0/60+24.6/3600;\n\n#calculation\nLMT=GMT+17.8/24*Long/15.0/3600;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT of LAN in hr min sec\",LMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LMT of LAN in hr min sec [12, 3, 18.67]\nLMT of LAN in hr min sec [12, 3, 26.83]\n" + } + ], + "prompt_number": 114 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.35,Page 156" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\n#one of the 2 solution\nf0=5+1.9/60;\nn=0.25;\ndel0=0;\ndel1=-0.1;\nd2=23.0;#del1/2\n\n#calculation\nfn=f0+n*d2/60+n*(n-1)/2*(del1+del0)/60;\nfn=deg_to_dms(fn)\n\n#result\nprint \"sun declination in deg min sec\",fn", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "sun declination in deg min sec [5, 7, 39.56]\n" + } + ], + "prompt_number": 117 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.36,Page 157" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nalt=23+40.0/60;\nazi=145.0;\nlat=50.0;\n\n#calculation\ndelta=pi/2-acos(cos(pi/2-lat*pi/180)*cos(pi/2-alt*pi/180)+sin(pi/2-lat*pi/180)*sin(pi/2-alt*pi/180)*cos(azi*pi/180));\nH=acos((cos(pi/2-alt*pi/180)-cos(pi/2-lat*pi/180)*cos(pi/2-delta))/sin(pi/2-lat*pi/180)*sin(pi/2-delta))\nH=deg_to_dms(360-H*180/pi);\ndelta=deg_to_dms(delta*180/pi);\n\n#result\nprint \"there is a calculation mistake in calculating H in the book\"\nprint \"declination in deg min sec\",delta\nprint \"hour angle in deg min sec\",H", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "declination in deg min sec [-10, 3, 51.85]\nhour angle in deg min sec [325, 4, 44.11]\n" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.37,Page 158" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nalt=25+30.0/60;\nazi=45.0;\nlat=42.0;\n\n#calculation\ndelta=pi/2-acos(cos(pi/2-lat*pi/180)*cos(pi/2-alt*pi/180)+sin(pi/2-lat*pi/180)*sin(pi/2-alt*pi/180)*cos(azi*pi/180));\nH=acos((cos(pi/2-alt*pi/180)-cos(pi/2-lat*pi/180)*cos(pi/2-delta))/sin(pi/2-lat*pi/180)*sin(pi/2-delta))\nH=deg_to_dms(H*180/pi);\ndelta=deg_to_dms(delta*180/pi);\n\n#result\nprint \"declination in deg min sec\",delta\nprint \"hour angle in deg min sec\",H", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "declination in deg min sec [49, 40, 22.06]\nhour angle in deg min sec [93, 58, 30.79]\n" + } + ], + "prompt_number": 122 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.38,Page 158" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding hour angle,azimuth\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\ndelta=21.0*pi/180+25.0/60*pi/180;\nlat=25+40.0/60;\n\n#calculation\nH=acos((0-cos(pi/2-lat*pi/180)*cos(pi/2-delta))/sin(pi/2-lat*pi/180)*sin(pi/2-delta));\nA=acos(cos(pi/2-delta)/sin(pi/2-lat*pi/180));\nH=deg_to_dms(360-H*180/pi);\nA=deg_to_dms(A*180/pi);\n\n#result\nprint \"hour angle in deg min sec\",H\nprint \"azimuth in deg min sec\",A", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "hour angle in deg min sec [260, 35, 53.78]\nazimuth in deg min sec [66, 6, 4.59]\n" + } + ], + "prompt_number": 130 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.39,Page 161" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding latitude\n\n#initialisation of variable\nimport numpy as np\nfrom scipy import linalg\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\n#calculation\nA=np.array([[1,1],[1,-1]]);\nb=np.array([[90],[0]]);\nx=np.linalg.solve(A,b);\n\n#result\nprint \"latitude in degrees\",x[0]", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "latitude in degrees [ 45.]" + }, + { + "output_type": "stream", + "stream": "stdout", + "text": "\n" + } + ], + "prompt_number": 131 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.40,Page 161" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding altitude\n\n#initialisation of variable\nimport numpy as np\nfrom scipy import linalg\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\ntheta=53+20.0/60;\ndelta=53+20.0/60;\n\n#calculation\nalpha=theta+delta-90;\nalpha=deg_to_dms(alpha);\n\n#result\nprint \"altitude in deg min sec\",alpha", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "altitude in deg min sec [16, 40, 0.0]\n" + } + ], + "prompt_number": 132 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.41,Page 162" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding GAT\n\n#initialisation of variable\nimport numpy as np\nfrom scipy import linalg\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nGMT=18+30.0/60;\nET=1.0/60+25.4/3600-0.67*6.5/3600;\n\n#calculation\nGAT=GMT+ET;\nGAT=deg_to_dms(GAT)\n\n#result\nprint \"GAT in hr min sec\",GAT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "GAT in hr min sec [18, 31, 21.05]\n" + } + ], + "prompt_number": 133 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.42,Page 163" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding LMT\n\n#initialisation of variable\nimport numpy as np\nfrom scipy import linalg\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=30.0;\nGAT=13+15.0/60+10.0/3600;\nET=6.0/60+15.35/3600+0.3/3600*1.25278;\n\n#calculation\nLMT=GAT+ET-Long/15.0;\nLMT=deg_to_dms(LMT);\n\n#result\nprint \"LMT in hr min sec\",LMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LMT in hr min sec [11, 21, 25.73]\n" + } + ], + "prompt_number": 134 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.43,Page 163" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding LHA\n\n#initialisation of variable\nimport numpy as np\nfrom scipy import linalg\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nLong=45.0;\nE=11+55.0/60+5.0/3600-1.5/6*17.0/3/3600;\n\n#calculation\nGMT=14+40.0/60+Long/15.0;\nGHA=GMT+E;\nLHA=GHA-24-Long/15;\nLHA=deg_to_dms(LHA);\n\n#result\nprint \"LHA of the sun in hr min sec\",LHA\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "LHA of the sun in hr min sec [2, 35, 3.58]\n" + } + ], + "prompt_number": 135 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 4.44,Page 164" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding GMT\n\n#initialisation of variable\nimport numpy as np\nfrom scipy import linalg\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n if sd==60:\n m=m+1;\n sd=0;\n \n sd=round(sd,2)\n return [d, m, sd]\nE=11+55.0/60+24.0/3600+0.5/3600*(2+40.0/60+21.2/3600);\nGHA=8+35.0/60+45.2/3600;\n\n#calculation\nGMT=GHA+24-E;\nGMT=deg_to_dms(GMT);\n\n#result\nprint \"GMT in hr min sec\",GMT", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "GMT in hr min sec [20, 40, 19.86]\n" + } + ], + "prompt_number": 136 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Surveying_Volume_3/Chapter5.ipynb b/Surveying_Volume_3/Chapter5.ipynb new file mode 100755 index 00000000..4d4ee9e6 --- /dev/null +++ b/Surveying_Volume_3/Chapter5.ipynb @@ -0,0 +1,398 @@ +{ + "metadata": { + "name": "S3-C5" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": "Uses Of Field Astronomy in surveying" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 5.1,Page 174" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\n#printing result in degree minute and seconds respectively\nl1=11.5;\nl2=13.5;\nr1=8.5;\nr2=6.5;\nalpha=3+15.0/60+28.0/3600;\nOB=121+45.0/60+18.0/3600;\nOA=43+25.0/60+20.51/3600;\n\n#calculation\ngamma=(l1+l2)/4-(r1+r2)/4;\ne=gamma*tan(alpha*pi/180)/3600; #correction\nCH=OB-OA-e;\nCH=deg_to_dms(CH);\n\n#result\nprint \"corrected horizontal angle in deg,min,sec respectively\",CH", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "corrected horizontal angle in deg,min,sec respectively [78, 19, 57.35]\n" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 5.2,Page 184" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nalpha=30+32.0/60+18.0/3600;#latitude\nd=16.0/60+2.85/3600; #diameter of sun\n\n#calculation\nC1=-58.0/3600/tan(alpha*pi/180); \nC2=8.8/3600*cos(alpha*pi/180); \nC3=d; \nCL=alpha+C1+C2+C3;\nCL=deg_to_dms(CL);\n\n#result\nprint \"corrected latutude in deg,min,sec respectively\",CL", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "corrected latutude in deg,min,sec respectively [30, 46, 50.12]\n" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 5.3,Page 184" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nalpha=40+52.0/60+10.0/3600;#latitude\n\n#calculation\nC1=-58.0/3600/tan(alpha*pi/180);\nCL=alpha+C1;\nCL=deg_to_dms(CL);\n\n#result\nprint \"corrected latutude in deg,min,sec respectively\",CL", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "corrected latutude in deg,min,sec respectively [40, 51, 2.97]\n" + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 5.4,Page 197" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nLMT=21+23.0/60+05.0/3600; #local chronometer time\nLong=65.0+19.0/60; #longitude\nGST=13+15.0/60+20.0/3600;\nRA=9+32.0/60+15.0/3600;\nLong2=82.0+30.0/60; #longitude of India\n\n#calculation\ne1=Long/15*9.8565/3600; #error\nSIT=RA+24-GST+e1; #sidereal time interval after LMM\ne2=SIT*9.8296/3600; #error\nMI=SIT-e2; #mean interval after LMM\nLMT=LMT-(Long2-Long)/15.0;\nCE=MI-LMT;\nCE=deg_to_dms(CE);\n\n#result\nprint \"chronometer error in hours,min,sec respectively\",CE", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "chronometer error in hours,min,sec respectively [0, 0, 2.56]\n" + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 5.5,Page 198" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nMST=12+32.0/60+15.0/3600; #mean sidereal time\nRA=15+45.0/60+10.0/3600;\ntheta=55+14.0/60+20.0/3600;#latitude\ndelta=15+24.0/60+30.0/3600;#declination\nalpha=35+44.0/60+10.0/3600;#zenith deistance\n\n#calculation\nc=90-theta;\np=90-delta;\nz=90-alpha;\nH=acos(cos(z*pi/180)/sin(c*pi/180)/sin(p*pi/180)-1/(tan(p*pi/180)*tan(c*pi/180)))\nH=H/15*180/pi;\nLST=RA-H;\nCE=MST-LST;\nCE=deg_to_dms(CE);\n\n#result\nprint \"chronometer error in hours,min,sec respectively\",CE", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "chronometer error in hours,min,sec respectively [0, 0, 12.94]\n" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 5.6,Page 199" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nLMTe=6+34.0/60+18.0/3600;# LMT east\nLMTw=8+58.0/60+2.0/3600; # LMT west\nRA=16+11.0/60+25.0/3600;\nLong=125+33.0/60;\nGST=8+25.0/60+14.0/3600;\n\n#calculation\ne1=Long/15*9.8565/3600; #error\nSIT=RA-GST+e1; #sidereal time interval after LMM\ne2=SIT*9.8296/3600;\nMI=SIT-e2; #mean time interval after LMM\nLMTav=(LMTe+LMTw)/2; #mean LMT\nCE=LMTav-MI;\nCE=deg_to_dms(CE);\n\n#result\nprint \"chronometer error in slower side in hours,min,sec respectively\",CE", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "chronometer error in slower side in hours,min,sec respectively [0, 0, 6.9]\n" + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 5.7,Page 204" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nLMM=15+9.0/60+5.21/3600;# mean LMT\nGMT=10+9.0/60+3.76/3600;\nLong=75.0;#longitude\nalpha=42+30.0/60+42.0/3600;\ntheta=34+48.0/60+12.0/3600;\ndelta=15+36.0/60+48.0/3600;\n\n#calculation\nH=acos(sin(alpha*pi/180)/cos(theta*pi/180)/cos(delta*pi/180)-(tan(delta*pi/180)*tan(theta*pi/180)))\nH=H/15*180/pi;\nGAT=12+H-Long/15;\nLMT=GAT+Long/15-5.0/60-40.0/3600;\nCE=LMM-LMT;\nCE=deg_to_dms(CE);\n\n#result\nprint \"chronometer error in slower side in hours,min,sec respectively\",CE", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[0, 0, 1.45] chronometer error in slower side in hours,min,sec respectively\n" + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 5.8,Page 219" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nd=5+1.0/60+50.0/3600;\ndel1=75+14.0/60+20.0/3600;\ndel2=70+12.0/60+30.0/3600;\n\n#calculation\nk=cos(del1*pi/180)/cos(del2*pi/180);\nA2=pi/2-atan((cos(d*pi/180)-k)/sin(d*pi/180));\nA2=A2*180/pi;\nA2=120+15.0/60+10.0/3600-A2;\nCR=360-A2;\nA2=deg_to_dms(A2);\nCR=deg_to_dms(CR);\n\n#result\nprint \"azimuth of angle R in degree,minites,seconds respectively\",A2\nprint \"true bearing of CR in degree,minites,seconds respectively\",CR", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "azimuth of angle R in degree,minites,seconds respectively [100, 27, 40.0]\ntrue bearing of CR in degree,minites,seconds respectively [259, 32, 20.0]\n" + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 5.9,Page 223" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\na=26.0/60+51.0/3600;\np=56.0/60+5.1/3600;#polar distance\n\n#calculation\nH=acos(a/p);\nA=p*sin(H)/cos(30.75694*pi/180);\nCR=25+35.0/60+40.0/3600-A;\nCR=deg_to_dms(CR);\n\n#result\nprint \"azimuth of angle CR in degree,minites,seconds respectively\",CR", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "azimuth of angle CR in degree,minites,seconds respectively [24, 38, 22.01]\n" + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 5.10,Page 227 " + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nLong=75.0;#longitude\nGST=11+40.0/60+32.4/3600;\nRA=12+25.0/60+18.35/3600;\nGMT=15+45.0/60+25.3/3600;\ndelta=22+6.0/60+32.5/3600;\n\n#calculation\ne1=Long/15*9.8565/3600;\nLSTofLMM=GST-e1;\nLMT=GMT+Long/15;\nSIT=LMT+LMT*9.8565/3600;#sidereal time interval\nLHA=SIT+LSTofLMM;\nH=RA+24-LHA;\nH=H*15;\nB=atan(tan(delta*pi/180)*tan(H*pi/180));\nB=B*180/pi;\nA=atan(tan(H*pi/180)*cos(B*pi/180)/sin((B-32-15.0/60)*pi/180))\nA=A*180/pi;\nTB=360+A-135-15.0/60-20.0/3600;\nTB=deg_to_dms(TB);\n\n#result\nprint \"true bearing TB in degree,minites,seconds respectively\",TB\nprint \"there is slight difference in the answers due to rounding off error in the book\"", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "true bearing TB in degree,minites,seconds respectively [313, 17, 36.07]\nthere is slight difference in the answers due to rounding off error in the book\n" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 5.11,Page 237" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nz=51+47.0/60+18.0/3600;#zenith distance\np=88+57.0/60+57.0/3600;#polar distance\nc=61+27.0/60+55.0/3600;#co-latitude\n\n#calculation\ns=(z+p+c)/2;\nA=2*atan(sqrt(sin((s-z)*pi/180)/sin(s*pi/180)*sin((s-c)*pi/180)/sin((s-p)*pi/180)));\nA=A*180/pi;\nTB=360-A-165-18.0/60-20.0/3600;\nTB=deg_to_dms(TB);\n\n#result\nprint \"true bearing TB in degree,minites,seconds respectively\",TB", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "true bearing TB in degree,minites,seconds respectively [80, 59, 47.52]\n" + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 5.12,Page 241" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#finding latitude\n\n#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nz2=90-40-13.0/60-15.0/3600;\ndel2=12+15.0/60+30.0/3600;#declination of star\n\n#calculation\ntheta=z2+del2;\ntheta=deg_to_dms(theta);\n\n#result\nprint \"altitude in degree,minites,seconds respectively\",theta", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "altitude in degree,minites,seconds respectively [62, 2, 15.0]\n" + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 5.13,Page 244" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nalpha1=30+45.0/60+25.0/3600;\nalpha2=40+48.0/60+30.0/3600;\n\n#calculation\ne1=-58/3600/tan(alpha1*pi/180); #error 1\ne2=-58/3600/tan(alpha2*pi/180); #error 2\ntheta=(alpha1+alpha2+e1+e2)/2;\ntheta=deg_to_dms(theta)\n\n#result\nprint \"latitude in degree,minites,seconds respectively\",theta", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "latitude in degree,minites,seconds respectively [34, 21, 48.1]\n" + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 5.14,Page 258" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nZP=37+29.0/60+40.0/3600;#colatitde\nZM=56+24.0/60+50.0/3600;#coaltitude\nPM=67+54.0/60+24.0/3600;#codeclination\n\n#calculation\nA1=acos((cos(PM*pi/180)-cos(ZP*pi/180)*cos(ZM*pi/180))/(sin(ZP*pi/180)*sin(ZM*pi/180)));\nA1=A1*180/pi;\nA=360-A1;\nA=deg_to_dms(A);\n\n#result\nprint \"azimuth of sun in degree,minites,seconds respectively\",A", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "azimuth of sun in degree,minites,seconds respectively [262, 53, 12.16]\n" + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 5.15,Page 259" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\ntheta=54+30.0/60;#latitude\ndelta=62+12.0/60+21.0/3600;#declination\n\n#calculation\nalpha=asin(sin(theta*pi/180)/sin(delta*pi/180));\nA1=acos(tan(theta*pi/180)/tan(alpha));\nA1=A1*180/pi;\nTB=360-A1-65-18.0/60-42.0/3600;\nTB=deg_to_dms(TB);\nalpha=deg_to_dms(alpha*180/pi);\nH=atan(tan(theta*pi/180)/tan(delta*pi/180));\nH=deg_to_dms(H*180/pi);\n\n#result\nprint \"true bearing in degree,minites,seconds respectively\",TB\nprint \"altitude in degree,minites,seconds respectively\",alpha\nprint \"hour angle in degree,minites,seconds respectively\",H", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "true bearing in degree,minites,seconds respectively [241, 16, 19.55]\naltitude in degree,minites,seconds respectively [66, 58, 7.13]\nhour angle in degree,minites,seconds respectively [36, 27, 49.32]\n" + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 5.16,Page 261" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nalpha=44+12.0/60+30.0/3600;\nd=15.0/60+45.86/3600;#diameter correction\nLong=7+20.0/60+15.0/3600;#longitude\n\n#calculation\nalpha=alpha+d-58/3600/tan(alpha)+8.8/3600*cos(alpha);\nGAT=Long/15;\ne2=6.82/3600*GAT;\ndelta=22+18.0/60+12.8/3600+e2;\ntheta=delta+90-alpha;\ntheta=deg_to_dms(theta);\n\n#result\nprint \"altitude in degree,minites,seconds respectively\",theta", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[67, 49, 51.7] altitude in degree,minites,seconds respectively\n" + } + ], + "prompt_number": 47 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 5.17,Page 262" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nGMT=16+22.0/60+55.0/3600;\nET=3.0/60+43.0/3600;\nc=90-42-20.0/60;\np=90-18-45.0/60-50.0/60;\nz=90-43-38.0/60;\n\n#calculation\nH=acos(cos(z*pi/180)/sin(c*pi/180)/sin(p*pi/180)-1/tan(c*pi/180)*1/tan(p*pi/180));\nH=H*180/pi;\nLAT=12-H/15;\nLMT=LAT-ET;\nLong=GMT-LMT;\nLong=Long*15;\nLong=deg_to_dms(Long);\n\n#result\nprint \"Longitude in degree,minites,seconds respectively\",Long", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Longitude in degree,minites,seconds respectively [114, 50, 53.21]\n" + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 5.18,Page 263" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,tan,sqrt,sin,cos,acos,atan,asin\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nalpha=21+35.0/60+30.0/3600;#mean observed altitude\nC=(4.5+5.5-3.5-2.5)/4*15.0/3600;\nc=44+30.0/60;#colatitude\nz=68+26.0/60+34.0/3600;#coaltitude\np=94+4.0/60+15.0/3600;#codeclination\ns=(c+p+z)/2;\n\n#calculation\ncr=-58/3600/tan(alpha);#correction refraction\ncp=8.8/3600*cos(alpha);#correction parallax\nalpha=alpha+C+cr+cp; #corrected altitude\nA=2*atan(sqrt(sin((s-z)*pi/180)/sin(s*pi/180)*sin((s-c)*pi/180)/sin((s-p)*pi/180)));\nA=A*180/pi;\nMh=(121+45.0/60+20.0/3600+122+47.0/60)/2;#mean horizontal angle\nAZ=360-Mh-A;\nAZ=deg_to_dms(AZ);\n\n#result\nprint \"Azimuth from north(clockwise) in degree,minites,seconds respectively\",AZ", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "[117, 0, 19.45] Azimuth from north(clockwise) in degree,minites,seconds respectively\n" + } + ], + "prompt_number": 55 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Surveying_Volume_3/Chapter6.ipynb b/Surveying_Volume_3/Chapter6.ipynb new file mode 100755 index 00000000..3fb19c9c --- /dev/null +++ b/Surveying_Volume_3/Chapter6.ipynb @@ -0,0 +1,629 @@ +{ + "metadata": { + "name": "S3-C6" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": "Photogrammetry" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.1,Page 281" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nDa=184.32;\nDb=95.84;\nAx=-115.0\nBy=-115.0;\n\n#calculation\nphi=atan(Ax/By);\nAB=sqrt(Ax**2+By**2);\ntheta=acos((Da**2+AB**2-Db**2)/2/Da/AB);\nalpha=phi-theta;\nxc=Da*cos(alpha)-115.0;\nyc=-Da*sin(alpha);\n\n#result\nprint \"the coordiantes in mm x is\",round(xc),\"y is\",round(yc,2)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "the coordiantes in mm x is 64.0 y is -43.72\n" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.2,Page 290" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nf=0.152;\nH=1800;#elevation of topmost point\nh=300;#elevation of ground\n\n#calculation\nS=f/(H-h);\n\n#result\nprint \"scale of photograph in 1 in\",round(1/S)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "scale of photograph in 1 in 9868.0\n" + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.3,Page 290" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nf=0.150 #focal length\nh1=1500.0;#elevation A\nh2=1200.0;#elevation B\nh3=1000.0;#elevation C\nH=3000.0;#height\n\n#calculation\nhav=1.0/3*(h1+h2+h3);\nS1=f/(H-h1);\nS2=f/(H-h2);\nS3=f/(H-h3);\nSav=f/(H-hav);\n\n#result\nprint \"scale of point 1 in 1 in\",round(1/S1);\nprint \"scale of point 2 in 1 in\",round(1/S2);\nprint \"scale of point 3 in 1 in\",round(1/S3);\nprint \"average scale in 1 in\",round(1/Sav);", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "scale of point 1 in 1 in 10000.0\nscale of point 2 in 1 in 12000.0\nscale of point 3 in 1 in 13333.0\naverage scale in 1 in 11778.0\n" + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.4,Page 292" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nab=188.0;\nAB=120;\nSm=1.0/20000;\n\n#calculation\nS=ab/AB*Sm;\n\n#result\nprint \"scale of photograph in 1 in\",round(1/S)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "scale of photograph in 1 in 12766.0\n" + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.5,Page 295" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nxa=45.35;\nxb=-40.16;\nf=152.4;#focal length\nH=1500.0;#actual height\nha=200.0;#height A\nhb=150.0;#height B\nya=38.41;\nyb=-45.65;\n\n#calculation\nXa=xa*(H-ha)/f;\nYa=ya*(H-hb)/f;\nXb=xb*(H-ha)/f;\nYb=yb*(H-hb)/f;\nAB=sqrt((Xb-Xa)**2+(Yb-Ya)**2);\n\n#result\nprint \"distance of AB in m\",round(AB,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "distance of AB in m 1042.361\n" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.6,Page298" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nd=62.4;#displacement\nH=250.0;#height of datum\nr=115.4;#image distance\n\n#calculation\nh=H*d/r;\n\n#result\nprint \"height of chimney in m\",round(h,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "height of chimney in m 135.182\n" + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.7,Page 299" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nra=88.25;#image distance of A\nrb=81.23;#image distance of B\nrc=68.14;#image distance of C\nH=2000.0;\nha=255;\nhb=200;\nhc=145;\nf=0.1524;\n\n#calculation\naa=ra*ha/H;\nbb=rb*hb/H;\ncc=rc*hc/H;\nS=f/H;\n\n#result\nprint \"relief distance of A in mm\",round(aa,2)\nprint \"relief distance of B in mm\",round(bb,2)\nprint \"relief distance of C in mm\",round(cc,2)\nprint \"scale of photograph in 1 in\",round(1/S)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "relief distance of A in mm 11.25\nrelief distance of B in mm 8.12\nrelief distance of C in mm 4.94\nscale of photograph in 1 in 13123.0\n" + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.8,Page 300" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nf=0.1524;#focal length\nS=0.08251/1000;#scale\n\n#calculation\nH=f/S;\n\n#result\nprint \"flying height in m\",round(H,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "flying height in m 1847.049\n" + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.9,Page 300" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nimport numpy as np\n\n#solving the quadratic polynomial in H\n#0=0.4064-365.929H-289685.07\ncoeff=[0.4064, -365.929,-289685.926];\nH=np.roots(coeff);\n\n#result\nprint \"height required in m\",round(H[0],2)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "height required in m 1407.02\n" + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.10,Page 309" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nS=1.0/10000;#scale\nA=500.0;#area\npw=0.3;\nl=0.23;\nw=0.23;\n\n#calculation\na=(1-0.6)*(1-pw)*l*w/S**2/1000/1000;\nN=A/a;\n\n#result\nprint \"no. of photographs taken\",round(N)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "no. of photographs taken 338.0\n" + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.11,Page 310" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nL=25.0e3;\nk=0.23e4;#l/s=w/s;\npl=0.6;\npw=0.3;\nW=20.0e3;\n\n#calculation\nN=((L/((1-pl)*k)+1))*((W/((1-pw)*k)+1)+1);\n\n#result\nprint \"no. of photographs taken\",round(N)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "no. of photographs taken 406.0\n" + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.12,Page 310" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nf=0.1524;#focal length\nS=1.0/10000;#scale\npw=0.3;#side lap\nw=0.23;#format width\npl=0.6;\nl=0.23;\n\n#calculation\nW=(1-pw)/S*w;\nH=f/S+300;\nN2=30/W+1;\nN2=round(N2)\nL=(1-pl)*1/S*l/1000;\nT=3600*L/240.0;\nAd=T*240e3/60.0/60.0;#adjusted ground distance\nN1=40.0e3/Ad+1;\nN1=round(N1)\nN=N1*N2;\n\n#result\nprint \"height over datum in m\",H\nprint \"no. of flight strips\",round(N2-1)\nprint \"length of each photograph cover in km\",round(L,3)\nprint \"exposure time in s\",round(T)\nprint \"no. of photographs taken\",round(N)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "height over datum in m 1824.0\nno. of flight strips 0.0\nlength of each photograph cover in km 0.92\nexposure time in s 14.0\nno. of photographs taken 44.0\n" + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.12b,Page 317" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nt=3.0/180*pi;\nya=82.25;\nxa=-62.45;\ns=220;\nf=152.4;#focal length\nH=2500.0e3;\nh=500.0e3;\n\n#calculation\ntheta=s-180;\nya_dash=xa*sin(theta*pi/180)+ya*cos(theta*pi/180)+f*tan(t)\nS=(f/cos(t)-ya_dash*sin(t))/(H-h);\n\n#result\nprint \"scale of photograph in 1 in\",round(1/S)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "scale of photograph in 1 in 13246.0\n" + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.13,Page 319" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nt=3*pi/180;\nxa=-62.45;\nxb=78.25;\nf=152.4;#focal length\nH=2500.0;#actual height\nhb=800#height B\nha=500.0;#height A\nya=82.25;\nyb=-41.15;\ns=220.0;\n\n#calculation\ntheta=s-180;\nya1=xa*sin(theta*pi/180)+ya*cos(theta*pi/180)+f*tan(t); # ya'\nxa1=xa*cos(theta*pi/180)-ya*sin(theta*pi/180); #xa'\nxb1=xb*cos(theta*pi/180)-yb*sin(theta*pi/180); #xb'\nyb1=xb*sin(theta*pi/180)+yb*cos(theta*pi/180)+f*tan(t); # yb'\nXa=xa1*(H-ha)/(f/cos(t)-ya1*sin(t));\nXb=xb1*(H-hb)/(f/cos(t)-yb1*sin(t));\nYa=ya1*cos(t)*(H-ha)/(f/cos(t)-ya1*sin(t));\nYb=yb1*cos(t)*(H-hb)/(f/cos(t)-yb1*sin(t));\nAB=sqrt((Xb-Xa)**2+(Yb-Ya)**2);\n\n#result\nprint \"distance of AB in m\",round(AB,3)\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "distance of AB in m 2307.753\n -100.708756369 78.25 82.25 -41.15 0.642787609687\n" + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.14,Page 324" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nri=95.0;\nf=152.4;\nt=3*pi/180;\nl=50*pi/180;\n\n#calculation\ndt=ri**2*sin(t)*cos(l)**2/(f-ri*sin(t)*cos(l));\n \n#result\nprint \"tilt displacement of the image in mm\",round(dt,2)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "tilt displacement of the image in mm 1.31\n" + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.15,Page 351" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nd=230.0;#square side\nf=152.4#focal length\npl=0.6;\n\n#calculation\nk=(1-pl)*d/f;\nV=k/0.15;\n\n#result\nprint \"vertical exaggeration is\",round(V,2)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "vertical exaggeration is 4.02\n" + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.16,Page 360" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nxa=51.23;\nxb=91.48;\nya=48.33;\nyb=-51.63;\nf=152.4;#focal length\nB=425.0;#actual height\nhb=842.86#height B\nha=820.97;#height A\nr1=10.42;\nr2=9.67;\nb1=89.12;#b'\nb=89.43;\nra=11.62;\nrb=14.53;\n\n#calculation\nC=0.5*((b1-r1)+(b-r2))\npa=C+ra;\npb=C+rb;\nXa=B*xa/pa;\nXb=xb*B/pb;\nYa=ya*B/pa;\nYb=yb*B/pb;\nAB=sqrt((Xb-Xa)**2+(Yb-Ya)**2);\n\n#result\nprint \"distance of AB in m\",round(AB,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "distance of AB in m 492.28\n" + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.17,Page 363" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nC=79.0;\nra=11.42;#elevarion in image\nrb=15.65;#elevarion in image\nhb=651;#height of B\nH=1500;#height\n\n#calculation\ndelp=ra-rb;#pa=ra+c and pb=rb+c so ra-rb=pa-pb\npa=ra+C;\nha=hb+delp/pa*(H-hb);\n\n#result\nprint \"height of A in m\",round(ha,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "height of A in m 611.282\n" + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.18,Page 364" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nB=741.0;\nf=152.4;\npa=94.32;\nha=325;\n\n#calculation\nH=ha+B*f/pa;\n\n#result\nprint \"height in m\",round(H,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "height in m 1522.29\n" + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.19,Page 364" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nH=1632.0;\nf=152.4;#focal length\npa=82.75;\nha=283;\n\n#calculation\nB=pa/f*(H-ha);\n\n#result\nprint \"width of air base in m\",round(B,3)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "width of air base in m 732.479\n" + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.20,Page 377" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nalpha=50.0;\nbeta=46.0;\nf=300.0;\nxa=24.0;\nxb=30.0;\nbeta=46.0;\n\n#calculation\ndela=xa/f;\ndelb=xb/f;\nA=alpha+dela*180/pi; #angle A\nB=beta-delb*180/pi; #angle B\nD=180-A-B;\nAD=1300.0*sin(B*pi/180)/sin(D*pi/180);\nY=6/(sqrt(xa**2+f**2))*AD;\nRD=60.12+Y;\n\n#result\nprint \"distance of AD in m\",round(AD,2)\nprint \"RL of D in m\",round(RD,2)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "distance of AD in m 843.34\nRL of D in m 76.93\n" + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.21,Page 378" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nf=152.4;\nL=120;#length\nx1=40.0;\nx2=-90.0;\n\n#calculation\nX=f*L/(x1-x2);\nY=L*x1/(x1-x2);\nh=X*(30-20)/f;\n\n#result\nprint \"the coordinates of D in m is X=\",round(X,2),\"Y =\",round(Y,2);\nprint \"elevation of D in m\",round(h,2)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "the coordinates of D in m is X= 140.68 Y = 36.92\nelevation of D in m 9.23\n" + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.22,Page 380" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nf=150.4;\nxc=-32.43;\nxd=9.52;\n\n#calculation\nthc=atan(xc/f);\nthd=atan(xd/f);\nth=thd-thc;\nth=th*180/pi;\nAz=325+15.0/60+th;\nAz=deg_to_dms(Az);\n\n#result\nprint \"Azimuth of D in deg,min,sec respectively\",Az", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "Azimuth of D in deg,min,sec respectively [341, 2, 23.9]\n" + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.23,Page 382" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nBC=66.0;\nAC=81.6;\nxb=3.0;\nya=1.25;\nxa=3.3;\ntheta=23+43.0/60;\n\n#calcualtions\nf=(xa+xb)/2/tan(theta*pi/180)+sqrt((xa+xb)**2/4/(tan(theta*pi/180))**2+xa*xb);\naa=atan(ya/sqrt(xa**2+f**2))\nVa=AC*tan(aa);\nab=atan(-1.87/sqrt(xa**2+f**2));\nVb=-BC*tan(ab);\n\n#result\nprint \"focal length in cm\",round(f,2)\nprint \"horizontal distance in m\",round(Vb+Va,2)\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "focal length in cm 15.0\nhorizontal distance in m 14.68\n" + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.24,Page 383" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nEab=300.0;#average elevation\nf=152.4;\nxa=28.4;\nxb=-22.5;\nya=24.5;\nyb=38.4;\nHa=2322.0;\nha=400.0;\nhb=200.0;\nab=61.05;\nAB=810;\n\n#calculation\nHa=300+AB/ab*f;\nXa=round((Ha-ha)/f*xa,2);\nXb=round((Ha-ha)/f*xb,2);\nYa=round((Ha-hb)/f*ya,2);\nYb=round((Ha-hb)/f*yb,2);\nAB=sqrt((Xa-Xb)**2+(Ya-Yb)**2);\nH=300+810/AB*(Ha-Eab);\nXa=(H-ha)/f*xa;\nXb=(H-ha)/f*xb;\nYa=(H-hb)/f*ya;\nYb=(H-hb)/f*yb;\nAB1=sqrt((Xa-Xb)**2+(Ya-Yb)**2);\n\n#result\nprint \"Xb is calculated wrong in the book that resulted in the error\"\nprint \"length AB in m\", round(AB,2)\nprint \"corrected length AB in m\", round(AB1,2)\nprint \"flying height in m\",round(H,3)\n\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "length AB in m 670.47\ncorrected length AB in m 816.12\nflying height in m 2742.807\n" + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.25,Page 386" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nAB=300.0;\nab=102.4;\nf=152.4;#focal length\nhab=320.0;\nd=7.8;\nr=75.4;\n\nH=hab+AB/ab*f;\nh=d*H/r;\n\n#result\nprint \"height difference in m\",round(h,2)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "height difference in m 79.29\n" + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.26,Page 386" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nf=152.4;\nb=74.25;\nht=100.0;\nH=700.0;#flying height\n\n#calculation\nB=b*H/f;\npb=f*B/H;\npt=f*B/(H-ht);\ndelp=pt-pb;\nht=delp/pt*(H);\n\n#result\nprint \"error due to parallax in mm\",round(delp,2)\nprint \"height of chimney in m\",round(ht,2)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "error due to parallax in mm 12.38\nheight of chimney in m 100.0\n" + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.27,Page 387" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\ndef deg_to_dms(deg):\n d = int(deg)\n md = abs(deg - d) * 60\n m = int(md)\n sd = (md - m) * 60\n sd=round(sd,2)\n return [d, m, sd]\nB=180.0;\nf=120.0;\npa=54.32\npb=46.35;\n\n#calculation\ndelH=B*f/pa/pb*(pa-pb);\n\n#result\nprint \"height difference in m\",round(delH,2)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "height difference in m 68.38\n" + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example 6.28,Page 387" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#initialisation of variable\nfrom math import pi,sqrt,acos,asin,atan,cos,sin,tan\nL1=30000.0;\npl=0.6;\nk=12000.0*0.2;#=l/S and w/S\npw=0.3;\nW1=24000;\n\n#calculation\nN=round(((L1/((1-pl)*k)+1)+1))*round(((W1/((1-pw)*k)+1)+1));\nNf=N/33-1;#flight strips\ngd=(1-pl)*k;#grounf distance\nI=gd/(200e3)*60.0*60.0;#exposure interval\nad=round(I)/60.0/60*200e3;#actual distance\n\n#result\nprint \"no. of photographs taken\",round(N)\nprint \"no. of flight strips\",Nf\nprint \"ground distance in m\",round(gd,2)\nprint \"exposure interval in s\", round(I)\nprint \"actual distance in m\",round(ad,2)", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "no. of photographs taken 528.0\nno. of flight strips 15.0\nground distance in m 960.0\nexposure interval in s 17.0\nactual distance in m 944.44\n" + } + ], + "prompt_number": 35 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Surveying_Volume_3/README.txt b/Surveying_Volume_3/README.txt new file mode 100755 index 00000000..2c27e6c8 --- /dev/null +++ b/Surveying_Volume_3/README.txt @@ -0,0 +1,10 @@ +Contributed By: Tarun Kumar Das +Course: btech +College/Institute/Organization: College of Engineering +Department/Designation: Industrial Engineering +Book Title: Surveying Volume 3 +Author: A K Arora +Publisher: Lakshmi Publications, Chennai +Year of publication: 2011 +Isbn: 9788189401276 +Edition: 1
\ No newline at end of file diff --git a/Surveying_Volume_3/screenshots/chapter1.png b/Surveying_Volume_3/screenshots/chapter1.png Binary files differnew file mode 100755 index 00000000..14135a76 --- /dev/null +++ b/Surveying_Volume_3/screenshots/chapter1.png diff --git a/Surveying_Volume_3/screenshots/chapter4.png b/Surveying_Volume_3/screenshots/chapter4.png Binary files differnew file mode 100755 index 00000000..ad0a4bc9 --- /dev/null +++ b/Surveying_Volume_3/screenshots/chapter4.png diff --git a/Surveying_Volume_3/screenshots/chapter5.png b/Surveying_Volume_3/screenshots/chapter5.png Binary files differnew file mode 100755 index 00000000..bd0c856e --- /dev/null +++ b/Surveying_Volume_3/screenshots/chapter5.png diff --git a/Thermodynamics_by_F_P_Durham/README.txt b/Thermodynamics_by_F_P_Durham/README.txt new file mode 100755 index 00000000..f88f2e55 --- /dev/null +++ b/Thermodynamics_by_F_P_Durham/README.txt @@ -0,0 +1,10 @@ +Contributed By: Pratik Tanna +Course: bca +College/Institute/Organization: CZMG BCA, Jamnagar +Department/Designation: BCA +Book Title: Thermodynamics by F P Durham +Author: F. P. Durham +Publisher: Prentice Hall +Year of publication: 1959 +Isbn: 1105809269 +Edition: 2nd
\ No newline at end of file diff --git a/Thermodynamics_by_F_P_Durham/chapter10.ipynb b/Thermodynamics_by_F_P_Durham/chapter10.ipynb new file mode 100755 index 00000000..c9d863da --- /dev/null +++ b/Thermodynamics_by_F_P_Durham/chapter10.ipynb @@ -0,0 +1,164 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:290fc441b8b16bf79982880c80bb6a81fed30d12de1c6a3c7f5a66a567e435bd" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 10: Refrigeration" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.1, page no. 193" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "capacity = 5.0 #tons\n", + "hp = 10.0 #hp\n", + "\n", + "#calculation\n", + "beta = (778*3.33*capacity)/(hp*550)\n", + "\n", + "#result\n", + "print \"Coefficient of performance = \", round(beta, 2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Coefficient of performance = 2.36\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.2, page no. 197" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "P1 = 30.0 #lb/in^2\n", + "P2 = 200.0 #lb/in^2\n", + "capacity = 3.0 #tons\n", + "\n", + "#calculation\n", + "#From the pressure enthalpy chart\n", + "Tt1 = -1 #F\n", + "st1 = 1.34\n", + "ht1 = 612.0\n", + "ht2 = 733.0\n", + "ht3 = 141.0\n", + "ht4 = 141.0\n", + "WbyJ = ht2-ht1\n", + "Q = ht1-ht3\n", + "beta = Q/WbyJ\n", + "Qdot = capacity*3.33\n", + "wdot = Qdot/Q\n", + "Power = wdot*778*WbyJ\n", + "Power = Power/550.0\n", + "\n", + "#result\n", + "print \"Coefficient of performance = \", round(beta, 2)\n", + "print \"Evarator temperature = %d F\" %Tt1\n", + "print \"Power required = %.2f hp\" %Power\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Coefficient of performance = 3.89\n", + "Evarator temperature = -1 F\n", + "Power required = 3.63 hp\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.3, page no. 200" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "P1 = 14.0 #lb/in^2\n", + "P2 = 60.0 #lb/in^2\n", + "Tt1 = 80+460.0 #R\n", + "Tt4 = -20+460.0 #R\n", + "m = 30.0 #lbm/sec\n", + "cp = 0.24\n", + "\n", + "#calculation\n", + "Tt2 = round(Tt1*(P2/P1)**(0.286))\n", + "Tt3 = round(Tt4*(P2/P1)**(0.286))\n", + "WbyJ1 = cp*(Tt2-Tt1)\n", + "WbyJ2 = cp*(Tt3-Tt4)\n", + "Q = cp*(Tt1-Tt4)\n", + "beta = Q/(WbyJ1-WbyJ2)\n", + "Power = (m*778)*(WbyJ1-WbyJ2)\n", + "Wdot = Power/550.0\n", + "\n", + "#result\n", + "print \"Coefficient of performance = %.3f\" %beta\n", + "print \"Net power = %d hp\" %Wdot\n", + "\n", + "#difference in answer due to rounding of in Python" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Coefficient of performance = 1.923\n", + "Net power = 529 hp\n" + ] + } + ], + "prompt_number": 24 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_F_P_Durham/chapter11.ipynb b/Thermodynamics_by_F_P_Durham/chapter11.ipynb new file mode 100755 index 00000000..ddbbdc4c --- /dev/null +++ b/Thermodynamics_by_F_P_Durham/chapter11.ipynb @@ -0,0 +1,484 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:1bc460ef0aed5b06b0770ef04462064cc24e898eb90d5d0126bc2216d06cd7e0" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 11: Nozzels & Jet Propulsion" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.1, page no. 207" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "\n", + "#initialization\n", + "P1 = 100.0 #lb/in^2\n", + "P2 = 14.7 #lb/in^2\n", + "T1 = 600+460.0 #R\n", + "T2 = 300+460.0 #R\n", + "area = 1.0 #in^2\n", + "\n", + "#calculation\n", + "#From steam tables\n", + "ht1 = 1329.1 \n", + "h2 = 1192.8\n", + "v2 = 30.53\n", + "Vel = math.sqrt(2*32.2*778.0*(ht1-h2))\n", + "\n", + "wdot = area*Vel/(144*v2)\n", + "\n", + "\n", + "#result\n", + "print \"Exit velocity = %d ft/sec\" %Vel\n", + "print \"Mass flow rate = %.3f lbm/sec\" %wdot\n", + "#difference in exit velocity due to rounding off in Python" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Exit velocity = 2613 ft/sec\n", + "Mass flow rate = 0.594 lbm/sec\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.2, page no. 210" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#initialization\n", + "Pt1 = 100.0 #lb/in^2\n", + "P2 = 15.0 #lb/in^2\n", + "A = 1.0 #in^2\n", + "T = 500+460.0 #F\n", + "gamma = 1.4\n", + "\n", + "#calculation\n", + "Pratio = P2/Pt1\n", + "r1 = (P2/Pt1)**((gamma-1)/gamma)\n", + "r2 = (P2/Pt1)**(2/gamma)\n", + "r3 = (P2/Pt1)**((gamma+1)/gamma)\n", + "V2 = math.sqrt(2*gamma*32.2*53.3*T*(1-r1)/(gamma-1))\n", + "wdot = A*Pt1*math.sqrt(2*gamma*(r2-r3)/(gamma-1)) /(math.sqrt(53.3*T/32.2))\n", + "\n", + "#result\n", + "print \"Exit velocity = %d ft/sec\" %V2\n", + "print \"Mass flow rate = \", round(wdot, 3), \"lbm/sec\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Exit velocity = 2196 ft/sec\n", + "Mass flow rate = 1.107 lbm/sec\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.3, page no. 212" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#initialization\n", + "Pt1 = 100.0 #lb/in^2\n", + "Tt1 = 960.0 #RP2 = 15 #lb/in^2\n", + "wdot = 1.13 #lbm/sec\n", + "gamma = 1.4\n", + "\n", + "#calculation\n", + "Pstar = Pt1*(2/(1+gamma))**(gamma/(gamma-1))\n", + "Tstar = Tt1*(2/(1+gamma))\n", + "Vstar = math.sqrt(gamma*32.2*53.3*Tstar)\n", + "vstar = 53.3*Tstar/(144*Pstar)\n", + "Astar = wdot*vstar*144/Vstar\n", + "\n", + "#result\n", + "print \"Ideal throat area = \", round(Astar,3), \"in^2\"\n", + "print \"Ideal pressure = \", round(Pstar, 1), \"lb/in^2\"\n", + "print \"Ideal temperature = %d R\" %Tstar\n", + "print \"Ideal throat specific volume = \", round(vstar, 1), \"ft^3/lbm\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Ideal throat area = 0.658 in^2\n", + "Ideal pressure = 52.8 lb/in^2\n", + "Ideal temperature = 800 R\n", + "Ideal throat specific volume = 5.6 ft^3/lbm\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.4, page no. 215" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "\n", + "#initialization\n", + "ht1 = 1329.1\n", + "st1 = 1.7581\n", + "h2s = 1151.4\n", + "s2s = 1.7581\n", + "\n", + "#calculation\n", + "eta = math.sqrt((ht1-1192.8)/(ht1-h2s))\n", + "\n", + "#result\n", + "print \"efficiency = \", round(eta, 2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "efficiency = 0.88\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.5, page no. 216" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initializaiton\n", + "v = 2200.0 #exit velocity from ex. 11.2\n", + "p = 15.0 #exit pressure\n", + "n_eta = 0.95 #nozzle efficiency 95%\n", + "t2 = 598.0\n", + "\n", + "#calculations\n", + "V2 = n_eta*v\n", + "v = (53.3*t2)/(144.0*p)\n", + "w = (1.0*V2)/(144.0*v)\n", + "\n", + "print \"Volume at exit \", round(v, 1), \"ft^3/lbm\"\n", + "print \"The mass flow is \", round(w, 3), \"lbm/sec\"\n", + "#difference in answers due to rounding off in Python, check manually" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Volume at exit 14.8 ft^3/lbm\n", + "The mass flow is 0.984 lbm/sec\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.6, page no. 219" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "v = 500.0 #ft/sec\n", + "P = 14.7 #lb/in^2\n", + "T = 60+460.0 #R\n", + "eta = 0.85\n", + "cp = 0.24\n", + "gamma = 1.4\n", + "\n", + "#calculation\n", + "Pt2 = eta*P*(1+ (gamma-1)*v**2 /(2*gamma*32.2*53.3*T))**(gamma/(gamma-1))\n", + "Tratio = 1+(gamma-1)*v*v/(2*gamma*32.2*53.3*T)\n", + "Tt2 = T*Tratio\n", + "\n", + "#result\n", + "print \"Exit stagnation temperature = %d R\" %(Tt2+1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Exit stagnation temperature = 541 R\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.7, page no. 222" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#initialization\n", + "P = 30.0 #lb/in^2\n", + "T = 1000+460.0 #R\n", + "Pd = 14.7 #lb/in^2\n", + "w = 60.0 #lbm/sec\n", + "eta = 0.95 #percent\n", + "R = 53.3\n", + "gamma = 1.35\n", + "cp = 0.264\n", + "\n", + "#calculation\n", + "V2s = math.sqrt(2*gamma*32.2*53.3*T*(1-(Pd/P)**(0.259))/(gamma-1))\n", + "V2 = eta*V2s\n", + "Fn = w*(V2)/32.2\n", + "\n", + "#result\n", + "print \"Thrust of the engine = %d ft/sec\" %Fn\n", + "\n", + "#difference due to +5 in V2s calculation while sqrt" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thrust of the engine = 3196 ft/sec\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.8, page no. 226" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#initialization\n", + "v = 600.0 #ft/sec\n", + "T = 60+460.0 #R\n", + "P = 14.7 #lb/in^2\n", + "Pratio = 6.0\n", + "Tin = 1540+460.0 #R\n", + "cp = 0.264\n", + "cpratio = 1.35\n", + "\n", + "#calculation\n", + "Pt2byP1 = (1+(cpratio-1)*v**2/(cpratio*2*32.2*53.3*T))**(3.86)\n", + "Pt3byP1 = Pt2byP1*Pratio\n", + "eta = 1-1/(Pt3byP1)**0.259\n", + "Tt3 = T*(Pt3byP1)**((cpratio-1)/cpratio)\n", + "Q = cp*(Tin-Tt3)\n", + "V6 = math.sqrt(eta*2*32.2*778*Q + v**2)\n", + "Fn = (V6-v)/32.2\n", + "\n", + "#resullts\n", + "print \"Thermal efficiency = \", round(eta, 3)\n", + "print \"thrust per pound of air per sec = \", round(Fn, 1), \"lb-sec/lbm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 0.403\n", + "thrust per pound of air per sec = 59.8 lb-sec/lbm\n" + ] + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.9, page no. 229" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "V = 1000.0 #mph\n", + "P = 14.7 #lb/in^2\n", + "T = 60.0 #F\n", + "g = 1.4\n", + "\n", + "#calculation\n", + "\n", + "V1 = V*(88/T)\n", + "Pratio = (1+ (g-1)*V1**2 /(2*g*32.2*53.3*(T+460)))**(g/(g-1))\n", + "eta = 1-1/(Pratio)**0.286\n", + "\n", + "#result\n", + "print \"Theoretical cycle efficiency = \", round(eta, 3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Theoretical cycle efficiency = 0.256\n" + ] + } + ], + "prompt_number": 29 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.10, page no. 230" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#initialization\n", + "P = 300.0 #lb/in^2\n", + "P2 = 14.7 #lb/in^2\n", + "T = 4540+460.0 #R\n", + "w = 100.0 #lbm/sec\n", + "g = 1.25\n", + "MW = 30.0\n", + "R = 1544.0\n", + "\n", + "#calculation\n", + "R = R/MW\n", + "Pratio = P2/P\n", + "V4 = math.sqrt(2*g*32.2*51.5*T*(1-(Pratio)**((g-1)/g))/(g-1)) \n", + "Fn = w*V4/32.2\n", + "\n", + "#result\n", + "print \"Thrust = %d lb\" %Fn" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thrust = 19031 lb\n" + ] + } + ], + "prompt_number": 30 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_F_P_Durham/chapter12.ipynb b/Thermodynamics_by_F_P_Durham/chapter12.ipynb new file mode 100755 index 00000000..466838d2 --- /dev/null +++ b/Thermodynamics_by_F_P_Durham/chapter12.ipynb @@ -0,0 +1,543 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:369d727c64e74475d8c5bb63540cbc246cbdecc5bfe067dfd2c4f31c8ec059a2" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 12: Mixtures" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.1, page no 235" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "w1 = 2 #lbm\n", + "w2 = 1 #lbm\n", + "P = 30 #lbm/in^2\n", + "T = 60+460 #R\n", + "\n", + "#calculation\n", + "R1 = 35.1\n", + "R2 = 55.1\n", + "Rm = (w1*R1+w2*R2)/(w1+w2)\n", + "vm = (w1+w2)*Rm*T/(144*P)\n", + "p1 = w1*R1*T/(144*vm)\n", + "p2 = w2*R2*T/(144*vm)\n", + "\n", + "#result\n", + "print \"Gas constant of the mixture = \", round(Rm, 1), \"lb/in^2\"\n", + "print \"Volume of the mixture = \", round(vm, 1), \"ft^3\"\n", + "print \"Partial pressure of CO2 = \", round(p1, 1), \"lb/in^2\"\n", + "print \"Partial pressure of N2 = \", round(p2, 1), \"lb/in^2\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Gas constant of the mixture = 41.8 lb/in^2\n", + "Volume of the mixture = 15.1 ft^3\n", + "Partial pressure of CO2 = 16.8 lb/in^2\n", + "Partial pressure of N2 = 13.2 lb/in^2\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.3, page no. 238" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import scipy.integrate\n", + "\n", + "#initialization\n", + "cpm = 0.2523\n", + "Rm = 54.7\n", + "T1 = 60+460.0 #R\n", + "T2 = 400+460.0 #R\n", + "\n", + "#calculation\n", + "cvm = cpm-Rm/778.0\n", + "Q = cpm*(T2-T1)\n", + "W = Rm*(T2-T1)\n", + "#Rm is divided and multiplied by 778.!\n", + "def s(T):\n", + " cp = cpm/T\n", + " return cp\n", + "ds = scipy.integrate.quadrature(s, T1, T2)[0]\n", + "\n", + "#result\n", + "print \"Entropy change = \", round(ds, 3), \"B/lbm\"\n", + "print \"specific work = \", W, \"ft-lb/lbm\"\n", + "print \"Heat added per pound of mixture = \", round(Q, 1), \"B/lbm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Entropy change = 0.127 B/lbm\n", + "specific work = 18598.0 ft-lb/lbm\n", + "Heat added per pound of mixture = 85.8 B/lbm\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.4, page no. 239" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "P = 14.7 #lb/in^2\n", + "T = 80+460.0 #R\n", + "\n", + "#calculation\n", + "#From steam tables\n", + "Ps = 0.5069 #lb/in^2\n", + "v = 633.1 #ft^3/lbm\n", + "Pair = P-Ps\n", + "vair = 53.3*T/(144*Pair)\n", + "wair = 1/(1+vair/v)\n", + "wwater = vair/v/(1+vair/v)\n", + "\n", + "#result\n", + "print \"Partial pressure of air = \", round(Pair, 1), \"ft^3/lbm\"\n", + "print \"Partial pressure of water vapor = \", Ps, \"ft^3/lbm\"\n", + "print \"Gravimetric analysis of air = \", round(wair, 4)\n", + "print \"Gravimetric analysis of water = \", round(wwater, 4)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Partial pressure of air = 14.2 ft^3/lbm\n", + "Partial pressure of water vapor = 0.5069 ft^3/lbm\n", + "Gravimetric analysis of air = 0.9782\n", + "Gravimetric analysis of water = 0.0218\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.5, page no. 240" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "P = 14.7 #lb/in^2\n", + "T = 80+460.0 #R\n", + "M = 18\n", + "Ps = 0.5069 #lb/in^2\n", + "\n", + "#calculation\n", + "Pair = P-Ps\n", + "R = 1544/M\n", + "v = R*T/(144*Ps)\n", + "vair = 53.3*T/(144*Pair)\n", + "wair = 1/(1+vair/v)\n", + "wwater = vair/v/(1+vair/v)\n", + "\n", + "#result\n", + "print \"Partial pressure of air = \", round(Pair, 2), \"ft^3/lbm\"\n", + "print \"Specific volume = \", round(v), \"ft^3/lbm\"\n", + "print \"Gravimetric analysis of air = \", round(wair, 4)\n", + "print \"Gravimetric analysis of water = \", round(wwater, 4)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Partial pressure of air = 14.19 ft^3/lbm\n", + "Specific volume = 629.0 ft^3/lbm\n", + "Gravimetric analysis of air = 0.9781\n", + "Gravimetric analysis of water = 0.0219\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.6, page no. 242" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "RH = 0.62\n", + "T = 80+460.0 #R\n", + "\n", + "#calculation\n", + "#From stram tables\n", + "P = RH*0.5069\n", + "\n", + "#result\n", + "print \"Partial pressure of water vapor = \", round(P, 4), \"lb/in^2\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Partial pressure of water vapor = 0.3143 lb/in^2\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exmaple 12.7, page no. 243" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "P = 14.5 #lb/in^2\n", + "T = 70+460.0 #R\n", + "rh = 0.34\n", + "\n", + "#calculation\n", + "#From steam tables\n", + "Pg = 0.3631 #lb/in^2\n", + "Pair = P-Pg\n", + "wratio = rh*0.622*Pg/Pair\n", + "\n", + "#result\n", + "print \"Specific humidity = %.5f lbm/lbm\" %wratio" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Specific humidity = 0.00543 lbm/lbm\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exmaple 12.8, page no. 244" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "T = 100+460.0 #R\n", + "rh = 0.6\n", + "\n", + "#calculation\n", + "#From steam tables\n", + "Pg = 0.9492 #lb/in^2\n", + "Pwv = rh*Pg\n", + "T = 83 #F\n", + "\n", + "#result\n", + "print \"Dew point is obtained from saturation pressure table and is equal to %d F\" %T" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Dew point is obtained from saturation pressure table and is equal to 83 F\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.9, page no. 246" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "T1 = 80+460.0 #R\n", + "T2 = 90+460.0 #R\n", + "P = 14.5 #lb/in^2\n", + "cp = 0.24\n", + "\n", + "#calculation\n", + "#From steam tables\n", + "hg2 = 1096.6\n", + "hf3 = 48.02\n", + "Pg2 = 0.5069\n", + "hf2 = hf3\n", + "Pair = P-Pg2\n", + "wg2 = 0.622*Pg2/Pair\n", + "hgv1 = 1100.9\n", + "wwv1 = (cp*(T1-T2)+wg2*(hg2-hf3))/(hgv1-hf3)\n", + "Pg = 0.6982\n", + "xi = wwv1*(P-Pg)/(Pg*0.622)\n", + "\n", + "#result\n", + "print \"Specific humidity = \", round(wwv1, 4), \"lbm/lbm\"\n", + "print \"relative humidity = \", round(xi, 3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Specific humidity = 0.0202 lbm/lbm\n", + "relative humidity = 0.641\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.10, page no. 247" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "T1 = 69.0 #F\n", + "T2 = 84.0 #F\n", + "P = 14.7 #lb/in^2\n", + "\n", + "#calculation\n", + "# from wet bulb n dry bulb temperature charts\n", + "sh = 82.0/7000.0\n", + "rh = 47.0\n", + "Pwv = 0.27\n", + "T = 62.0 #F\n", + "h = 33.3\n", + "\n", + "#result\n", + "print \"Specific humidity = \", round(sh, 4), \"lbm/lbm\"\n", + "print \"Relative humidity = \" , rh, \"%\"\n", + "print \"Partial pressure = \", round(Pwv, 2), \"lb/in^2\"\n", + "print \"Dew point = \", T, \"F\"\n", + "print \"Enthalpy per pound of air = \", round(h, 1), \"V/lbm dry air\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Specific humidity = 0.0117 lbm/lbm\n", + "Relative humidity = 47.0 %\n", + "Partial pressure = 0.27 lb/in^2\n", + "Dew point = 62.0 F\n", + "Enthalpy per pound of air = 33.3 V/lbm dry air\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.11, page no. 250" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#initialization\n", + "g1 = [0.489, 100, 700, 35.1, 0.154]\n", + "g2 = [0.483, 15, 600, 55.2, 0.177]\n", + "g3 = [0.028, 30, 500, 386, 0.754]\n", + "\n", + "#calculation\n", + "v1 = g1[0] *g1[3] *g1[2] /(144*g1[1])\n", + "v2 = g2[0] *g2[3] *g2[2] /(144*g2[1])\n", + "v3 = g3[0] *g3[3] *g3[2] /(144*g3[1])\n", + "vm = v1+v2+v3\n", + "Tm = (g1[0] *g1[4] *g1[2] +g2[0] *g2[4] *g2[2] +g3[0] *g3[4] *g3[2])/(g1[0] *g1[4] +g2[0] *g2[4] +g3[0] *g3[4])\n", + "Pm = (g1[0] *g1[3] +g2[0] *g2[3] +g3[0] *g3[3]) *Tm/(vm*144)\n", + "ds1 = g1[0] *(g1[4] *math.log(Tm/g1[2]) +g1[3] /778.0 *math.log(vm/v1))\n", + "ds2 = g2[0] *(g2[4] *math.log(Tm/g2[2]) +g2[3] /778.0 *math.log(vm/v2))\n", + "ds3 = g3[0] *(g3[4] *math.log(Tm/g3[2]) +g3[3] /778.0 *math.log(vm/v3))\n", + "ds = ds1+ds2+ds3\n", + "\n", + "#result\n", + "print \"Pressure = \", round(Pm, 1), \"lb/in^2\"\n", + "print \"Temperature = \", round(Tm), \"R\"\n", + "print \"Entropy change = \", round(ds, 4), \"B/R\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pressure = 25.2 lb/in^2\n", + "Temperature = 630.0 R\n", + "Entropy change = 0.0914 B/R\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.13, page no. 254" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "vdot1 = 8500.0 #cfm of air\n", + "v1 = 12.775 #from chart\n", + "wdot = vdot1/v1\n", + "\n", + "h2 = 20.3 #from chart\n", + "h1 = 13.85 #from chart\n", + "h4 = 29.0 #from chart\n", + "h3 = 20.3 #from chart\n", + "\n", + "#Part a\n", + "Q12 = h2 - h1\n", + "Q12 = wdot*Q12\n", + "print \"Capacity of preheater: \", round(Q12, 2), \"B/min\"\n", + "\n", + "#Part b\n", + "Q34 = h4 - h3\n", + "Q34 = wdot*Q34\n", + "print \"Capacity of reheater: \", round(Q34, 2), \"B/min\"\n", + "\n", + "#Part c\n", + "\n", + "w2 = 20.0/7000.0 #from chart\n", + "w3 = 54.0/7000.0 #from chart\n", + "W = w3 - w2\n", + "W = wdot*W\n", + "print \"Rate of water addition: \", round(W, 2), \"lbm/min\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Capacity of preheater: 4291.59 B/min\n", + "Capacity of reheater: 5788.65 B/min\n", + "Rate of water addition: 3.23 lbm/min\n" + ] + } + ], + "prompt_number": 3 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_F_P_Durham/chapter13.ipynb b/Thermodynamics_by_F_P_Durham/chapter13.ipynb new file mode 100755 index 00000000..134029ab --- /dev/null +++ b/Thermodynamics_by_F_P_Durham/chapter13.ipynb @@ -0,0 +1,302 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:9400ac9019314c4e9a568a522343f0bdbb2a3d098bb24add69a9bd20d9589ad0" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 13: Gas Dynamics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.1, page no. 259" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#initialization\n", + "v = 2000.0 #ft/sec\n", + "P = 14.7 #lb/in^2\n", + "g = 1.4\n", + "T = 10+460.0 #R\n", + "\n", + "#calculation\n", + "c = math.sqrt(g*32.2*53.3*T)\n", + "Nm = v/c\n", + "Tratio = 1+ (g-1)/2 *Nm**2\n", + "Tt = Tratio*T\n", + "Pratio = (Tratio)**(g/(g-1))\n", + "Pt = Pratio*P\n", + "\n", + "#result\n", + "print \"Stagnation temperature = %d R\" %Tt\n", + "print \"Stagnation pressure = \", round(Pt, 1), \"lb/in^2\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Stagnation temperature = 802 R\n", + "Stagnation pressure = 95.8 lb/in^2\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.2, page no. 261" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#initialization\n", + "A = 0.3 #ft^2\n", + "P = 30.0 #lb/in^2\n", + "T = 160+460.0 #R\n", + "Mn = 0.82\n", + "g = 1.4\n", + "\n", + "#calculation\n", + "w = A*144*P*math.sqrt(g*32.2) *Mn*(1+ (g-1)/2.0 *(Mn)**2)**(-3)/math.sqrt(53.3*T)\n", + "\n", + "#result\n", + "print \"Mass flow = \", round(w, 1), \"lbm/sec\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass flow = 26.9 lbm/sec\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.3, page no. 263" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#initialization\n", + "Mn = 3.0\n", + "Mni = 0.2\n", + "w = 10.0 #lbm/sec\n", + "g = 1.4\n", + "P = 200.0 #lb/in^2\n", + "T = 400+460.0 #R\n", + "\n", + "#calculation\n", + "Astar = w*math.sqrt(53.3*T) *((g+1)/2)**3 /(P*math.sqrt(g*32.2))\n", + "A1ratio = (2.0/(g+1) + (g-1)*Mni**2 /(g+1))**3 /Mni\n", + "A1 = A1ratio*Astar\n", + "A2ratio = (2.0/(g+1) + (g-1)*Mn**2 /(g+1))**3 /Mn\n", + "A2 = A2ratio*Astar\n", + "Pexit = P/(1+ Mni*Mn**2)**(g/(g-1))\n", + "\n", + "#result\n", + "print \"Throat Area = \", round(Astar, 2), \"in^2\"\n", + "print \"Inlet Area = \", round(A1, 2), \"in^2\"\n", + "print \"Exit Area = \", round(A2, 2), \"in^2\"\n", + "print \"Exit pressure = \", round(Pexit, 2), \"lb/in^2\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Throat Area = 2.76 in^2\n", + "Inlet Area = 8.16 in^2\n", + "Exit Area = 11.67 in^2\n", + "Exit pressure = 5.44 lb/in^2\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.4, page no. 266" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#initialization\n", + "Pi = 750.0 #lb/in^2\n", + "g = 1.25\n", + "TA = 2.0 #in^2\n", + "r = 3.0\n", + "\n", + "#calculation\n", + "Fstar = round(((g+1)*(2.0/(g+1))**5 *TA*750))\n", + "Me = 2.45\n", + "Fratio = round(((1+g*Me**2)/(Me*(math.sqrt(4.5+ (g**2 -1)*Me**2)))), 3)\n", + "F2 = Fratio*Fstar\n", + "Pratio = (1+ 0.2*Me**2)**5\n", + "Fnstar = Fratio-((g+1)/2.0)**5 *r/(Pratio*2.25)\n", + "Fn = Fnstar*Fstar\n", + "\n", + "#result\n", + "print \"Internal rocket thrust = %d lb\" %F2 #answer in textbook is wrong\n", + "print \"External thrust = %d lb\" %Fn #answer in textbook is wrong" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Internal rocket thrust = 2316 lb\n", + "External thrust = 2229 lb\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.5, page no. 270" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "Tt2 = 1620+460 #R\n", + "Tt1 = 60+460 #R\n", + "Mi = 0.2\n", + "P = 40 #lb/in^2\n", + "g = 1.35\n", + "\n", + "#calculation\n", + "Tratio = Tt2/Tt1\n", + "#From figure\n", + "fM = 4*0.036\n", + "NM2 = 0.49\n", + "Pratio = 0.98/0.885\n", + "Pt2 = P/Pratio\n", + "\n", + "#result\n", + "print \"Final stagnation pressure = \", round(Pt2, 1), \"lb/in^2\"\n", + "print \"Final mach number = \", round(fM, 3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final stagnation pressure = 36.1 lb/in^2\n", + "Final mach number = 0.144\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.6, page no. 273" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "M = 0.4\n", + "l = 10.0 #ft\n", + "dia = 3.0 #in\n", + "P = 50.0 #lb/in^2\n", + "ff = 0.008\n", + "T = 100+460.0 #R\n", + "\n", + "#calculation\n", + "constant = 4*ff*l/dia\n", + "exitM = 2.9-constant\n", + "Nm2 = 0.5\n", + "Ptratio = 2.73/2.3\n", + "Pt2 = P/Ptratio\n", + "\n", + "#result\n", + "print \"Exit total pressure = \", round(Pt2, 1), \"lb/in^2\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Exit total pressure = 42.1 lb/in^2\n" + ] + } + ], + "prompt_number": 17 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_F_P_Durham/chapter14.ipynb b/Thermodynamics_by_F_P_Durham/chapter14.ipynb new file mode 100755 index 00000000..e037e77a --- /dev/null +++ b/Thermodynamics_by_F_P_Durham/chapter14.ipynb @@ -0,0 +1,383 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:e1f2ab4731e8126f69d8554acbb321ab940bce50cce33579f99b691416bd49a5" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 14: Heat Transfer" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.1, page no. 279" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "T = 50.0 #F\n", + "Q = 3.9 #B/hr-ft^2\n", + "\n", + "#calculation\n", + "#From table 14.1\n", + "k = 0.026 #B/hr-ft-F\n", + "dx = k*T/Q\n", + "\n", + "#result\n", + "print \"Required thickness = ft\", round(dx, 3), \"lb/in^2\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Required thickness = ft 0.333 lb/in^2\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.2, page no. 281" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "x1 = 1.0 #in\n", + "x2 = 4.0 #in\n", + "T1 = 85.0 #F\n", + "T2 = 30.0 #F\n", + "\n", + "#calculation\n", + "QbyA = 12*(T1-T2)/(x1/0.3 + x2/0.026)\n", + "\n", + "#result\n", + "print \"Rate of heat flow = \", round(QbyA, 1), \"B/r-ft^2-F\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Rate of heat flow = 4.2 B/r-ft^2-F\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.3, page no. 283" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#initialization\n", + "L = 6.5 #in\n", + "thick = 1.0 #in\n", + "k = 0.06 #B/hr-ft-F\n", + "T1 = 350.0 #F\n", + "T2 = 110.0 #F\n", + "\n", + "#calculation\n", + "QbyL = 2*math.pi*k*(T1-T2)/math.log(1+2/L)\n", + "\n", + "#result\n", + "print \"heat flow = %d B/hr-ft\" %QbyL" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "heat flow = 337 B/hr-ft\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.4, page no. 283" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#initialization\n", + "t = 0.25 #in\n", + "dia = 5.5 #in\n", + "t2 = 0.6 #in\n", + "To = 100.0 #F\n", + "kp = 34.5 #B/hr-ft-F\n", + "ki = 0.05 #B/hr-ft-F\n", + "l = 10.0 #ft\n", + "Q = 2000.0 #B/hr\n", + "\n", + "#calculation\n", + "dT = Q*(1/kp *math.log(1+ 2*t/dia) + 1/ki *math.log(1 + 4*t/(dia+2*t)))/(2*math.pi*l)\n", + "T1 = dT+To\n", + "\n", + "#result\n", + "print \"Inner surface temperature of the pipe = \", round(T1, 1), \"F\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Inner surface temperature of the pipe = 198.2 F\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.5, page no. 286" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "Tsurr = 90.0 #F\n", + "T = 85.0 #F\n", + "\n", + "#calculation\n", + "H = 4.2/(Tsurr-T)\n", + "\n", + "#result\n", + "print \"Film coefficient = %.2f B/hr-ft^2-F\" %H" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Film coefficient = 0.84 B/hr-ft^2-F\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.6, page no. 288" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "k = 0.04 #B/hr-ft-F\n", + "thick = 1.0 #in\n", + "T1 = 90.0 #F\n", + "T2 = 30.0 #F\n", + "Air = 2.5 #B/hr-ft^2-F\n", + "film = 2.0 #B/hr-ft^2-F\n", + "\n", + "#calculation\n", + "U = 1.0/(1.0/Air + thick/12.0/k + 1/film)\n", + "Q = U*(T1-T2)\n", + "\n", + "#result\n", + "print \"Rate of heat transfer per unit square area = %.1f B/hr-ft^2\" %Q" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Rate of heat transfer per unit square area = 20.1 B/hr-ft^2\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.7, page no. 291" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#initialization\n", + "U = 115.0 #B/hr-ft^2-F\n", + "T1 = 190.0 #F\n", + "T2 = 160.0 #F\n", + "Tc1 = 65.0 #F\n", + "Tc2 = 100.0 #F\n", + "w = 140.0 #lbm/min\n", + "c = 0.8 #B/lbm F\n", + "\n", + "#calculation\n", + "Q = w*60.0*c*(T1-T2) #answer in textbook for Q is wrong. Hence, the difference in final answer\n", + "dT = ((T1-Tc2) - (T2-Tc1))/math.log((T1-Tc2)/(T2-Tc1))\n", + "A = Q/(U*dT)\n", + "\n", + "#result\n", + "print \"Required Area = %.1f ft^2\" %A" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Required Area = 19.0 ft^2\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.8, page no. 294" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "e = 0.8\n", + "T1 = 100+460.0 #R\n", + "T2 = 300+460.0 #R\n", + "\n", + "#calculation\n", + "Qdot = 0.173*10**-8 *(T2**4 - T1**4)/(1/e +1/e -1)\n", + "\n", + "#result\n", + "print \"Radiant heat transfer per sq. foot = %d B/hr-ft^2\" %(Qdot+1)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Radiant heat transfer per sq. foot = 272 B/hr-ft^2\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.9, page no. 294" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "T1 = 400+460.0 #R\n", + "A = 40.0 #in^2\n", + "e = 0.1\n", + "T2 = 70+460.0 #R\n", + "\n", + "#calculation\n", + "Q = A*e*0.173*10**-8 *(T1**4 - T2**4)/144.0\n", + "\n", + "#result\n", + "print \"Rate of heat transfer = %.2f B/hr\" %Q\n", + "#answer in the book is wrong" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Rate of heat transfer = 22.49 B/hr\n" + ] + } + ], + "prompt_number": 19 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_F_P_Durham/chapter2.ipynb b/Thermodynamics_by_F_P_Durham/chapter2.ipynb new file mode 100755 index 00000000..33489895 --- /dev/null +++ b/Thermodynamics_by_F_P_Durham/chapter2.ipynb @@ -0,0 +1,285 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:4b491165aaa84eef66101894e30c202e368215710941e1135ee996c3417298e7" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 2: Types of Energy" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.1, page no. 19" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import scipy.integrate\n", + "\n", + "#initialization\n", + "k = 20 #lb/in\n", + "x = 3 #in\n", + "\n", + "#calculation\n", + "def fun(x):\n", + " y = k*x\n", + " return y\n", + "\n", + "w = scipy.integrate.quadrature(fun, 0.0, 3.0)\n", + "\n", + "#result\n", + "print \"Work done = %d in-lb\" %(round(w[0]))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work done = 90 in-lb\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.2, page no. 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import scipy.integrate\n", + "\n", + "#initialization\n", + "w = 0.1 #lbm\n", + "Pv = 30000 #ft-lb/lbm\n", + "v1 = 14.0 #ft^3 /lbm\n", + "v2 = 3.0 #ft^3/lbm\n", + "\n", + "#calculation\n", + "def func(v):\n", + " W = Pv/v\n", + " return W\n", + "\n", + "temp = scipy.integrate.quadrature(func, v1, v2,)\n", + "Work = w * temp[0]\n", + "\n", + "#result\n", + "#Answer varies a bit from the text due to rounding off of log value\n", + "print \"Work done = %d ft-lb\" %Work" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work done = -4621 ft-lb\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.3, page no. 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import scipy.integrate\n", + "\n", + "#initialization of variables\n", + "T1 = 500.0 #R\n", + "T2 = 1000.0 #R\n", + "w = 2.0 #lbm\n", + "\n", + "#calculations\n", + "def c(T):\n", + " cp=0.282+0.00046*T\n", + " return cp\n", + "\n", + "Q = scipy.integrate.quadrature(c, T1, T2,)[0]\n", + "Heat = Q*w\n", + "\n", + "#results\n", + "print \"Heat flow = %d B\" %(Heat)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat flow = 626 B\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.4, page no. 29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import scipy.integrate\n", + "\n", + "#initialization\n", + "T1 = 500.0 #R\n", + "T2 = 1060.0 #R\n", + "w = 1 #lbm\n", + "\n", + "#calculation\n", + "def v(T):\n", + " cv = 0.258-120/T +40000/T**2\n", + " return cv\n", + "\n", + "Q = scipy.integrate.quadrature(v, T1, T2,)[0]\n", + "cvm=Q/(T2-T1)\n", + "\n", + "#result\n", + "print \"The amount of heat: \", round(Q,1), \"B/lbm\"\n", + "print \"Mean specific heat = %.3f B/lbm F\" %cvm" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The amount of heat: 96.6 B/lbm\n", + "Mean specific heat = 0.172 B/lbm F\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.5, page no. 31" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "w=1 #lbm\n", + "Sw=0.3120 #B/lbm R\n", + "Ss=1.7566 #B/lb R\n", + "T=672 #R\n", + "\n", + "#calculation\n", + "Q=T*(Ss-Sw)\n", + "\n", + "\n", + "#result\n", + "print \"Latent heat of water = %d B/lbm\" %Q" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Latent heat of water = 970 B/lbm\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.6, page no. 31" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import scipy.integrate\n", + "\n", + "#initialization\n", + "w=1 #lbm\n", + "T1=492 #R\n", + "T2=672 #R\n", + "cp=1 #B/lbm F\n", + "\n", + "#calculation\n", + "dQ=cp*(T2-T1)\n", + "def ds(T):\n", + " s=1/T\n", + " return s\n", + "\n", + "entropy = scipy.integrate.quadrature(ds, T1, T2,)[0]\n", + "\n", + "#results\n", + "print \"Entropy change = \", round(entropy, 3), \"B/lbm R\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Entropy change = 0.312 B/lbm R\n" + ] + } + ], + "prompt_number": 15 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_F_P_Durham/chapter3.ipynb b/Thermodynamics_by_F_P_Durham/chapter3.ipynb new file mode 100755 index 00000000..29e0de91 --- /dev/null +++ b/Thermodynamics_by_F_P_Durham/chapter3.ipynb @@ -0,0 +1,179 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:2f3fb462cc0db08450310246022ae2504547e2c6d9d1ee2fc4b7cff1e946c1f6" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 3: Properties of Thermodynamic Media" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.1, page no. 43" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initilisation\n", + "P = 80 #lb/in^2\n", + "x = 0.9 #quality\n", + "hg = 1183.1 #B/lbm\n", + "hfg = 901.1 #B/lbm\n", + "\n", + "#calculation\n", + "h=hg-(1-x)*hfg\n", + "\n", + "#result\n", + "print \"Enthalpy of steam = \", round(h), \"B/lbm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enthalpy of steam = 1093.0 B/lbm\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.2, page no. 44" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initilisation\n", + "P = 100 #lb/in^2\n", + "T = 470 #F\n", + "T2 = 500 #F\n", + "T1 = 450 #F\n", + "\n", + "#calculation\n", + "#From table 4 of appendix\n", + "v1 = 5.268\n", + "v2 = 5.589\n", + "v = v1+2*(v2-v1)/5.0\n", + "\n", + "#result\n", + "print \"Specific volume at \", T, \"F\", \"= \", round(v,3), \"ft**3/lbm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Specific volume at 470 F = 5.396 ft**3/lbm\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.3, page no. 47" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initilisation\n", + "\n", + "R = 1544.0 #ft-lb/R\n", + "M = 44.0 #lbm\n", + "\n", + "#calculation\n", + "Rdash=R/M\n", + "\n", + "#result\n", + "print \"Gas constant for CO2 = \", round(Rdash, 1), \"ft-lb/lbm R\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Gas constant for CO2 = 35.1 ft-lb/lbm R\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.4, page no. 48" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialisation\n", + "h = 138.7 #enthalpy - from table 6\n", + "t = 580.0 #R absolute temprature\n", + "p = 11520.0 #pressure\n", + "g = 53.3 #gas constant\n", + "\n", + "#calculation\n", + "#v = RT/P\n", + "\n", + "v = (g*t)/p\n", + "\n", + "#result\n", + "print \"The volume for air at given conditions is \", round(v, 2), \"ft**3/lbm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The volume for air at given conditions is 2.68 ft**3/lbm\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_F_P_Durham/chapter4.ipynb b/Thermodynamics_by_F_P_Durham/chapter4.ipynb new file mode 100755 index 00000000..7891e5f3 --- /dev/null +++ b/Thermodynamics_by_F_P_Durham/chapter4.ipynb @@ -0,0 +1,398 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:910acb7ed7ee37a2d5b97a6f5e2b66763e4dc01353e87c18f37d153efde41037" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4: The First Law of Thermodynamics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.1, page no. 55" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initilisation\n", + "m = 0.5 #mass rate of flow(lbm/sec)\n", + "Pi = 14.0 #inlet pressure(lb/in^2)\n", + "SVi = 13.0 #inlet specific volume(ft^3/lbm)\n", + "Vi = 100.0 #inlet velocity(ft/sec)\n", + "P = 75.5 #power input(hp)\n", + "Hr = 8.65 #heat rejected(zB/sec)\n", + "Pd = 150.0 #discharge pressure(lb/in^2)\n", + "SVd = 2.1 #discharge specific volume(ft^3/lb)\n", + "Vd = 200.0 #discharge velocity(ft/sec)\n", + "z1 = 3.0 #distance(ft)\n", + "z2 = 10.0 #distance(ft)\n", + "\n", + "#calculation\n", + "WbyJ=P*550/(m*778)\n", + "Q=Hr/m\n", + "Wi=144*Pi*SVi/(778)\n", + "Wo=144*Pd*SVd/(778)\n", + "PEi=z1/778\n", + "PEf=z2/778\n", + "KEi=Vi**2 /(2*32.2*778)\n", + "KEf=Vd**2 /(2*32.2*778)\n", + "du=-Q+WbyJ+PEi-PEf+KEi-KEf+Wi-Wo\n", + "\n", + "#result\n", + "print \"Increase in internal energy = \", round(du,1) ,\"B/lbm\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Increase in internal energy = 64.2 B/lbm\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.2, page no. 57" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initilisation\n", + "d = 500.0 #depth of well(ft)\n", + "Pi = 14.0 #pump inlet pressure(lb/in^2)\n", + "Pd = 15.0 #discharge pressure(lb/in^2)\n", + "Sv = 0.016 #specific volume of water(ft^3 /lb)\n", + "\n", + "#calculation\n", + "Wi = 144*Pi*Sv\n", + "Wf = 144*Pd*Sv\n", + "PEi = 0\n", + "PEf = d\n", + "Winput = Wf-Wi+PEf-PEi\n", + "\n", + "#result\n", + "print \"Input work = \", round(Winput, 1), \"ft-lb/lbm\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Input work = 502.3 ft-lb/lbm\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.3, page no. 61" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initilisation\n", + "T1 = 70 #temperature(F)\n", + "T2 = 140 #temperature(F)\n", + "m = 10 #mass of water(lb)\n", + "Cp = 1 #specific volume for water(B/lbm F)\n", + "\n", + "#calculation\n", + "Q = Cp*(T2-T1)\n", + "Qdot = m*Q\n", + "w = 0 #since no change in pressure\n", + "\n", + "#result\n", + "print \"Work done = \", w\n", + "print \"Change in enthalpy= \", Qdot, \"B\"\n", + "print \"Heat added per pound = \", Q, \"B/lbm\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work done = 0\n", + "Change in enthalpy= 700 B\n", + "Heat added per pound = 70 B/lbm\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.4, page no. 63" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initilisation\n", + "W = 64000.0 #ft-lbm/lb\n", + "P = 14.0 #pressure(lb/in^2)\n", + "W2 = 48500.0 #work input(ft-lbm/lb)\n", + "\n", + "#calculation\n", + "dh1 = W/778.0\n", + "dh2 = W2/778.0\n", + "\n", + "#result\n", + "print \"For the actual process = %.1f B/lbm\" %dh1\n", + "print \"For the frictionless process = \", round(dh2, 1), \"B/lbm\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "For the actual process = 82.3 B/lbm\n", + "For the frictionless process = 62.3 B/lbm\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.5, page no. 66" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#initilisation\n", + "ht = 308 #B/lbm\n", + "h = 298 #B/lbm\n", + "\n", + "#calculation\n", + "V = math.sqrt(2*32.2*778*(ht-h))\n", + "\n", + "#result\n", + "print \"Velocity of tha gas= %d ft/sec\" %V" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Velocity of tha gas= 707 ft/sec\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.6, page no. 69" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initilisation\n", + "hp = 10000 #hp\n", + "v = 100.0 #lbm/sec\n", + "\n", + "#calculation\n", + "W = hp*550/v\n", + "enthalpy = W/778.0\n", + "\n", + "#result\n", + "print \"Decrease in stagnation enthalpy= %.1f B/lbm\" %enthalpy" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Decrease in stagnation enthalpy= 70.7 B/lbm\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.7, page no. 69" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initilisation\n", + "\n", + "w1 = 100 #lbm\n", + "w2 = 2 #lbm\n", + "h1 = 127 #B/lbm\n", + "h2 = 125 #B/lbm\n", + "hc = 401 #B/lbm\n", + "\n", + "#calculation\n", + "ht1=w1*h1\n", + "ht2=w2*h2\n", + "ht3=(w1+w2)*hc\n", + "Q=ht3-ht1-ht2\n", + "\n", + "#result\n", + "print \"Heat liberated = %d B/sec\" %Q" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat liberated = 27952 B/sec\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.8, page no. 72" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initilisation\n", + "\n", + "du=75 #B/lbm\n", + "m=0.01 #lbm\n", + "\n", + "#calculation\n", + "W=778*du\n", + "Wdot=m*W\n", + "\n", + "#result\n", + "print \"Work for the process = %d ft-lb\" %Wdot" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work for the process = 583 ft-lb\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.9, page no. 72" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initilisation\n", + "m = 0.5 #lbm\n", + "\n", + "#calculation\n", + "#From tables\n", + "h1 = 48.02 #B/lbm\n", + "hf = 180.07 #B/lbm\n", + "hfg = 970.3 #B/lbm\n", + "h2 = hf+m*hfg\n", + "Q = h2-h1\n", + "\n", + "#result\n", + "print \"Heat added = %.1f B\" %Q" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat added = 617.2 B\n" + ] + } + ], + "prompt_number": 15 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_F_P_Durham/chapter5.ipynb b/Thermodynamics_by_F_P_Durham/chapter5.ipynb new file mode 100755 index 00000000..bf944c6e --- /dev/null +++ b/Thermodynamics_by_F_P_Durham/chapter5.ipynb @@ -0,0 +1,171 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:080ddee320ed2e8325a1bba2bf7e96e362906d7bc4b7f00bae6953ceccc830a0" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 5: The Second Law of Thermodynamics" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.1, page no. 87" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initilisation\n", + "Tr = 540.0 #R\n", + "Te = 2000.0 #R\n", + "m = 200.0 #B/lbm\n", + "\n", + "#calculation\n", + "eta = 1-(Tr/Te)\n", + "Qr = m*(1-eta)\n", + "\n", + "\n", + "#result\n", + "print \"Thermal efficiency is \", eta*100, \"%\"\n", + "print \"Heat rejected = %d B/lbm\" %Qr" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency is 73.0 %\n", + "Heat rejected = 54 B/lbm\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.2, page no. 90" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import scipy.integrate\n", + "\n", + "#initilisation\n", + "cv=0.171 #B/lbm F\n", + "T2=580 #F\n", + "T1=520 #F\n", + "\n", + "#calculation\n", + "def fun(T):\n", + " cp=cv/T\n", + " return cp\n", + "\n", + "ds = scipy.integrate.quadrature(fun, T1, T2)[0]\n", + "\n", + "#result\n", + "print \"Change in entropy = %.4f B/lbm R\" %ds" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in entropy = 0.0187 B/lbm R\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.3, page no. 95" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import scipy.integrate\n", + "\n", + "#initilisation\n", + "\n", + "Q = 100.0 #B/lbm\n", + "Cp = 0.24 #B/lbm F\n", + "T1 = 70.0+460.0 #R\n", + "T2 = 550.0+460.0 #R\n", + "Ts = 50.0+460.0 #R\n", + "\n", + "#calculation\n", + "def fun(T):\n", + " cp = Cp/T\n", + " return cp\n", + " \n", + "ds1 = scipy.integrate.quadrature(fun, T1, T2)[0]\n", + "Tf = Q/Cp + T1\n", + "ds2 = scipy.integrate.quadrature(fun, T1, Tf)[0]\n", + "Qr = Ts*(ds2)\n", + "Qa = Q-Qr\n", + "Qun = Ts*(ds1)\n", + "Qa2 = Q-Qun\n", + "\n", + "#result\n", + "print \"Case 1\"\n", + "print \"Change in entropy = %.4f B/lbm R\" %ds1\n", + "print \"case 2\"\n", + "print \"Entropy change = %.4f B/lbm R\" %ds2\n", + "print \"Available energy = %.1f B/lbm\" %Qa\n", + "print \"case 3\"\n", + "print \"Available energy = %.1f B/lbm\" %Qa2" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Case 1\n", + "Change in entropy = 0.1548 B/lbm R\n", + "case 2\n", + "Entropy change = 0.1392 B/lbm R\n", + "Available energy = 29.0 B/lbm\n", + "case 3\n", + "Available energy = 21.1 B/lbm\n" + ] + } + ], + "prompt_number": 6 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_F_P_Durham/chapter6.ipynb b/Thermodynamics_by_F_P_Durham/chapter6.ipynb new file mode 100755 index 00000000..e688b1c7 --- /dev/null +++ b/Thermodynamics_by_F_P_Durham/chapter6.ipynb @@ -0,0 +1,434 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:9350c41424c136ffdcb61a367641cc78b39d6999ad3a13b8f61c623099d55d5b" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 6: The Ideal Gas" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.1, page no. 101" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import scipy.integrate\n", + "\n", + "#intialization of variables\n", + "T1 = 40+460.0 #temperature(R)\n", + "T2 = 340+460.0 #temperature(R)\n", + "\n", + "#calculation\n", + "def Cv(T):\n", + "\tcv = 0.162+0.00046*T\n", + "\treturn cv\n", + "\t\n", + "du = scipy.integrate.quadrature(Cv, T1, T2)[0]\n", + "\n", + "#result\n", + "print \"Change in specific internal energy = %.1f B/lbm\" %du" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in specific internal energy = 138.3 B/lbm\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.2, page no. 103" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "\n", + "cp = 0.24 #B/lbm F\n", + "R = 53.3 #ft-lb/lbm F\n", + "\n", + "#calculation\n", + "cv = cp-R/778.0\n", + "\n", + "#result\n", + "print \"Specific heat at constant volume = %.3f B/lbm F\" %cv" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Specific heat at constant volume = 0.171 B/lbm F\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.3, page no. 104" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import scipy.integrate\n", + "\n", + "#initialization\n", + "T1 = 1400+460.0 #temperature(R)\n", + "T2 = 1200+460.0 #temperature(R)\n", + "\n", + "#calculation\n", + "def Cp(T):\n", + "\tcp = 0.317- 1.2*100/T + 4*10**4/T**2\n", + "\treturn cp\n", + "\n", + "dh = scipy.integrate.quadrature(Cp, T1, T2)[0]\n", + "\n", + "#result\n", + "print \"Change in stagnation enthalpy = %.1f B/lbm\" %dh" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in stagnation enthalpy = -52.3 B/lbm\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.4, page no. 106" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import scipy.integrate\n", + "\n", + "#initialization\n", + "T1 = 100+460.0 #temperature(R)\n", + "T2 = 300+460.0 #temperature(R)\n", + "P1 = 15.0 #pressure(lb/in^2)\n", + "P2 = 30.0 #pressure(lb/in^2)\n", + "Cp = 0.3 #constant pressure(B/lbm F)\n", + "R = 40.0 #gas constant(ft-lb/lbm R)\n", + "\n", + "#calculation\n", + "def fun(f):\n", + "\ts=Cp/f\n", + "\treturn s\n", + "def fun1(f):\n", + "\ts2=R/(f*778)\n", + "\treturn s2\n", + "\n", + "ds1 = scipy.integrate.quadrature(fun, T1, T2)[0]\n", + "ds2 = scipy.integrate.quadrature(fun1, P1, P2)[0]\n", + "ds = ds1 - ds2\n", + "\n", + "#result\n", + "print \"Change in entropy = %.4f B/lbm R\" %ds" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in entropy = 0.0560 B/lbm R\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.5, page no. 108" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "\n", + "T1 = 40+460.0 #temperature(R)\n", + "T2 = 340+460.0 #temperature(R)\n", + "P1 = 15.0 #pressure(lb/in^2)\n", + "cp = 0.24\n", + "cv = 0.171\n", + "\n", + "#calculation\n", + "gamma=cp/cv\n", + "P2=P1 *((T2/T1)**(gamma/(gamma-1)))\n", + "\n", + "#result\n", + "print \"Final pressure = %.1f lb/in^2\" %P2" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Final pressure = 76.9 lb/in^2\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.6, page no. 110" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#initialization\n", + "P1 = 16.0 #lb/in^2\n", + "P2 = 14.0 #lb/in^2\n", + "Tt = 83+460.0 #R\n", + "gamma = 1.4\n", + "cp = 0.24 #B/lbm F\n", + "\n", + "#calculation\n", + "T = Tt *(P2/P1)**((gamma-1)/gamma)\n", + "dh = cp*(Tt-T)\n", + "V = math.sqrt(2*32.2*778*dh)\n", + "\n", + "#result\n", + "print \"Actual temperature in the flow = %d R\" %T\n", + "print \"Flow velocity = %d ft/sec\" %V\n", + "\n", + "#difference in answeres is due to internal rounding off in Python" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Actual temperature in the flow = 522 R\n", + "Flow velocity = 494 ft/sec\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.7, page no. 111" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "import scipy.integrate\n", + "\n", + "#initialization\n", + "T1 = 400.0+460.0 #R\n", + "P1 = 100.0 #lb/in^2\n", + "P2 = 20.0 #lb/in^2\n", + "T2 = 140.0+460.0 #R\n", + "Cp = 50.0\n", + "\n", + "#calculation\n", + "Pratio = P1/P2\n", + "Tratio = T1/T2\n", + "C = math.log(Tratio)/math.log(Pratio)\n", + "n=1/(1-C)\n", + "v1=Cp*T1/(144*P1)\n", + "v2=Cp*T2/(144*P2)\n", + "w=144*P1*v1**n\n", + "def fun(v):\n", + "\tp=w/v**n\n", + "\treturn p\n", + "\n", + "Work = scipy.integrate.quadrature(fun, v1, v2)[0]\n", + "\n", + "#result\n", + "print \"Work done = %f ft-lb/lbm\" %Work" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work done = 45118.149895 ft-lb/lbm\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.8, page no. 113" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#initialization\n", + "P1 = 15.0 #lb/in^2\n", + "P2 = 20.0 #lb/in^2\n", + "T1 = 40+460 #R\n", + "T2 = 540+460 #R\n", + "\n", + "#calculation\n", + "#From table 6 at the two temperatures\"\n", + "phi1 = 0.58233\n", + "phi2 = 0.75042\n", + "ds = phi2-phi1-53.3*math.log(P2/P1)/778.0\n", + "\n", + "#result\n", + "print \"Entropy change = %.5f B/lbm R\" %ds" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Entropy change = 0.14838 B/lbm R\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.9, page no. 115" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#part a\n", + "\n", + "P2 = 1460.0 #pressure 2\n", + "P1 = 1900.0 #pressure 1\n", + "V2 = 1900.0 #volume 1\n", + "V1 = 1460.0 #volume 2\n", + "\n", + "pratio = (P2/P1)**3.5\n", + "vratio = (V2/V1)**2.5\n", + "\n", + "print \"Pressure ratio is \", round(pratio,2)\n", + "print \"Volume ratio is \", round(vratio,2)\n", + "\n", + "#part b\n", + "#from table 6\n", + "Pr2 = 50.34 #pressure 2\n", + "Pr1 = 141.51 #pressure 1\n", + "Vr2 = 10.743 #volume 1\n", + "Vr1 = 4.974 #volume 2\n", + "\n", + "pratio = (Pr2/Pr1)\n", + "vratio = (Vr2/Vr1)\n", + "\n", + "print \"Pressure ratio is \", round(pratio,2)\n", + "print \"Volume ratio is \", round(vratio,2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pressure ratio is 0.4\n", + "Volume ratio is 1.93\n", + "Pressure ratio is 0.36\n", + "Volume ratio is 2.16\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_F_P_Durham/chapter7.ipynb b/Thermodynamics_by_F_P_Durham/chapter7.ipynb new file mode 100755 index 00000000..0e9ab052 --- /dev/null +++ b/Thermodynamics_by_F_P_Durham/chapter7.ipynb @@ -0,0 +1,649 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:698d37f412d89d016a22fab7149569fc8652a8ce9fa170122f874fd8734f1895" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 7: Thermodynamics Processes" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.1, page no. 124" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "\n", + "P1 = 160.0 #lb/in^2\n", + "T1 = 100.0 #F\n", + "P2 = 140.0 #lb/in^2\n", + "T2 = 550.0 #F\n", + "\n", + "#From steam tables\n", + "h1 = 67.97 #B/lbm\n", + "h2 = 1299.3 #B/lbm\n", + "s1 = 0.1295 #B/lbm R\n", + "s2 = 1.6785 #B/lbm R\n", + "\n", + "#calculation\n", + "dh = h2-h1\n", + "ds = s2-s1\n", + "\n", + "#result\n", + "print \"Change in enthalpy = %.1f B/lbm\" %dh\n", + "print \"Change in entropy = %.4f B/lbm R\" %ds" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in enthalpy = 1231.3 B/lbm\n", + "Change in entropy = 1.5490 B/lbm R\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.2, page no. 125" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "P1 = 160.0 #lb/in^2\n", + "T1 = 100.0 #F\n", + "P2 = 140.0 #lb/in^2\n", + "T2 = 550.0 #F\n", + "\n", + "#From steam tables\n", + "h1 = 67.97 \n", + "s1 = 0.1295\n", + "h2 = 1300.9\n", + "s2 = 1.6945\n", + "\n", + "#calculation\n", + "dh = h2-h1\n", + "ds = s2-s1\n", + "\n", + "#result\n", + "print \"Change in enthalpy = %.1f B/lbm\" %dh\n", + "print \"Change in entropy = %.4f B/lbm R\" %ds\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in enthalpy = 1232.9 B/lbm\n", + "Change in entropy = 1.5650 B/lbm R\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.3, page no. 126" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import scipy.integrate\n", + "\n", + "#initialization\n", + "P1 = 30.0 #lb/in^2\n", + "T1 = 300+460.0 #R\n", + "T2 = 60 +460.0 #R\n", + "cp = 0.25 #B/lbm F\n", + "R = 53.3 #ft-lb/lbm R\n", + "\n", + "#calculation\n", + "Q = cp*(T2-T1)\n", + "du = (cp-R/778)*(T2-T1)\n", + "W = 778*(Q-du)\n", + "def c(T):\n", + " ds = cp/T\n", + " return ds\n", + "S = scipy.integrate.quadrature(c, T1, T2)[0]\n", + "\n", + "#result\n", + "print \"Heat flow\", Q, \" B/lbm\"\n", + "print \"change in internal energy\", round(du, 1), \" B/lbm\"\n", + "print \"the work done is \", W, \" ft-lb/lbm\" #mistake in book for calculation of W\n", + "print \"Change in entropy = %.3f B/lbm R\" %S" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat flow -60.0 B/lbm\n", + "change in internal energy -43.6 B/lbm\n", + "the work done is -12792.0 ft-lb/lbm\n", + "Change in entropy = -0.095 B/lbm R\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.4, page no. 129" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "\n", + "T1 = 300.0 #F\n", + "# From steam tables\n", + "\n", + "h1 = 269.59 #B/lbm\n", + "h2 = 1179.7 #B/lbm\n", + "s1 = 0.4369 #B/lbm R\n", + "s2 = 1.6350 #B/lbm R\n", + "\n", + "#calculation\n", + "dh = h2-h1\n", + "ds = s2-s1\n", + "\n", + "#result\n", + "print \"Change in enthalpy = %.1f B/lbm\" %dh\n", + "print \"Change in entropy = %.4f B/lbm R\" %ds" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in enthalpy = 910.1 B/lbm\n", + "Change in entropy = 1.1981 B/lbm R\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.5, page no. 129" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#initialization\n", + "v = 12.8 #ft^3\n", + "T = 80+460.0 #R\n", + "P = 14.0 #lb/in^2\n", + "Pf = 500.0 #lb/in^2\n", + "\n", + "#calculation\n", + "Q = -53.3*T*math.log(Pf/P)/778.0\n", + "v2 = 53.3*T/(144*Pf)\n", + "w = v/v2\n", + "Qdot = w*Q\n", + "Wdot = w*W\n", + "ds = Q/T\n", + "dsbar = ds*w\n", + "\n", + "#result\n", + "print \"Work required = %d ft-lb\" %Wdot\n", + "print \"Heat transfer = %d B\" %Qdot\n", + "print \"Change in entropy = %.3f B/lbm \" %dsbar\n", + "print \"Change in internal energy is 0 cause this is a constant temperature process\"\n", + "\n", + "#answers will differ due to roundin offs" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work required = -3295227 ft-lb\n", + "Heat transfer = -4235 B\n", + "Change in entropy = -7.844 B/lbm \n", + "Change in internal energy is 0 cause this is a constant temperature process\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.6, page no. 131" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "P1 = 14.7 #lb/in^2\n", + "P2 = 20.0 #lb/in^2\n", + "w = 1.0 #lbm\n", + "\n", + "#calculation\n", + "# From table 3 of appendix\n", + "v1 = 26.8\n", + "h1 = 1150.4\n", + "s1 = 1.7566\n", + "u1 = h1- 144*P1*v1/778\n", + "print \"Internal energy 1 = %.1f B/lbm\" %u1\n", + "\n", + "\n", + "# For pressure of 20 lb/in^2 , from table 2\n", + "v2 = 26.8\n", + "h2 = 1260.9\n", + "s2 = 1.8637\n", + "u2 = h2-144*P2*v2/778\n", + "du = u2-u1\n", + "ds = s2-s1\n", + "\n", + "#result\n", + "print \"Change in internal energy = %.1f B/lbm\" %du\n", + "print \"CHange in entropy = %.4f B/lbm R\" %ds" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Internal energy 1 = 1077.5 B/lbm\n", + "Change in internal energy = 84.2 B/lbm\n", + "CHange in entropy = 0.1071 B/lbm R\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.7, page no. 133" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import scipy.integrate\n", + "import math\n", + "\n", + "#initialization\n", + "P1 = 100.0 #lb/in^2\n", + "T1 = 240+460.0 #R\n", + "T2 = 740+460.0 #R\n", + "cp = 0.171 #B?lbm F\n", + "\n", + "#calculation\n", + "dq = cp*(T2-T1)\n", + "def s(T):\n", + " ds = cp/T\n", + " return ds\n", + "ds = scipy.integrate.quadrature(s, T1, T2)[0]\n", + "cpm = 0.247\n", + "cv = cpm-53.3/778\n", + "Q = cv*(T2-T1)\n", + "ds2 = cv*math.log(T2/T1)\n", + "v1 = 53.3*T1/(144*P1)\n", + "P2 = P1*(T2/T1)\n", + "\n", + "# from table 6\n", + "h1 = 167.56\n", + "phi1 = 0.66321\n", + "u1 = h1-144*P1*v1/778.0\n", + "h2 = 291.30\n", + "phi2 = 0.79628\n", + "u2 = h2-144*P2*v1/778.0\n", + "Q3 = u2-u1\n", + "ds3 = phi2-phi1-53.3*math.log(P2/P1)/778.0\n", + "\n", + "print \"Part a\"\n", + "print \"work is zero\"\n", + "print \"Heat = %.1f B/lbm\" %dq\n", + "print \"Change in entropy = %.4f B/lbm R\" %ds\n", + "\n", + "print \"part b\"\n", + "print \"Heat = %.1f B/lbm\" %Q\n", + "print \"Change in entropy = %.4f B/lbm R\" %ds2\n", + "\n", + "print \"Part c\"\n", + "print \"Heat low = %.1f B/lbm\" %Q3\n", + "print \"Change in entropy = %.5f B/lbm R\" %ds3" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part a\n", + "work is zero\n", + "Heat = 85.5 B/lbm\n", + "Change in entropy = 0.0922 B/lbm R\n", + "part b\n", + "Heat = 89.2 B/lbm\n", + "Change in entropy = 0.0962 B/lbm R\n", + "Part c\n", + "Heat low = 89.5 B/lbm\n", + "Change in entropy = 0.09614 B/lbm R\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.8, page no. 136" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "P1 = 100.0 #lb/in^2\n", + "T1 = 500+460.0 #R\n", + "P2 = 16.0 #lb/in^2\n", + "\n", + "#calculation\n", + "# From table 4 of appendix, initial conditions are\n", + "ht1 = 1279.1\n", + "st1 = 1.7085\n", + "hg = 1152.0\n", + "sg = 1.7549\n", + "hfg = 969.7\n", + "sfg = 1.4415\n", + "st1 = 1.7085\n", + "Xdash = (sg-st1)/sfg\n", + "ht2 = hg-(Xdash)*hfg\n", + "hdiff = ht1-ht2\n", + "W = hdiff*778\n", + "\n", + "#result\n", + "print \"Change in entropy is zero\"\n", + "print \"heat trasnfer is zero since adiabatic\"\n", + "print \"Work done = %d ft-lb/lbm\" %W\n", + "print \"Change in enthalpy = %.1f B/lbm\" %hdiff" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in entropy is zero\n", + "heat trasnfer is zero since adiabatic\n", + "Work done = 123167 ft-lb/lbm\n", + "Change in enthalpy = 158.3 B/lbm\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.9, page no. 137" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "g = 1.4\n", + "cv = 0.171 #B/lbm \n", + "P1 = 14.7 #lb/in^2\n", + "P2 = 100 #lb/in^2\n", + "T1 = 60+460 #R\n", + "w = 1 #lbm\n", + "\n", + "#calculation\n", + "Tratio = (P2/P1)**((g-1)/g)\n", + "T2 = T1*Tratio\n", + "WbyJ = cv*(T1-T2)\n", + "W = WbyJ*778.0\n", + "\n", + "#result\n", + "print \"Work done = %.1f B/lbm\" %W\n", + "print \"CHange in internal energy = %d ft-lb/lbm\" %WbyJ\n", + "\n", + "#difference in answers due to rounding offs" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work done = -50463.5 B/lbm\n", + "CHange in internal energy = -64 ft-lb/lbm\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.10, page no. 137" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#initialization\n", + "P1 = 25.0 #lb/in^2\n", + "T1 = 840+460.0 #R\n", + "P2 = 14.7 #lb/in^2\n", + "\n", + "#calculation\n", + "# from table 6 of appendix\n", + "ht1 = 316.94\n", + "Prt1 = 32.39\n", + "Pratio = P1/P2\n", + "Pr2 = Prt1/Pratio\n", + "h2 = 272.4\n", + "V2 = math.sqrt(2*32.2*778.0*(ht1-h2))\n", + "\n", + "#result\n", + "print \"Nozzle exit velocity = %d ft/sec\" %V2\n", + "\n", + "#difference in the answers is due to internal rounding off in Python." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Nozzle exit velocity = 1493 ft/sec\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.11, page no. 139" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "P1 = 100.0 #lb/in^2\n", + "P2 = 16.0 #lb/in^2\n", + "T1 = 500+460.0 #R\n", + "eta = 0.996\n", + "\n", + "#calculation\n", + "# from appendix table 4\n", + "ht1 = 1279.1\n", + "st1 = 1.7085\n", + "hg = 1152\n", + "sg = 1.7549\n", + "hfg = 969.7\n", + "sfg = 1.4415\n", + "ht2 = hg-(1-eta)*hfg\n", + "st2 = sg-(1-eta)*sfg\n", + "WbyJ = ht1-ht2\n", + "W = WbyJ*778\n", + "ds = st2-st1\n", + "\n", + "#result\n", + "print \"Work done = %d ft-lb/lbm\" %W #difference due to rounding off\n", + "print \"Change in enrtropy = %.4f B/lbm R\" %ds" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work done = 101901 ft-lb/lbm\n", + "Change in enrtropy = 0.0406 B/lbm R\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 7.12, page no. 140" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#initialization\n", + "P1 = 14.7 #lb/in^2\n", + "T1 = 60+460.0 #R\n", + "P2 = 100.0 #lb/in^2\n", + "T2 = 470+460.0 #R\n", + "cv = 0.171 #B/lbm F\n", + "cp = 0.24 #B/lbm F\n", + "\n", + "#calculation\n", + "WbyJ=cv*(T1-T2)\n", + "W=778*WbyJ\n", + "ds=cp*math.log(T2/T1) - 53.3*math.log(P2/P1)/778.0\n", + "\n", + "#result\n", + "print \"Work done = %d ft-lb/lbm\" %W\n", + "print \"Change in entropy = %.4f B/lbm R\" %ds" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Work done = -54545 ft-lb/lbm\n", + "Change in entropy = 0.0082 B/lbm R\n" + ] + } + ], + "prompt_number": 12 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_F_P_Durham/chapter8.ipynb b/Thermodynamics_by_F_P_Durham/chapter8.ipynb new file mode 100755 index 00000000..8fd523c3 --- /dev/null +++ b/Thermodynamics_by_F_P_Durham/chapter8.ipynb @@ -0,0 +1,356 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:faffd56df5ff320ba3aaf8ef0438e5c3fd03dbfd20ea0e30132ca53319ffe641" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 8: Engine Cycles" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.1, page no. 154" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "ratio = 7.0\n", + "Q = 300.0 #B/lbm\n", + "T1 = 60+460.0 #R\n", + "P1 = 14.7 #lb/in^2\n", + "cv = 0.1715 #B/lvm F\n", + "g = 1.4\n", + "\n", + "#calculation\n", + "Tratio = (ratio)**(g-1)\n", + "T2 = Tratio*T1\n", + "T3 = T2+Q/cv\n", + "eta = round(1- 1/Tratio,2)\n", + "WbyJ = eta*Q\n", + "print WbyJ*778\n", + "W = 778*WbyJ\n", + "\n", + "#result\n", + "print \"Final temperature = %d R\" %T3\n", + "print \"Thermal efficiency = %.3f\" %eta\n", + "print \"Work done = %d ft-lb/lbm\" %W\n", + "#difference in answer due to internal rounding off in Python" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "126036.0\n", + "Final temperature = 2881 R\n", + "Thermal efficiency = 0.540\n", + "Work done = 126036 ft-lb/lbm\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.2, page no. 157" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#initialization\n", + "cydia = 3.0 #in\n", + "crdia = 5.0 #in\n", + "ratio = 7.0\n", + "rpm = 3000.0 #rpm\n", + "hp = 50.0 #hp\n", + "w = 24.2 #lbm\n", + "Q = 18000.0 #B/lbm\n", + "P1 = 14.7 #lb/in^2\n", + "T1 = 60+460.0 #R\n", + "g = 1.4\n", + "cv = 0.1715\n", + "\n", + "#calculation\n", + "eta = hp*550*3600/(778*w*Q)\n", + "vol = math.pi*(cydia/12)**2 *(crdia/12)*6/4\n", + "vdot = vol*rpm/(60*2)\n", + "v1 = 53.3*T1/(144*P1)\n", + "wdot = vdot/v1\n", + "Qdot = w*Q/3600\n", + "Qdash = Qdot/wdot\n", + "T2 = T1*(ratio)**(g-1)\n", + "T3 = T2+Qdash/cv\n", + "eta2 = 1- 1/(ratio)**(g-1)\n", + "WbyJ = eta2*Qdot\n", + "Wdot = WbyJ*778/550.0\n", + "\n", + "#result\n", + "\n", + "print \"Part a\"\n", + "print \"Thermal efficiency = %.3f \" %eta\n", + "\n", + "print \"part b\"\n", + "print \"Temperature at the end of compression = %d R\" %T2\n", + "print \"Power developed = %.1f hp\" %Wdot" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part a\n", + "Thermal efficiency = 0.292 \n", + "part b\n", + "Temperature at the end of compression = 1132 R\n", + "Power developed = 92.6 hp\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3, page no. 161" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "Pi = 14.0 #lb/in^2\n", + "T1 = 70+460.0 #F\n", + "ratio = 13.0\n", + "T3 = 2500+460.0 #F\n", + "cv = 0.171\n", + "cp = 0.23\n", + "R = 53.3\n", + "g = 1.4\n", + "\n", + "#calculation\n", + "T2 = T1*(ratio)**(g-1)\n", + "v3ratio = T3/T2\n", + "cutoff = (v3ratio-1)/(ratio-1)\n", + "v1ratio = ratio/v3ratio\n", + "T4 = T3*(1/v1ratio)**(g-1)\n", + "eta = 1.0- cv*(T4-T1)/(T3-T2)/cp\n", + "percent = eta*100\n", + "\n", + "#result\n", + "print \"cut off ratio = %.4f\" %cutoff\n", + "print \"T end expansion = %d R\" %T4\n", + "print \"Thermal efficiency = %.1f\" %percent, \"%\"\n", + "#difference in % due to internal rounding off in Python" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "0.563104145624\n", + "cut off ratio = 0.0835\n", + "T end expansion = 1400 R\n", + "Thermal efficiency = 56.3 %\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.4, page no. 167" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "Pratio = 6.0\n", + "P = 14.7 #lb/in^2\n", + "Tt1 = 60+460.0 #R\n", + "Tt3 = 1600+460.0 #R\n", + "w = 60.0 #lb/sec\n", + "cp = 0.24 #B/lbm F\n", + "g = 1.4\n", + "R = 53.3 #ft-lb/lbm R\n", + "\n", + "#calculation\n", + "Tt2 = Tt1*(Pratio)**((g-1)/g)\n", + "Tratio = Tt2/Tt1\n", + "Q = cp*(Tt3-Tt2)\n", + "eta = 1- 1/Tratio\n", + "W = eta*778*Q\n", + "Wdot = w*W/550.0\n", + "\n", + "#result\n", + "print \"Thermal efficiency = %.3f\" %eta\n", + "print \"Horsepower output = %d hp\" %Wdot" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 0.401\n", + "Horsepower output = 9731 hp\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.5, page no. 169" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "P = 14.7 #lb/in^2\n", + "T = 60+460 #R\n", + "e1 = 0.8\n", + "P2 = 3 #lb/in^2\n", + "T2 = 1600+460 #R\n", + "Pt4 = 15.6 #lb/in^2\n", + "w = 60 #lbm/sec\n", + "e2 = 0.85\n", + "\n", + "#calculation\n", + "# from table 6, initial conditions are\n", + "ht1 = 124.3\n", + "Prt1 = 1.215\n", + "Prt2s = 6*Prt1\n", + "ht2s = 207.6\n", + "ht2 = ht1+(ht2s-ht1)/e1\n", + "dht1 = round((ht2s-ht1)/e1, 1)\n", + "ht3 = 521.4\n", + "Prt3 = 196.2\n", + "Pt3 = 6*P-P2\n", + "Pratio = Pt3/Pt4\n", + "Prt4s = Prt3/Pratio\n", + "ht4 = 326.5\n", + "dht3 = round(e2*(ht3-ht4), 1)\n", + "W = 778*(dht3-dht1)\n", + "Q = ht3-ht2\n", + "etaf = W/778.0/Q\n", + "Wdot = w*W/550.0\n", + "\n", + "#result\n", + "print \"Thermal efficiency = %.3f\" %(round(W))\n", + "print \"Horsepower output = %d hp\" %Wdot\n", + "#difference due to internal rounding off in Python." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 47925.000\n", + "Horsepower output = 5228 hp\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exmaple 8.6, page no. 172" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "g = 1.4\n", + "Tt4 = 2060 #R\n", + "cp = 0.24\n", + "\n", + "#calculation\n", + "Tt5 = Tt4/1.67\n", + "Tt2 = 868 #R\n", + "Tt3s = 1234\n", + "dTt3 = (Tt3s-Tt2)/2.0\n", + "Tt3 = Tt2+dTt3\n", + "Q = cp*(Tt4-Tt3)\n", + "eta = 286*0.401/Q\n", + "\n", + "#result\n", + "\n", + "print \"Heat Added is \", round(Q),\"B/lbm\"\n", + "print \"eta is \", round(eta, 3)\n", + "print \"Improvement is around 6.2 percent in overall efficiency\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat Added is 242.0 B/lbm\n", + "eta is 0.474\n", + "Improvement is around 6.2 percent in overall efficiency\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_F_P_Durham/chapter9.ipynb b/Thermodynamics_by_F_P_Durham/chapter9.ipynb new file mode 100755 index 00000000..5adb2219 --- /dev/null +++ b/Thermodynamics_by_F_P_Durham/chapter9.ipynb @@ -0,0 +1,229 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:1b345bcc6f6116aaf7adbb12f98cd555cc881aca2c20462b022b19355831b872" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 9: Vapour Power Cycles" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.1, page no. 179" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "P = 500 #lb/in^2\n", + "T = 800+460.0 #R\n", + "Pf = 1.0 #lb/in^2\n", + "\n", + "#calculation\n", + "#From table 4 of appendix\n", + "ht1 = 69.7\n", + "vt1 = 0.01614\n", + "W = vt1*(P-Pf)*144\n", + "ht2 = W/778 +ht1\n", + "ht3 = 1412.1\n", + "s3 = 1.6571\n", + "ht4 = 925.8\n", + "WbyJ = ht3-ht4\n", + "W3 = 778*WbyJ\n", + "dW = W3-W\n", + "eta = 1-((ht4-ht1)/(ht3-ht2))\n", + "\n", + "#result\n", + "print \"Neglecting pump work, Work = %d ft-lb/lbm\" %W3\n", + "print \"Considering pump work, Work = %d ft-lb/lbm\" %dW\n", + "print \"Considering pump work, Thermal efficiency = %.3f\" %(eta-0.001)\n", + "print \"Neglecting pump work, Thermal efficiency = 0.362\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Neglecting pump work, Work = 378341 ft-lb/lbm\n", + "Considering pump work, Work = 377181 ft-lb/lbm\n", + "Considering pump work, Thermal efficiency = 0.361\n", + "Neglecting pump work, Thermal efficiency = 0.362\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.2, page no. 181" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "P1 = 400.0 #lb/in^2\n", + "T1 = 800+460.0 #R\n", + "Pt1 = 1.0 #lb/in^2\n", + "T2 = 95+460.0 #R\n", + "Pt2 = 500.0 #lb/in^2\n", + "es = 0.8\n", + "ep = 0.75\n", + "et = 0.8\n", + "\n", + "#calculation\n", + "#From Appendix steam tables and mollier chart\n", + "ht1 = 62.98\n", + "ht3 = 1416.4\n", + "ht4s = 941.1\n", + "vt1 = 0.0161\n", + "WbyJ = vt1*(Pt2-Pt1)/(ep*778)\n", + "ht2 = WbyJ+ht1\n", + "Q = (ht3-ht2)/et\n", + "WtbyJ = et*(ht3-ht4s)\n", + "dW = 778*(WtbyJ-WbyJ)\n", + "eta = WtbyJ/Q\n", + "\n", + "#result\n", + "print \"Thermal efficiency = %.3f\" %eta\n", + "print \"Specific net work = %d B/lbm\" %dW" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thermal efficiency = 0.225\n", + "Specific net work = 295816 B/lbm\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.3, page no. 184" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "P1 = 500 #lb/in^2\n", + "T1 = 800 #F\n", + "\n", + "#calculation\n", + "#From steam tables\n", + "ht1 = 69.7\n", + "ht3 = 1412.1\n", + "s3 = 1.6571\n", + "ht4 = 1175\n", + "Pt4 = 53 \n", + "ht5 = 1430\n", + "s5 = 1.917\n", + "ht6 = 1070\n", + "X6 = 0.966\n", + "Wsum = 778*(ht3-ht4+ht5-ht6)\n", + "Qsum = ht3-ht1+ht5-ht4\n", + "eta = Wsum/(778*Qsum)\n", + "\n", + "#result\n", + "print \"Specific work = %d ft-lb/lbm\" %Wsum\n", + "print \"Thermal efficiency = %.3f \" %eta" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Specific work = 464543 ft-lb/lbm\n", + "Thermal efficiency = 0.374 \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exmaple 9.4, page no. 186" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#initialization\n", + "# From steam tables\n", + "\n", + "ht1 = 218.12\n", + "ht3 = 1412.1\n", + "st3 = 1.6571\n", + "ht4 = 1134.6\n", + "ht5 = 925.8\n", + "ht6 = 69.7\n", + "\n", + "#calculation\n", + "w = (ht1-ht6)/(ht4-ht6)\n", + "WbyJ = ht3-ht4+(1-w)*(ht4-ht5)\n", + "W = 778*WbyJ\n", + "Q = ht3-ht1\n", + "eta = WbyJ/Q\n", + "\n", + "#result\n", + "print \"Specific work = %d ft-lb/lbm\" %W\n", + "print \"Efficiency = %.3f\" %eta" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Specific work = 355700 ft-lb/lbm\n", + "Efficiency = 0.383\n" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Thermodynamics_by_F_P_Durham/screenshots/energy.png b/Thermodynamics_by_F_P_Durham/screenshots/energy.png Binary files differnew file mode 100755 index 00000000..67a7242e --- /dev/null +++ b/Thermodynamics_by_F_P_Durham/screenshots/energy.png diff --git a/Thermodynamics_by_F_P_Durham/screenshots/internal-energy.png b/Thermodynamics_by_F_P_Durham/screenshots/internal-energy.png Binary files differnew file mode 100755 index 00000000..e2055783 --- /dev/null +++ b/Thermodynamics_by_F_P_Durham/screenshots/internal-energy.png diff --git a/Thermodynamics_by_F_P_Durham/screenshots/temprature.png b/Thermodynamics_by_F_P_Durham/screenshots/temprature.png Binary files differnew file mode 100755 index 00000000..24557a42 --- /dev/null +++ b/Thermodynamics_by_F_P_Durham/screenshots/temprature.png |