{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 12 - Quantum theory"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E1 - Pg 276"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the number of photons required\n",
      "#Initialization of variables\n",
      "import math\n",
      "P=100. #W\n",
      "t=10. #s\n",
      "l=560. #nm\n",
      "#calculations\n",
      "TE=P*t\n",
      "E1=6.626*math.pow(10,-34) *2.998*math.pow(10,8) /(l*math.pow(10,-9))\n",
      "N=TE/E1\n",
      "#results\n",
      "print '%s %.2e' %(\"No. of photons required = \",N)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "No. of photons required =  2.82e+21\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E2 - Pg 278"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the wavelength of electrons\n",
      "#Initialization of variables\n",
      "import math\n",
      "V=1000. #V\n",
      "#calculations\n",
      "l=6.626*math.pow(10,-34) /math.sqrt(2*9.11*math.pow(10,-31) *1.602*math.pow(10,-19) *V)\n",
      "#results\n",
      "print '%s %.2e %s' %(\"Wavelength of electrons =\",l,\" m\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Wavelength of electrons = 3.88e-11  m\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E3 - Pg 282"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the no. of times the electron would be more propable at r2 than at r1\n",
      "#Initialization of variables\n",
      "import math\n",
      "r1=0 #multiply by a0\n",
      "r2=1 #multiply by a0\n",
      "#calculations\n",
      "ratio=math.pow(math.e,r1) /math.pow(math.e,(-2.*r2))\n",
      "#results\n",
      "print '%s %.2f %s' %(\"It is more propable that electron would be found\",ratio,\"times more at r1\")\n",
      "print '%s' %(\"The answer is a bit different due to rounding off error in textbook\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "It is more propable that electron would be found 7.39 times more at r1\n",
        "The answer is a bit different due to rounding off error in textbook\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E4 - Pg 284"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the uncertainity in position\n",
      "#Initialization of variables\n",
      "import math\n",
      "m=1 #g\n",
      "v=math.pow(10,-6) #m/s\n",
      "#calculations\n",
      "dx=1.054*math.pow(10,-34) /(2*m*math.pow(10,-3) *v)\n",
      "#results\n",
      "print '%s %.1e %s' %(\"Uncertainity in position =\",dx,\" m\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Uncertainity in position = 5.3e-26  m\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example I1 - Pg 271"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the surface temperature\n",
      "#Initialization of variables\n",
      "import math\n",
      "lmax=4.9*math.pow(10,-7) #m\n",
      "#calculations\n",
      "T=2.9*math.pow(10,-3) /lmax\n",
      "#results\n",
      "print '%s %d %s' %(\"Surface temperature must be close to\",T,\"K\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Surface temperature must be close to 5918 K\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example I2 - Pg 290"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the separation between adjacent levels frequency and energy\n",
      "#Initialization of variables\n",
      "import math\n",
      "k=516. #N/m\n",
      "m=1.67*math.pow(10,-27) #kg\n",
      "#calculations\n",
      "v=math.sqrt(k/m) /(2*math.pi)\n",
      "E=6.624*math.pow(10,-34) *v\n",
      "#results\n",
      "print '%s %.2e %s' %(\"Separation between adjacent levels frequency,\",v,\"Hz\")\n",
      "print '%s %.2e %s' %(\"\\n Energy =\",E,\"J\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Separation between adjacent levels frequency, 8.85e+13 Hz\n",
        "\n",
        " Energy = 5.86e-20 J\n"
       ]
      }
     ],
     "prompt_number": 3
    }
   ],
   "metadata": {}
  }
 ]
}