{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 27 : Quantum physics"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 1 Page No: 874"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Wavelength at which radiation emitted from the skin reaches its peak = 9.41e-06 meters\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "T=35 #Temperature of the skin in celsius\n",
    "T1=T+273 #Temperature in kelvin\n",
    "#From Wien's displacement law \n",
    "Lambda_max=(0.2898*10**-2)/T1\n",
    "print \"Wavelength at which radiation emitted from the skin reaches its peak = %0.2e meters\"%Lambda_max"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2 Page No: 878"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a) Total energy of Simple harmonic oscillator with given amplitude = 2.00 Joules\n",
      "   Frequency of oscillation = 0.56 Hertz\n",
      "b) Quantum number for the given macroscopic system : 5.36e+33\n",
      "c) Energy carried away by a one-quantum charge = 3.73e-34 joules\n"
     ]
    }
   ],
   "source": [
    "from math import sqrt, pi\n",
    "m=2 # mass of the object in Kg\n",
    "k=25 #force constant of spring in N/m\n",
    "A=0.4 #Amplitude of Simple harmonic oscillation by spring in meters\n",
    "h=6.63*10**-34#js\n",
    "#a) Total energy and frequency of SHO calculation\n",
    "E=(1/2)*k*A**2\n",
    "f=(1/(2*pi))*sqrt(k/m)\n",
    "print \"a) Total energy of Simple harmonic oscillator with given amplitude = %0.2f Joules\"%E\n",
    "print \"   Frequency of oscillation = %0.2f Hertz\"%f\n",
    "#b) Calculation of quantum number for the system\n",
    "n=E/(h*f)\n",
    "print \"b) Quantum number for the given macroscopic system : %0.2e\"%n\n",
    "#c) Calculation of energy carried away in a quantum charge\n",
    "delta_E=h*f\n",
    "print \"c) Energy carried away by a one-quantum charge = %0.2e joules\"%delta_E"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 3 Page No: 879"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Energy carried by a photon with the given frequency = 3.98e-19 Joules\n"
     ]
    }
   ],
   "source": [
    "f=6*10**14 #frequency of yellow light in hertz\n",
    "h=6.63*10**-34 #plancks constant J.s\n",
    "E=h*f\n",
    "print \"Energy carried by a photon with the given frequency = %0.2e Joules\"%E"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4 Page No: 882"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a) Maximum Kinetic energy of th eejected photoelectrons = 1.68 ev is\n",
      "b) Cut off wavelength for sodium = 5.05e-07 meters\n"
     ]
    }
   ],
   "source": [
    "l=0.3*10**-6 #wavelength of light  in meters\n",
    "W=2.46 #work function for sodium in ev\n",
    "c=3*10**8 #velocity of light in m/s\n",
    "h=6.63*10**-34#js\n",
    "#a) Maximum KE of the ejected photoelectrons\n",
    "E=(h*c/l)/(1.6*10**-19) #energy of each photon of th eilluminating light beam in ev\n",
    "KE_max=E-W\n",
    "print \"a) Maximum Kinetic energy of th eejected photoelectrons = %0.2f ev is\"%KE_max\n",
    "#b) Cut off wavelength for sodium \n",
    "W1=W*1.6*10**-19\n",
    "lc=h*c/W1\n",
    "print \"b) Cut off wavelength for sodium = %0.2e meters\"%lc"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5 Page No: 885"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Minimum wavelength produced = 1.24e-11 meters\n"
     ]
    }
   ],
   "source": [
    "V=10**5 #potential difference in Volts\n",
    "h=6.63*10**-34 # plancks constant in J.s\n",
    "c=3*10**8# velocity of light in m/s\n",
    "e=1.6*10**-19# elelctronic charge in coulombs\n",
    "L_min=(h*c)/(e*V)\n",
    "print \"Minimum wavelength produced = %0.2e meters\"%L_min"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6 Page No: 886"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Grazing angle at first order of interference = 6.40 degree\n",
      "Grazing angle at third order of interference = 19.54 degree\n"
     ]
    }
   ],
   "source": [
    "from math import asin, degrees\n",
    "d=0.314 #spacing between certain planes in a crystal of calcite in nm\n",
    "l=0.070 #wavelength of X-rays in nm\n",
    "m=1# first order of interference\n",
    "theta1=degrees(asin((m*l)/(2*d)))\n",
    "print \"Grazing angle at first order of interference = %0.2f degree\"%theta1\n",
    "m=3 #third order of interference\n",
    "theta2=degrees(asin((m*l)/(2*d)))\n",
    "print \"Grazing angle at third order of interference = %0.2f degree\"%theta2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 7 Page No: 887"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Wavelength of the scattered X-rays at the given angle in 0.20 nm\n"
     ]
    }
   ],
   "source": [
    "from math import pi, cos\n",
    "Lo=0.200000 #wavelength of X-rays in nm\n",
    "h=6.63*10**-34 #in J.s\n",
    "m_e=9.11*10**-31 # in Kg\n",
    "c=3*10**8 #in m/s\n",
    "theta=45 #in degrees\n",
    "#wavelength is represented by d\n",
    "delta_L=(h/(m_e*c))*(1-cos(pi/180*theta))\n",
    "L=delta_L+Lo\n",
    "print \"Wavelength of the scattered X-rays at the given angle in %.2f nm\"%L\n",
    "\n",
    "#Answer given in textbook is wrong"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8 Page No: 887"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "de Broglie wavelength for an electron = 7.28e-11 meters\n"
     ]
    }
   ],
   "source": [
    "h=6.63*10**-34 #in J.s\n",
    "m_e=9.11*10**-31 # in Kg\n",
    "v=1*10**7 #in m/s\n",
    "lamda=h/(m_e*v)\n",
    "print \"de Broglie wavelength for an electron = %0.2e meters\"%lamda"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 9 Page No: 888"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "de Broglie wavelength of the ball = 1.14e-34 meters\n"
     ]
    }
   ],
   "source": [
    "h=6.63*10**-34 #in J.s\n",
    "m=0.145 # in Kg\n",
    "v=40 #in m/s\n",
    "lamda=h/(m*v)\n",
    "print \"de Broglie wavelength of the ball = %0.2e meters\"%lamda"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 10 Page No: 889"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Uncertainity in position of electron = 3.86e-06 Meters\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "h=6.63*10**-34#js\n",
    "v=5*10**3 #speed of the electron in m/s\n",
    "m_e=9.11*10**-31 # mass of electron in Kg\n",
    "p=m_e*v\n",
    "delta_p=0.00300*p\n",
    "#Uncertainity principle states delta_x*delta_p >=h/(4*pi)\n",
    "delta_x=h/(4*pi*delta_p)\n",
    "print \"Uncertainity in position of electron = %0.2e Meters\"%delta_x"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 11 Page No: 889"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " Minimum uncertainity in energy of the  excited states = 5.28e-27 Joules\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "h=6.63*10**-34 # plancks constant in J.s\n",
    "delta_t=1.00*10**-8 # Average time that an ellectron exists in the excited states in sec\n",
    "delta_E=h/(4*pi*delta_t)\n",
    "print \" Minimum uncertainity in energy of the  excited states = %0.2e Joules\"%delta_E"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
