diff options
Diffstat (limited to 'Engineering_Physics/chapter1_2.ipynb')
-rw-r--r-- | Engineering_Physics/chapter1_2.ipynb | 824 |
1 files changed, 744 insertions, 80 deletions
diff --git a/Engineering_Physics/chapter1_2.ipynb b/Engineering_Physics/chapter1_2.ipynb index 33cd96c8..bd2e1aac 100644 --- a/Engineering_Physics/chapter1_2.ipynb +++ b/Engineering_Physics/chapter1_2.ipynb @@ -1,6 +1,7 @@ { "metadata": { - "name": "chapter1" + "name": "", + "signature": "sha256:18ac31f959977ef2080ed3a1b1a6990ce93e604dcfb0f72ab45c0c28a2428e0e" }, "nbformat": 3, "nbformat_minor": 0, @@ -11,25 +12,44 @@ "cell_type": "heading", "level": 1, "metadata": {}, - "source": "Quantum Mechanics and Quantum Computing" + "source": [ + "Quantum Mechanics and Quantum Computing" + ] }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.1, Page number 41" + "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", + "input": [ + "\n", + "#Variable declaration\n", + "c=3*10**8 #velocity of light in m/s\n", + "h=6.626*10**-34 #planks constant \n", + "m=1.67*10**-27 #mass of proton\n", + "\n", + "#Calculation\n", + "v=c/10 #velocity of proton\n", + "lamda=h/(m*v) #de Broglie wave length\n", + "\n", + "#Result\n", + "print(\"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" + "text": [ + "('the de Broglie wavelength in m is ', 1.3225548902195607e-14)\n" + ] } ], "prompt_number": 17 @@ -38,19 +58,38 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.2, Page number 42" + "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", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#Variable declaration\n", + "V=400; #potential in Volts\n", + "\n", + "#Calculation\n", + "lamda=12.56/math.sqrt(V); #de Broglie wavelength\n", + "\n", + "#Result\n", + "print(\"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" + "text": [ + "('The de Broglie wavelength in Armstrong is', 0.628)\n" + ] } ], "prompt_number": 19 @@ -59,19 +98,43 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.3, Page number 42\n" + "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", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#Variable declaration\n", + "m=1.674*10**(-27); #mass of neutron in kg\n", + "h=6.626*10**(-34);\n", + "E=0.025; #kinetic energy in eV\n", + "\n", + "#Calculation\n", + "Ej=E*1.6*10**-19; #kinetic energy in J\n", + "lamda=h/math.sqrt(2*m*Ej); #de Broglie wavelength\n", + "lamdaA=lamda*10**10; #converting wavelength from m to Armstrong\n", + "lamdaA=math.ceil(lamdaA*10**3)/10**3; #rounding off to 3 decimals\n", + "\n", + "#Result\n", + "print(\"The de Broglie wavelength in metres is\",lamda);\n", + "print(\"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" + "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 @@ -80,19 +143,37 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.4, Page number 42" + "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", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#Variable declaration\n", + "V=1600; #potential in Volts\n", + "\n", + "#Calculation\n", + "lamda=12.56/math.sqrt(V); #de Broglie wavelength\n", + "lamda=math.ceil(lamda*10**2)/10**2; #rounding off to 2 decimals\n", + "\n", + "#Result\n", + "print(\"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" + "text": [ + "('The de Broglie wavelength in Armstrong is', 0.32)\n" + ] } ], "prompt_number": 21 @@ -101,19 +182,38 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.5, Page number 42" + "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);", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#Variable declaration\n", + "deltax=0.2; #distance in armstrong\n", + "h=6.626*10**(-34);\n", + "\n", + "#Calculation\n", + "delta_xm=deltax*10**-10; #distance in m\n", + "delta_p=h/(2*math.pi*delta_xm);\n", + "\n", + "#Result\n", + "print(\"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" + "text": [ + "('The uncertainity in momentum of electron in kg m/sec is', 5.2728032646344916e-24)\n" + ] } ], "prompt_number": 22 @@ -122,19 +222,49 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.6, Page number 43" + "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", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#Variable declaration\n", + "n1=1;\n", + "n2=1;\n", + "n3=1; #values in lowest energy\n", + "h=6.62*10**(-34);\n", + "M=9.1*10**-31; #mass in kg\n", + "L=0.1; #side in nm\n", + "\n", + "#Calculation\n", + "L=L*10**-9; #side in m\n", + "n=(n1**2)+(n2**2)+(n3**2);\n", + "E1=(n*h**2)/(8*M*L**2); #energy in j\n", + "E1eV=E1/(1.6*10**-19); #energy in eV\n", + "E1eV=math.ceil(E1eV*10)/10; #rounding off to 1 decimals\n", + "\n", + "#Result\n", + "print(\"lowest energy of electron in Joule is\",E1);\n", + "print(\"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" + "text": [ + "('lowest energy of electron in Joule is', 1.8059505494505486e-17)\n", + "('lowest energy of electron is eV', 112.9)\n" + ] } ], "prompt_number": 23 @@ -143,19 +273,41 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.7, Page number 43" + "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);", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#Variable declaration\n", + "M=9.1*10**(-31); #mass of electron in kg\n", + "h=6.66*10**(-34);\n", + "E=2000; #kinetic energy in eV\n", + "\n", + "#Calculation\n", + "Ej=E*1.6*10**-19; #kinetic energy in J\n", + "lamda=h/math.sqrt(2*M*Ej); #de Broglie wavelength\n", + "lamdaA=lamda*10**9; #converting wavelength from m to nm\n", + "lamdaA=math.ceil(lamdaA*10**3)/10**3; #rounding off to 3 decimals\n", + "\n", + "#Result\n", + "print(\"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" + "text": [ + "('The de Broglie wavelength in nm is', 0.028)\n" + ] } ], "prompt_number": 24 @@ -164,19 +316,41 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.8, Page number 43" + "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", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#Variable declaration\n", + "n=1; #for minimum energy\n", + "h=6.626*10**(-34);\n", + "m=9.1*10**-31; #mass in kg\n", + "L=4*10**-10; #size in m\n", + "\n", + "#Calculation\n", + "E1=(n*h**2)/(8*m*L**2); #energy in j\n", + "\n", + "#Result\n", + "print(\"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" + "text": [ + "('lowest energy of electron in Joule is', 3.7692201236263733e-19)\n" + ] } ], "prompt_number": 23 @@ -185,19 +359,49 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.9, Page number 44" + "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", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "h=6.626*10**(-34);\n", + "m=9.1*10**-31; #mass in kg\n", + "lamda=1.66*10**-10; #wavelength in m\n", + "\n", + "#Calculation\n", + "v=h/(m*lamda); #velocity in m/sec\n", + "v_km=v*10**-3; #velocity in km/sec\n", + "E=(1/2)*m*v**2; #kinetic energy in joule\n", + "EeV=E/(1.6*10**-19); #energy in eV\n", + "EeV=math.ceil(EeV*10**3)/10**3; #rounding off to 3 decimals\n", + "\n", + "#Result\n", + "print(\"velocity of electron in m/sec is\",round(v));\n", + "print(\"velocity of electron in km/sec is\",round(v_km));\n", + "print(\"kinetic energy of electron in Joule is\",E);\n", + "print(\"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" + "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 @@ -206,19 +410,38 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.10, Page number 44" + "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", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#Variable decleration\n", + "V=15; #potential in kV\n", + "\n", + "#Calculation\n", + "v=V*10**3; #potential in V\n", + "lamda=12.26/math.sqrt(v); #de Broglie wavelength\n", + "lamda=math.ceil(lamda*10**2)/10**2 #rounding off to 2 decimals\n", + "\n", + "#result\n", + "print(\"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" + "text": [ + "('The de Broglie wavelength in Armstrong is', 0.11)\n" + ] } ], "prompt_number": 27 @@ -227,19 +450,47 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.11, Page number 44\n" + "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", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#Calculation\n", + "m=1.675*10**-27; #mass of neutron in kg\n", + "h=6.626*10**-34;\n", + "E=10; #kinetic energy in keV\n", + "\n", + "#Calculation\n", + "EeV=E*10**3; #Energy in eV\n", + "Ej=EeV*1.6*10**-19; #kinetic energy in J\n", + "v=math.sqrt(2*Ej/m); #velocity in m/s\n", + "lamda=h/(m*v); #de broglie wavelength in m\n", + "lamda_A=lamda*10**10; #de broglie wavelength in armstrong\n", + "lamda_A=math.ceil(lamda_A*10**4)/10**4 #rounding off to 4 decimals\n", + "\n", + "#Result\n", + "print(\"The velocity in m/sec is\",round(v));\n", + "print(\"The de Broglie wavelength in metres is\",lamda);\n", + "print(\"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" + "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 @@ -248,19 +499,45 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.12, Page number 45" + "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", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#Variable decleration\n", + "m=9.1*10**-31; #mass of electron in kg\n", + "h=6.6*10**-34;\n", + "E=2; #kinetic energy in keV\n", + "\n", + "#Calculation\n", + "EeV=E*10**3; #Energy in eV\n", + "Ej=EeV*1.6*10**-19; #kinetic energy in J\n", + "p=math.sqrt(2*m*Ej); #momentum\n", + "lamda=h/p; #de broglie wavelength in m\n", + "lamda_A=lamda*10**10; #de broglie wavelength in armstrong\n", + "lamda_A=math.ceil(lamda_A*10**4)/10**4 #rounding off to 4 decimals\n", + "\n", + "#Result\n", + "print(\"The de Broglie wavelength in metres is\",lamda);\n", + "print(\"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" + "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 @@ -269,19 +546,44 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.13, Page number 45" + "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", + "input": [ + " \n", + "#import module\n", + "import math\n", + "\n", + "#Variable decleration\n", + "m=1.676*10**-27; #mass of neutron in kg\n", + "h=6.62*10**-34;\n", + "E=0.025; #kinetic energy in eV\n", + "\n", + "#Calculation\n", + "Ej=E*1.6*10**-19; #kinetic energy in J\n", + "v=math.sqrt(2*Ej/m); #velocity in m/s\n", + "lamda=h/(m*v); #wavelength in m\n", + "lamda_A=lamda*10**10; #de broglie wavelength in armstrong\n", + "lamda_A=math.ceil(lamda_A*10**5)/10**5 #rounding off to 5 decimals\n", + "\n", + "#Result\n", + "print(\"The neutrons wavelength in metres is\",lamda);\n", + "print(\"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" + "text": [ + "('The neutrons wavelength in metres is', 1.8079065940980725e-10)\n", + "('The wavelength in Armstrong is', 1.80791)\n" + ] } ], "prompt_number": 30 @@ -290,19 +592,37 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.14, Page number 45" + "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);", + "input": [ + " \n", + "#import module\n", + "import math\n", + "\n", + "#Variable decleration\n", + "V=10; #potential in kV\n", + "\n", + "#Calculation\n", + "V=V*10**3; #potential in V\n", + "lamda=12.26/math.sqrt(V); #wavelength\n", + "\n", + "#Result\n", + "print(\"The wavelength in Armstrong is\",lamda);" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "('The wavelength in Armstrong is', 0.1226)\n" + "text": [ + "('The wavelength in Armstrong is', 0.1226)\n" + ] } ], "prompt_number": 31 @@ -311,19 +631,56 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.15, Page number 45" + "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", + "input": [ + " \n", + "#import module\n", + "import math\n", + "\n", + "#Varialble decleration\n", + "h=6.626*10**-34;\n", + "m=9.1*10**-31; #mass in kg\n", + "l=1; #width in armstrong\n", + "\n", + "#Calculation\n", + "L=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)\n", + "X = h**2/(8*m*L**2); #energy in J\n", + "XeV=X/(1.6*10**-19); #energy in eV\n", + "#in the 1st level n1=1\n", + "n1=1;\n", + "E1=(n1**2)*XeV; #energy in eV\n", + "\n", + "#in second level n2=2\n", + "n2=2;\n", + "E2=(n2**2)*XeV; #energy in eV\n", + "#in third level n3=\n", + "n3=3;\n", + "E3=(n3**2)*XeV; #energy in eV\n", + "\n", + "#Result\n", + "print(\"minimum energy the electron can have in eV is\",round(E1));\n", + "print(\"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" + "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 @@ -332,19 +689,44 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.16, Page number 46\n" + "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", + "input": [ + " \n", + "#import module\n", + "import math\n", + "\n", + "#Variable decleration\n", + "n=1; #lowest state\n", + "L=10; #width in armstrong\n", + "\n", + "#Calculation\n", + "L=L*10**-10; #width in m\n", + "x=L/2;\n", + "delta_x=1; #interval in armstrong\n", + "delta_x=delta_x*10**-10; #interval in m\n", + "psi1=(math.sqrt(2/L))*math.sin(math.pi*x/L);\n", + "A=psi1**2;\n", + "p=A*delta_x;\n", + "p=math.ceil(p*10)/10; #de broglie wavelength in armstrong\n", + "\n", + "#Result\n", + "print(\"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" + "text": [ + "('probability of finding the particle is ', 0.2)\n" + ] } ], "prompt_number": 33 @@ -353,19 +735,46 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.17, Page number 46" + "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", + "input": [ + " \n", + "#import module\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable decleration\n", + "d=970; #density of Na in kg/m^3\n", + "n=6.02*10**26;\n", + "h=6.62*10**(-34);\n", + "m=9.1*10**-31; #mass in kg\n", + "w=23; #atomic weight\n", + "\n", + "#Calculation\n", + "N=(d*n)/w; #number of atoms per m^3\n", + "A=(h**2)/(8*m);\n", + "B=(3*N)/math.pi;\n", + "Ef=A*B**(2/3);\n", + "EfeV=Ef/(1.6*10**-19);\n", + "EfeV=math.ceil(EfeV*10**2)/10**2 #rounding of to 2 decimals\n", + "\n", + "#Result\n", + "print(\"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" + "text": [ + "('fermi energy of Na in eV is', 3.16)\n" + ] } ], "prompt_number": 34 @@ -374,19 +783,48 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.18, Page number 46" + "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", + "input": [ + " \n", + "#import module\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable decleration\n", + "n1=1;\n", + "n2=1;\n", + "n3=1; #values in lowest energy\n", + "h=6.62*10**(-34);\n", + "m=9.1*10**-31; #mass in kg\n", + "L=0.1; #side in nm\n", + "\n", + "#Calculation\n", + "L=L*10**-9; #side in m\n", + "n=(n1**2)+(n2**2)+(n3**2);\n", + "E1=(n*h**2)/(8*m*L**2); #energy in j\n", + "E1eV=E1/(1.6*10**-19); #energy in eV\n", + "E1eV=math.ceil(E1eV*10**1)/10**1 #rounding off to 2 decimals\n", + "\n", + "#Result\n", + "print(\"lowest energy of electron in Joule is\",E1);\n", + "print(\"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" + "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 @@ -395,19 +833,43 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.19, Page number 47" + "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);", + "input": [ + " \n", + "#import module\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable decleration\n", + "mn=1.676*10**-27; #mass of neutron in kg\n", + "me=9.1*10**-31; #mass of electron in kg\n", + "h=6.62*10**-34;\n", + "c=3*10**8; #velocity of light in m/sec\n", + "\n", + "#Calculation\n", + "En=2*me*c**2;\n", + "lamda=h/math.sqrt(2*mn*En); #wavelength in m\n", + "lamda_A=lamda*10**10; #converting lamda from m to A\n", + "lamda_A=math.ceil(lamda_A*10**6)/10**6 #rounding off to 6 decimals\n", + "\n", + "#Result\n", + "print(\"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" + "text": [ + "('The de broglie wavelength in Angstrom is', 0.000283)\n" + ] } ], "prompt_number": 36 @@ -416,19 +878,58 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.20, Page number 47 ***************************************************************************" + "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", + "input": [ + "\n", + "\n", + "#import module\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable decleration\n", + "n2=2; #second quantum state\n", + "n4=4; #fourth quantum state\n", + "h=6.626*10**-34;\n", + "m=9.1*10**-31; #mass in kg\n", + "a=2; #potential box length in armstrong\n", + "\n", + "#Calculation\n", + "a=a*10**-10; #length in m\n", + "A=n2**2*h**2;\n", + "B=8*m*a**2;\n", + "E2=A/B; #energy in j\n", + "E2eV=E2/(1.6*10**-19); #energy in eV\n", + "C=n4**2*h**2;\n", + "E4=C/B; #energy in j\n", + "E4eV=E4/(1.6*10**-19); #energy in eV\n", + "\n", + "#Result\n", + "print(\"energy corresponding to second quantum state in Joule is\",E2);\n", + "print(\"energy corresponding to second quantum state in eV is\",E2eV);\n", + "print(\"energy corresponding to fourth quantum state in Joule is\",E4);\n", + "print(\"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" + "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 @@ -437,19 +938,40 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.21, Page number 48 ***********" + "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);", + "input": [ + " \n", + "#import module\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable decleration\n", + "V=344; #accelerated voltage in V\n", + "n=1; #first reflection\n", + "theta=60; #glancing angle in degrees\n", + "\n", + "#Calculation\n", + "lamda=12.27/math.sqrt(V);\n", + "d=(n*lamda)/(2*math.sin(theta));\n", + "\n", + "#Result\n", + "print(\"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" + "text": [ + "('The spacing of the crystal in Angstrom is', 0.6615540636030947)\n" + ] } ], "prompt_number": 38 @@ -458,19 +980,61 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.22, Page number 49 *************" + "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", + "input": [ + " \n", + "#import module\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable decleration\n", + "n2=2; #second quantum state\n", + "n3=3; #fourth quantum state\n", + "h=6.626*10**-34;\n", + "m=9.1*10**-31; #mass in kg\n", + "a=1*10**-10; #width of potential well in m\n", + "\n", + "#Calculation\n", + "B=8*m*a**2;\n", + "E1=h**2/B; #ground state energy\n", + "E1eV=E1/(1.6*10**-19); #energy in eV\n", + "A=n2**2*h**2;\n", + "E2=A/B; #energy in j\n", + "E2eV=E2/(1.6*10**-19); #energy in eV\n", + "C=n3**2*h**2;\n", + "E3=C/B; #energy in j\n", + "E3eV=E3/(1.6*10**-19); #energy in eV\n", + "E1=math.ceil(E1*10**3)/10**3 #rounding off to 3 decimals\n", + "E1eV=math.ceil(E1eV*10**3)/10**3 #rounding off to 3 decimals\n", + "E2eV=math.ceil(E2eV*10**3)/10**3 #rounding off to 3 decimals\n", + "E3eV=math.ceil(E3eV*10**3)/10**3 #rounding off to 3 decimals\n", + "\n", + "#Result\n", + "print(\"ground state energy in Joule is\",E1);\n", + "print(\"ground state energy in eV is\",E1eV);\n", + "print(\"first energy state in eV is\",E2eV);\n", + "print(\"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" + "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 @@ -479,12 +1043,35 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.23, Page number 49" + "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)", + "input": [ + " \n", + "#import module\n", + "import math\n", + "\n", + "#Variable decleration\n", + "n3=3; #fourth quantum state\n", + "h=6.626*10**-34;\n", + "m=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": [], @@ -494,19 +1081,43 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.24, Page number 50" + "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", + "input": [ + " \n", + "#import module\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable decleration\n", + "delta_x=10**-8; #length of box in m\n", + "h=6.626*10**-34;\n", + "m=9.1*10**-31; #mass in kg\n", + "\n", + "#Calculation\n", + "delta_v=h/(m*delta_x); #uncertainity in m/sec\n", + "delta_vk=delta_v*10**-3; #uncertainity in km/sec\n", + "delta_vk=math.ceil(delta_vk*10**2)/10**2 #rounding off to 2 decimals\n", + "\n", + "#Result\n", + "print(\"minimum uncertainity in velocity in m/sec is\",round(delta_v));\n", + "print(\"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" + "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 @@ -515,19 +1126,42 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.25, Page number 50" + "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);", + "input": [ + " \n", + "#import module\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable decleration\n", + "mp=1.6*10**-27; #mass of proton in kg\n", + "me=9.1*10**-31; #mass of electron in kg\n", + "h=6.626*10**(-34);\n", + "c=3*10**10; #velocity of light in m/sec\n", + "\n", + "#Calculation\n", + "Ep=me*c**2;\n", + "lamda=h/math.sqrt(2*mp*Ep); #wavelength in m\n", + "lamda_A=lamda*10**10; #converting lamda from m to A\n", + "\n", + "#Result\n", + "print(\"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" + "text": [ + "('The de broglie wavelength in Angstrom is', 4.092931643497047e-06)\n" + ] } ], "prompt_number": 41 @@ -536,19 +1170,49 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.26, Page number 51 *************************************************" + "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", + "input": [ + " \n", + "#import module\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable decleration\n", + "m=1.675*10**(-27); #mass of neutron in kg\n", + "h=6.626*10**(-34);\n", + "n=1; #diffractive order\n", + "d=0.314; #spacing in nm\n", + "E=0.04; #kinetic energy in eV\n", + "\n", + "#Calculation\n", + "d=d*10**-9; #spacing in m\n", + "Ej=E*1.6*10**-19; #kinetic energy in J\n", + "lamda=h/math.sqrt(2*m*Ej); #de Broglie wavelength\n", + "lamdaA=lamda*10**9; #converting wavelength from m to nm\n", + "theta=math.asin((n*lamda)/(2*d));\n", + "print(\"The de Broglie wavelength in metres is\",lamda);\n", + "print(\"The de Broglie wavelength in nm is\",lamdaA);\n", + "print(\"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" + "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 @@ -556,7 +1220,7 @@ { "cell_type": "code", "collapsed": false, - "input": "", + "input": [], "language": "python", "metadata": {}, "outputs": [] |