diff options
Diffstat (limited to 'Engineering_Physics/chapter1_2.ipynb')
-rw-r--r-- | Engineering_Physics/chapter1_2.ipynb | 568 |
1 files changed, 568 insertions, 0 deletions
diff --git a/Engineering_Physics/chapter1_2.ipynb b/Engineering_Physics/chapter1_2.ipynb new file mode 100644 index 00000000..33cd96c8 --- /dev/null +++ b/Engineering_Physics/chapter1_2.ipynb @@ -0,0 +1,568 @@ +{ + "metadata": { + "name": "chapter1" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": "Quantum Mechanics and Quantum Computing" + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.1, Page number 41" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "#to calculate the de Broglie wavelength\n\n#Variable declaration\nc=3*10**8 #velocity of light in m/s\nh=6.626*10**-34 #planks constant \nm=1.67*10**-27 #mass of proton\n\n#Calculation\nv=c/10 #velocity of proton\nlamda=h/(m*v) #de Broglie wave length\n\n#Result\nprint(\"the de Broglie wavelength in m is \",lamda);\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('the de Broglie wavelength in m is ', 1.3225548902195607e-14)\n" + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.2, Page number 42" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the de Broglie wavelength of an electron\n\n#importing modules\nimport math\n\n#Variable declaration\nV=400; #potential in Volts\n\n#Calculation\nlamda=12.56/math.sqrt(V); #de Broglie wavelength\n\n#Result\nprint(\"The de Broglie wavelength in Armstrong is\",lamda);\n\n#answer given in the book is wrong", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('The de Broglie wavelength in Armstrong is', 0.628)\n" + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.3, Page number 42\n" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the de Broglie wavelength of neutron\n\n#importing modules\nimport math\n\n#Variable declaration\nm=1.674*10**(-27); #mass of neutron in kg\nh=6.626*10**(-34);\nE=0.025; #kinetic energy in eV\n\n#Calculation\nEj=E*1.6*10**-19; #kinetic energy in J\nlamda=h/math.sqrt(2*m*Ej); #de Broglie wavelength\nlamdaA=lamda*10**10; #converting wavelength from m to Armstrong\nlamdaA=math.ceil(lamdaA*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"The de Broglie wavelength in metres is\",lamda);\nprint(\"The de Broglie wavelength in Armstrong is\",lamdaA);\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('The de Broglie wavelength in metres is', 1.81062582829353e-10)\n('The de Broglie wavelength in Armstrong is', 1.811)\n" + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.4, Page number 42" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the de Broglie wavelength of an electron\n\n#importing modules\nimport math\n\n#Variable declaration\nV=1600; #potential in Volts\n\n#Calculation\nlamda=12.56/math.sqrt(V); #de Broglie wavelength\nlamda=math.ceil(lamda*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"The de Broglie wavelength in Armstrong is\",lamda);\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('The de Broglie wavelength in Armstrong is', 0.32)\n" + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.5, Page number 42" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the uncertainity in momentum\n\n#importing modules\nimport math\n\n#Variable declaration\ndeltax=0.2; #distance in armstrong\nh=6.626*10**(-34);\n\n#Calculation\ndelta_xm=deltax*10**-10; #distance in m\ndelta_p=h/(2*math.pi*delta_xm);\n\n#Result\nprint(\"The uncertainity in momentum of electron in kg m/sec is\",delta_p);", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('The uncertainity in momentum of electron in kg m/sec is', 5.2728032646344916e-24)\n" + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.6, Page number 43" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the lowest energy of electron\n\n#importing modules\nimport math\n\n#Variable declaration\nn1=1;\nn2=1;\nn3=1; #values in lowest energy\nh=6.62*10**(-34);\nM=9.1*10**-31; #mass in kg\nL=0.1; #side in nm\n\n#Calculation\nL=L*10**-9; #side in m\nn=(n1**2)+(n2**2)+(n3**2);\nE1=(n*h**2)/(8*M*L**2); #energy in j\nE1eV=E1/(1.6*10**-19); #energy in eV\nE1eV=math.ceil(E1eV*10)/10; #rounding off to 1 decimals\n\n#Result\nprint(\"lowest energy of electron in Joule is\",E1);\nprint(\"lowest energy of electron is eV\",E1eV);\n\n#answer for lowest energy in eV given in the book is wrong", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('lowest energy of electron in Joule is', 1.8059505494505486e-17)\n('lowest energy of electron is eV', 112.9)\n" + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.7, Page number 43" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the de Broglie wavelength of neutron\n\n#importing modules\nimport math\n\n#Variable declaration\nM=9.1*10**(-31); #mass of electron in kg\nh=6.66*10**(-34);\nE=2000; #kinetic energy in eV\n\n#Calculation\nEj=E*1.6*10**-19; #kinetic energy in J\nlamda=h/math.sqrt(2*M*Ej); #de Broglie wavelength\nlamdaA=lamda*10**9; #converting wavelength from m to nm\nlamdaA=math.ceil(lamdaA*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"The de Broglie wavelength in nm is\",lamdaA);", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('The de Broglie wavelength in nm is', 0.028)\n" + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.8, Page number 43" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the minimum energy of electron\n\n#importing modules\nimport math\n\n#Variable declaration\nn=1; #for minimum energy\nh=6.626*10**(-34);\nm=9.1*10**-31; #mass in kg\nL=4*10**-10; #size in m\n\n#Calculation\nE1=(n*h**2)/(8*m*L**2); #energy in j\n\n#Result\nprint(\"lowest energy of electron in Joule is\",E1);\n\n#answer given in the book is wrong", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('lowest energy of electron in Joule is', 3.7692201236263733e-19)\n" + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.9, Page number 44" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the velocity and kinetic energy of electron\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nh=6.626*10**(-34);\nm=9.1*10**-31; #mass in kg\nlamda=1.66*10**-10; #wavelength in m\n\n#Calculation\nv=h/(m*lamda); #velocity in m/sec\nv_km=v*10**-3; #velocity in km/sec\nE=(1/2)*m*v**2; #kinetic energy in joule\nEeV=E/(1.6*10**-19); #energy in eV\nEeV=math.ceil(EeV*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"velocity of electron in m/sec is\",round(v));\nprint(\"velocity of electron in km/sec is\",round(v_km));\nprint(\"kinetic energy of electron in Joule is\",E);\nprint(\"kinetic energy of electron in eV is\",EeV);\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('velocity of electron in m/sec is', 4386337.0)\n('velocity of electron in km/sec is', 4386.0)\n('kinetic energy of electron in Joule is', 8.754176510091736e-18)\n('kinetic energy of electron in eV is', 54.714)\n" + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.10, Page number 44" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the wavelength of an electron\n\n#importing modules\nimport math\n\n#Variable decleration\nV=15; #potential in kV\n\n#Calculation\nv=V*10**3; #potential in V\nlamda=12.26/math.sqrt(v); #de Broglie wavelength\nlamda=math.ceil(lamda*10**2)/10**2 #rounding off to 2 decimals\n\n#result\nprint(\"The de Broglie wavelength in Armstrong is\",lamda);\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('The de Broglie wavelength in Armstrong is', 0.11)\n" + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.11, Page number 44\n" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the de Broglie wavelength of neutron\n\n#importing modules\nimport math\n\n#Calculation\nm=1.675*10**-27; #mass of neutron in kg\nh=6.626*10**-34;\nE=10; #kinetic energy in keV\n\n#Calculation\nEeV=E*10**3; #Energy in eV\nEj=EeV*1.6*10**-19; #kinetic energy in J\nv=math.sqrt(2*Ej/m); #velocity in m/s\nlamda=h/(m*v); #de broglie wavelength in m\nlamda_A=lamda*10**10; #de broglie wavelength in armstrong\nlamda_A=math.ceil(lamda_A*10**4)/10**4 #rounding off to 4 decimals\n\n#Result\nprint(\"The velocity in m/sec is\",round(v));\nprint(\"The de Broglie wavelength in metres is\",lamda);\nprint(\"The de Broglie wavelength in Armstrong is\",lamda_A);\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('The velocity in m/sec is', 1382189.0)\n('The de Broglie wavelength in metres is', 2.861996093951046e-13)\n('The de Broglie wavelength in Armstrong is', 0.0029)\n" + } + ], + "prompt_number": 28 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.12, Page number 45" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the de Broglie wavelength of electron\n\n#importing modules\nimport math\n\n#Variable decleration\nm=9.1*10**-31; #mass of electron in kg\nh=6.6*10**-34;\nE=2; #kinetic energy in keV\n\n#Calculation\nEeV=E*10**3; #Energy in eV\nEj=EeV*1.6*10**-19; #kinetic energy in J\np=math.sqrt(2*m*Ej); #momentum\nlamda=h/p; #de broglie wavelength in m\nlamda_A=lamda*10**10; #de broglie wavelength in armstrong\nlamda_A=math.ceil(lamda_A*10**4)/10**4 #rounding off to 4 decimals\n\n#Result\nprint(\"The de Broglie wavelength in metres is\",lamda);\nprint(\"The de Broglie wavelength in Armstrong is\",lamda_A);\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('The de Broglie wavelength in metres is', 2.7348483695436575e-11)\n('The de Broglie wavelength in Armstrong is', 0.2735)\n" + } + ], + "prompt_number": 29 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.13, Page number 45" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the wavelength of thermal neutron\n\n#import module\nimport math\n\n#Variable decleration\nm=1.676*10**-27; #mass of neutron in kg\nh=6.62*10**-34;\nE=0.025; #kinetic energy in eV\n\n#Calculation\nEj=E*1.6*10**-19; #kinetic energy in J\nv=math.sqrt(2*Ej/m); #velocity in m/s\nlamda=h/(m*v); #wavelength in m\nlamda_A=lamda*10**10; #de broglie wavelength in armstrong\nlamda_A=math.ceil(lamda_A*10**5)/10**5 #rounding off to 5 decimals\n\n#Result\nprint(\"The neutrons wavelength in metres is\",lamda);\nprint(\"The wavelength in Armstrong is\",lamda_A);\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('The neutrons wavelength in metres is', 1.8079065940980725e-10)\n('The wavelength in Armstrong is', 1.80791)\n" + } + ], + "prompt_number": 30 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.14, Page number 45" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the wavelength of an electron\n\n#import module\nimport math\n\n#Variable decleration\nV=10; #potential in kV\n\n#Calculation\nV=V*10**3; #potential in V\nlamda=12.26/math.sqrt(V); #wavelength\n\n#Result\nprint(\"The wavelength in Armstrong is\",lamda);", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('The wavelength in Armstrong is', 0.1226)\n" + } + ], + "prompt_number": 31 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.15, Page number 45" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the first three permitted levels of electron\n\n#import module\nimport math\n\n#Varialble decleration\nh=6.626*10**-34;\nm=9.1*10**-31; #mass in kg\nl=1; #width in armstrong\n\n#Calculation\nL=l*10**-10; #width in m\n#permitted electron energies En=(n**2*h**2)/(8*m*L**2)\n#let X = h**2/(8*m*L**2)\nX = h**2/(8*m*L**2); #energy in J\nXeV=X/(1.6*10**-19); #energy in eV\n#in the 1st level n1=1\nn1=1;\nE1=(n1**2)*XeV; #energy in eV\n\n#in second level n2=2\nn2=2;\nE2=(n2**2)*XeV; #energy in eV\n#in third level n3=\nn3=3;\nE3=(n3**2)*XeV; #energy in eV\n\n#Result\nprint(\"minimum energy the electron can have in eV is\",round(E1));\nprint(\"other values of energy are in eV and in eV\",round(E2),round(E3));\n\n#answers given in the book are wrong", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('minimum energy the electron can have in eV is', 38.0)\n('other values of energy are in eV and in eV', 151.0, 339.0)\n" + } + ], + "prompt_number": 32 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.16, Page number 46\n" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the probability of finding the particle\n\n#import module\nimport math\n\n#Variable decleration\nn=1; #lowest state\nL=10; #width in armstrong\n\n#Calculation\nL=L*10**-10; #width in m\nx=L/2;\ndelta_x=1; #interval in armstrong\ndelta_x=delta_x*10**-10; #interval in m\npsi1=(math.sqrt(2/L))*math.sin(math.pi*x/L);\nA=psi1**2;\np=A*delta_x;\np=math.ceil(p*10)/10; #de broglie wavelength in armstrong\n\n#Result\nprint(\"probability of finding the particle is \",p);\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('probability of finding the particle is ', 0.2)\n" + } + ], + "prompt_number": 33 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.17, Page number 46" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the Fermi energy of the metal\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nd=970; #density of Na in kg/m^3\nn=6.02*10**26;\nh=6.62*10**(-34);\nm=9.1*10**-31; #mass in kg\nw=23; #atomic weight\n\n#Calculation\nN=(d*n)/w; #number of atoms per m^3\nA=(h**2)/(8*m);\nB=(3*N)/math.pi;\nEf=A*B**(2/3);\nEfeV=Ef/(1.6*10**-19);\nEfeV=math.ceil(EfeV*10**2)/10**2 #rounding of to 2 decimals\n\n#Result\nprint(\"fermi energy of Na in eV is\",EfeV);\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('fermi energy of Na in eV is', 3.16)\n" + } + ], + "prompt_number": 34 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.18, Page number 46" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the lowest energy of electron\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nn1=1;\nn2=1;\nn3=1; #values in lowest energy\nh=6.62*10**(-34);\nm=9.1*10**-31; #mass in kg\nL=0.1; #side in nm\n\n#Calculation\nL=L*10**-9; #side in m\nn=(n1**2)+(n2**2)+(n3**2);\nE1=(n*h**2)/(8*m*L**2); #energy in j\nE1eV=E1/(1.6*10**-19); #energy in eV\nE1eV=math.ceil(E1eV*10**1)/10**1 #rounding off to 2 decimals\n\n#Result\nprint(\"lowest energy of electron in Joule is\",E1);\nprint(\"lowest energy of electron in eV is\",E1eV);\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('lowest energy of electron in Joule is', 1.8059505494505486e-17)\n('lowest energy of electron in eV is', 112.9)\n" + } + ], + "prompt_number": 35 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.19, Page number 47" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the de broglie wavelength of neutron\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nmn=1.676*10**-27; #mass of neutron in kg\nme=9.1*10**-31; #mass of electron in kg\nh=6.62*10**-34;\nc=3*10**8; #velocity of light in m/sec\n\n#Calculation\nEn=2*me*c**2;\nlamda=h/math.sqrt(2*mn*En); #wavelength in m\nlamda_A=lamda*10**10; #converting lamda from m to A\nlamda_A=math.ceil(lamda_A*10**6)/10**6 #rounding off to 6 decimals\n\n#Result\nprint(\"The de broglie wavelength in Angstrom is\",lamda_A);", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('The de broglie wavelength in Angstrom is', 0.000283)\n" + } + ], + "prompt_number": 36 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.20, Page number 47 ***************************************************************************" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the energies of electron\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nn2=2; #second quantum state\nn4=4; #fourth quantum state\nh=6.626*10**-34;\nm=9.1*10**-31; #mass in kg\na=2; #potential box length in armstrong\n\n#Calculation\na=a*10**-10; #length in m\nA=n2**2*h**2;\nB=8*m*a**2;\nE2=A/B; #energy in j\nE2eV=E2/(1.6*10**-19); #energy in eV\nC=n4**2*h**2;\nE4=C/B; #energy in j\nE4eV=E4/(1.6*10**-19); #energy in eV\n\n#Result\nprint(\"energy corresponding to second quantum state in Joule is\",E2);\nprint(\"energy corresponding to second quantum state in eV is\",E2eV);\nprint(\"energy corresponding to fourth quantum state in Joule is\",E4);\nprint(\"energy corresponding to fourth quantum state in eV is\",E4eV);\n\n\n#answers given in the book are wrong", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('energy corresponding to second quantum state in Joule is', 6.030752197802197e-18)\n('energy corresponding to second quantum state in eV is', 37.69220123626373)\n('energy corresponding to fourth quantum state in Joule is', 2.412300879120879e-17)\n('energy corresponding to fourth quantum state in eV is', 150.7688049450549)\n" + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.21, Page number 48 ***********" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the spacing of the crystal\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nV=344; #accelerated voltage in V\nn=1; #first reflection\ntheta=60; #glancing angle in degrees\n\n#Calculation\nlamda=12.27/math.sqrt(V);\nd=(n*lamda)/(2*math.sin(theta));\n\n#Result\nprint(\"The spacing of the crystal in Angstrom is\",lamda);", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('The spacing of the crystal in Angstrom is', 0.6615540636030947)\n" + } + ], + "prompt_number": 38 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.22, Page number 49 *************" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the energies of electron\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nn2=2; #second quantum state\nn3=3; #fourth quantum state\nh=6.626*10**-34;\nm=9.1*10**-31; #mass in kg\na=1*10**-10; #width of potential well in m\n\n#Calculation\nB=8*m*a**2;\nE1=h**2/B; #ground state energy\nE1eV=E1/(1.6*10**-19); #energy in eV\nA=n2**2*h**2;\nE2=A/B; #energy in j\nE2eV=E2/(1.6*10**-19); #energy in eV\nC=n3**2*h**2;\nE3=C/B; #energy in j\nE3eV=E3/(1.6*10**-19); #energy in eV\nE1=math.ceil(E1*10**3)/10**3 #rounding off to 3 decimals\nE1eV=math.ceil(E1eV*10**3)/10**3 #rounding off to 3 decimals\nE2eV=math.ceil(E2eV*10**3)/10**3 #rounding off to 3 decimals\nE3eV=math.ceil(E3eV*10**3)/10**3 #rounding off to 3 decimals\n\n#Result\nprint(\"ground state energy in Joule is\",E1);\nprint(\"ground state energy in eV is\",E1eV);\nprint(\"first energy state in eV is\",E2eV);\nprint(\"second energy state in eV is\",E3eV);\n\n#answers given in the book are wrong by one decimal", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('ground state energy in Joule is', 0.001)\n('ground state energy in eV is', 37.693)\n('first energy state in eV is', 150.769)\n('second energy state in eV is', 339.23)\n" + } + ], + "prompt_number": 39 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.23, Page number 49" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the energy required to jump an electron\n\n#import module\nimport math\n\n#Variable decleration\nn3=3; #fourth quantum state\nh=6.626*10**-34;\nm=9.1*10**-31; #mass in kg\n\n\n#ground state energy E1 = h**2/(8*m*a**2)\n#second excited state E3 = (9*h**2)/(8*m*a**2)\n#required energy E = E3-E1\n#E = (9*h**2)/(8*m*a**2) - h**2/(8*m*a**2)\n#E = (h**2/(8*m*a**2))*(9-1)\n#therefore E = (8*h**2)/(8*m*a**2)\n#hence E = (h**2)/(m*a**2)\n\n#Result \n# the required energy is E = (h**2)/(m*a**2)", + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.24, Page number 50" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the minimum uncertainity in velocity\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\ndelta_x=10**-8; #length of box in m\nh=6.626*10**-34;\nm=9.1*10**-31; #mass in kg\n\n#Calculation\ndelta_v=h/(m*delta_x); #uncertainity in m/sec\ndelta_vk=delta_v*10**-3; #uncertainity in km/sec\ndelta_vk=math.ceil(delta_vk*10**2)/10**2 #rounding off to 2 decimals\n\n#Result\nprint(\"minimum uncertainity in velocity in m/sec is\",round(delta_v));\nprint(\"minimum uncertainity in velocity in km/sec is\",delta_vk);\n", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('minimum uncertainity in velocity in m/sec is', 72813.0)\n('minimum uncertainity in velocity in km/sec is', 72.82)\n" + } + ], + "prompt_number": 40 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.25, Page number 50" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the de broglie wavelength of proton\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nmp=1.6*10**-27; #mass of proton in kg\nme=9.1*10**-31; #mass of electron in kg\nh=6.626*10**(-34);\nc=3*10**10; #velocity of light in m/sec\n\n#Calculation\nEp=me*c**2;\nlamda=h/math.sqrt(2*mp*Ep); #wavelength in m\nlamda_A=lamda*10**10; #converting lamda from m to A\n\n#Result\nprint(\"The de broglie wavelength in Angstrom is\",lamda_A);", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('The de broglie wavelength in Angstrom is', 4.092931643497047e-06)\n" + } + ], + "prompt_number": 41 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": "Example number 1.26, Page number 51 *************************************************" + }, + { + "cell_type": "code", + "collapsed": false, + "input": "# To calculate the glancing angle\n\n#import module\nimport math\nfrom __future__ import division\n\n#Variable decleration\nm=1.675*10**(-27); #mass of neutron in kg\nh=6.626*10**(-34);\nn=1; #diffractive order\nd=0.314; #spacing in nm\nE=0.04; #kinetic energy in eV\n\n#Calculation\nd=d*10**-9; #spacing in m\nEj=E*1.6*10**-19; #kinetic energy in J\nlamda=h/math.sqrt(2*m*Ej); #de Broglie wavelength\nlamdaA=lamda*10**9; #converting wavelength from m to nm\ntheta=math.asin((n*lamda)/(2*d));\nprint(\"The de Broglie wavelength in metres is\",lamda);\nprint(\"The de Broglie wavelength in nm is\",lamdaA);\nprint(\"glancing angle in degrees is\",theta);\n\n#answer given in the book is wrong", + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": "('The de Broglie wavelength in metres is', 1.4309980469755228e-10)\n('The de Broglie wavelength in nm is', 0.1430998046975523)\n('glancing angle in degrees is', 0.2298853909391574)\n" + } + ], + "prompt_number": 16 + }, + { + "cell_type": "code", + "collapsed": false, + "input": "", + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file |