{
 "metadata": {
  "name": "MP-7"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": "The Hydrogen Atom in Wave Mechanics"
    },
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": "Example 7.2 Page 213"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#initiation of variable\nfrom math import exp\nimport math\nfrom scipy import integrate\n# calculating radial probability  P= (4/ao^3)*inegral(r^2 * e^(-2r/ao)) between the limits 0 and ao for r\n\n#calculation\ndef integrand(x):\n    return ((x**2)*exp(-x))/2.0\nPr=integrate.quad(integrand,0,2,args=());#simplifying where as x=2*r/a0; hence the limits change between 0 to 2\n\n#result\nprint \"Hence the probability of finding the electron nearer to nucleus is\",round(Pr[0],3);\n",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Hence the probability of finding the electron nearer to nucleus is 0.323\n"
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 7.3 Page 213"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#initiation of variable\nfrom math import exp\nimport math\nfrom scipy import integrate\n# employing the formula for probability distribution similarly as done in Exa-7.2 \n#calculation\ndef integrand(x):\n    return (1.0/8)*((4.0*x**2)-(4.0*x**3)+(x**4))*exp(-x)\nPr1= integrate.quad(integrand,0,1,args=())             #x=r/ao; similrly limits between 0 and 1.\n\n#result\nprint\"The probability for l=0 electron is\",round(Pr1[0],5)\n\n#part2\ndef integrand(x):\n    return (1.0/24)*(x**4)*(exp(-x))\nPr2=integrate.quad(integrand,0,1);                            #x=r/ao; similrly limits between 0 and 1.\n\n#result\nprint\"The probability for l=1 electron is\",round(Pr2[0],5)\n",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "The probability for l=0 electron is 0.03432\nThe probability for l=1 electron is 0.00366\n"
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 7.4 Page 215"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#initiation of variable\nfrom math import exp, sqrt\nimport math\nfrom scipy import integrate\nl=1.0;         #given value of l\n\n#calcualtion\nam1=sqrt(l*(l+1));      #angular momentum==sqrt(l(l+1)) h\nl=2.0                     #given l\nam2=sqrt(l*(l+1));\n\n#result\nprint\"The angular momenta are found out to be\", round(am1,3),\" h and\",round(am2,3),\" h respectively for l=1 and l=2.\";\n",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "The angular momenta are found out to be 1.414  h and 2.449  h respectively for l=1 and l=2.\n"
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 7.5 Page 216"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#initiation of variable\nfrom math import sqrt\nprint \"The possible values for m are [+2,-2] and hence any of the 5 components [-2h,2h] are possible for the L vector.\";\nprint\"Length of the vector as found out previously is %.2f*h.\",round(sqrt(6),4);#angular momentum==sqrt(l(l+1)) h",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "The possible values for m are [+2,-2] and hence any of the 5 components [-2h,2h] are possible for the L vector.\nLength of the vector as found out previously is %.2f*h. 2.4495\n"
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 7.6 Page 223"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#initiation of variable\nuz=9.27*10**-24; t=1.4*10**3; x=3.5*10**-2;    #various constants and given values\nm=1.8*10**-25;v=750;                        # mass and velocity of the particle\n\n#calculation\nd=(uz*t*(x**2))/(m*(v**2));                  #net separtion \n\n#result\nprint\"The distance of separation in mm is\",round(d*10**3,3);",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "The distance of separation in mm is 0.157\n"
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 7.7 Page 227"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#initiation of variable\nn1=1.0;n2=2.0;hc=1240.0;    #hc=1240 eV.nm\nE=(-13.6)*((1/n2**2)-(1/n1**2));   #Energy calcuation\n\n#calculation\nw=hc/E;                   #wavelength\nu=9.27*10**-24; B=2;          #constants\ndelE= u*B/(1.6*10**-19);     #change in energy\ndelw=((w**2/hc))*delE;             #change in wavelength\n\n#result\nprint\"The change in wavelength in nm. is\",round(delw,4);",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "The change in wavelength in nm. is 0.0014\n"
      }
     ],
     "prompt_number": 12
    }
   ],
   "metadata": {}
  }
 ]
}