{ "metadata": { "name": "MP-5" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": "The Schrodinger Equation" }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": "Example 5.2 Page 150" }, { "cell_type": "code", "collapsed": false, "input": "#initation of variable\n#parta\nfrom math import pi, sin\nimport math\nfrom scipy import integrate\nh=1.05*10**-34;m=9.11*10**-31;L=10.0**-10; # all the values are taken in SI units\nE1=h**2*pi**2/(2*m*L**2); E2=4*E1; #Energies are calculated\ndelE=(E2-E1)/(1.6*10**-19); #Difference in energy is converted to eV\n\n#result\nprint \"Energy to be supplied in eV. is \",round(delE,3);\n\n#partb\nx1=0.09*10**-10;x2=0.11*10**-10 #limits of the given region\ndef integrand(x,L):\n return 2.0/L*(sin(pi*x/L))**2\n\nprobGnd=integrate.quad(integrand,x1,x2,args=(L))\n\n#result\nprint \"The percentage probablility of finding an electron in the ground state is \\n\",round(probGnd[0]*100,3);\n\n#partc\nk1=0.0;k2=0.25*10**-10;\ndef integrand(k,L):\n return 2.0/L*(sin(2*pi*k/L))**2\n\nprobExc=integrate.quad(integrand,k1,k2,args=(L))\n\n#result\nprint \"The probablility of finding an electron in the excited state is\",round(probExc[0],3);", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": " Energy to be supplied in eV. is 111.978\nThe percentage probablility of finding an electron in the ground state is \n0.383\nThe probablility of finding an electron in the excited state is 0.25\n" } ], "prompt_number": 7 }, { "cell_type": "code", "collapsed": false, "input": "", "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] }