{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 2 : Atomic structure and electronic configuration"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2.1 Page No : 32"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "distance of the closest approach alpha particles from the copper nucleus(in meter) = 1.668e-14\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "# Variables\n",
    "Eg_k = 5.;                             #kinetic energy of alpha particles(in MeV)\n",
    "Eg_K = 5.*(10**6)*1.6*(10**-19);       #kinetic energy of alpha particles(in J)\n",
    "mv2 = 2.*Eg_K;\n",
    "pi = 22./7;\n",
    "phi = 180.;                            #firing angle\n",
    "Z = 29.;                               #Atomic number\n",
    "\n",
    "# Calculation\n",
    "e = 1.6*(10**-19);\t\t\t#electron charge(in C)\n",
    "Eo = 8.85*10**-12;\t\t\t#permittivity of free space\n",
    "d = (Z*e**2/(2*pi*Eo*mv2))*(1+1)\t\t\t#;\n",
    "\n",
    "# Results\n",
    "print 'distance of the closest approach alpha particles from the copper nucleus(in meter) = %.3e'%d\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2.2 Page No : 33"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "first orbit radius of hydrogen atom(in m) = 5.3077e-11\n",
      "Orbital frequency of electron(in Hz) = 6.5407e+15\n"
     ]
    }
   ],
   "source": [
    "\n",
    "import math \n",
    "\n",
    "# Variables\n",
    "e = 1.6*10**(-19);\t\t\t#electron charge(in C)\n",
    "m = 9.1*10**(-31);\t\t\t#mass of electron(in Kg)\n",
    "E_o = 8.854*10**(-12);\t\t\t#permittivity of free space\n",
    "h = 6.625*10**(-34);\t\t\t#Planck constant\n",
    "n = 1;\t\t\t#Orbit number\n",
    "Z = 1;\t\t\t#atomic number\n",
    "pi = 22./7;\n",
    "\n",
    "# Calculation and Results\n",
    "r_1 = (E_o*n**2*h**2)/(pi*m*Z**2*e**2);\t\t\t#first orbit radius of hydrogen atom\n",
    "print 'first orbit radius of hydrogen atom(in m) = %.4e'%r_1\n",
    "Freq = m*(Z**2)*(e**4)/(4*(E_o**2)*(n**3)*h**3);\t\t\t#\n",
    "print 'Orbital frequency of electron(in Hz) = %.4e'%Freq\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2.3 Page No : 33"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "radius of the second bohr orbit in a math.singly ionized helium atom(in A) =  1.058\n"
     ]
    }
   ],
   "source": [
    "\t\t\t\n",
    "import math \n",
    "\n",
    "# Variables\n",
    "Z_1 = 1;\t\t\t#atomic number for hydrogen\n",
    "n_1 = 1;\t\t\t#first orbit\n",
    "r_1 = 0.529;\t\t\t#radius of first orbit of electron for hydrogen \n",
    "Z_2 = 2;\t\t\t#atomic number for helium\n",
    "n_2 = 2;\t\t\t#second orbit\n",
    "\n",
    "# Calculation\n",
    "k = r_1*Z_1/n_1;\n",
    "r_2 = k*((n_2)**2)/Z_2;\t\t\t#radius of first orbit of electron for helium\n",
    "\n",
    "# Results\n",
    "print 'radius of the second bohr orbit in a math.singly ionized helium atom(in A) = ',r_2\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2.4 Page No : 33"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ratio of energy released  = 1.1852\n"
     ]
    }
   ],
   "source": [
    "\n",
    "import math \n",
    "\n",
    "# Variables\n",
    "n_1 = 1;\t\t\t#first orbit\n",
    "n_2 = 2;\t\t\t#second orbit\n",
    "n_3 = 3;\t\t\t#third orbit\n",
    "\n",
    "# Calculation\n",
    "#E_1 = -13.6*(Z**2)/(1**2);\n",
    "#E_2 = -13.6*(Z**2)/(2**2);\n",
    "#E_3 = -13.6*(Z**2)/(3**2);\n",
    "#E_3-E_1 = -13.6*(Z**2)*(-8/9);\n",
    "#E_2-E_1 = -13.6*(Z**2)*(-3/4);\n",
    "E_1 = -13.6/(1**2);\t\t\t#energy of electron in the first bohr orbit of an atom\n",
    "E_2 = -13.6/(2**2);\t\t\t#energy of electron in the second bohr orbit of an atom\n",
    "E_3 = -13.6/(3**2);\t\t\t#energy of electron in the third bohr orbit of an atom\n",
    "\n",
    "# Results\n",
    "print 'ratio of energy released  = %.4f'%((E_3-E_1)/(E_2-E_1))\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2.5 Page No : 34"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "revolutions per second of an electron in the bohr orbit of hydrogen atom = 7.516e+15\n"
     ]
    }
   ],
   "source": [
    "\t\t\t\n",
    "import math \n",
    "\n",
    "# Variables\n",
    "m = 9.1*10**(-31);\t\t\t#electron mass (in Kg)\n",
    "Z = 1;\t\t\t#atomic number\n",
    "e = 1.6*10**(-19);\t\t\t#electron charge(in C)\n",
    "E_o = 8.25*10**(-12);\t\t\t#permittivity of free space\n",
    "n = 1;\t\t\t#first bohr orbit\n",
    "\n",
    "# Calculation\n",
    "h = 6.63*10**(-34);\t\t\t#planck consmath.tant\n",
    "R_ps = m*(e**4)/(4*(E_o**2)*(h**3));\t\t\t#number of revolutions per second\n",
    "\n",
    "# Results\n",
    "print 'revolutions per second of an electron in the bohr orbit of hydrogen atom = %.3e'%R_ps\n",
    "\n",
    "# rounding off error"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2.6 Page No : 35"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "orbital frequency of an electron in the first bohr orbit in a hydrogen atom(in Hz) = 6.532e+15\n"
     ]
    }
   ],
   "source": [
    "\t\t\t\n",
    "import math \n",
    "\n",
    "# Variables\n",
    "n = 1.;\t\t\t#first bohr orbit\n",
    "Z = 1.;\t\t\t#atomic number\n",
    "\n",
    "# Calculation\n",
    "m = 9.1*10**(-31);\t\t\t#electron mass in Kg.\n",
    "e = 1.6*10**(-19);\t\t\t#electron charge(in C)\n",
    "E_o = 8.85*10**(-12);\t\t\t#permittivity of free space\n",
    "h = 6.63*10**(-34);\t\t\t#planck constant\n",
    "v_n = m*(Z**2)*(e**4)/(4*(E_o**2)*(h**3)*(n**3));\t\t\t#orbital frequency of an electron in the first bohr orbit in a hydrogen atom\n",
    "\n",
    "# Results\n",
    "print 'orbital frequency of an electron in the first bohr orbit in a hydrogen atom(in Hz) = %.3e'%v_n\n",
    "\n",
    "# rounding off error"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2.7 Page No : 35"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total energy in = -13.6 eV\n",
      "kinetic energy in = 13.6 eV\n",
      "potential energy in = -27.2 eV\n"
     ]
    }
   ],
   "source": [
    "\t\t\t\n",
    "import math \n",
    "\n",
    "# Variables\n",
    "m = 9.11*10**-31;\t\t\t#mass of electron(in Kg)\n",
    "Z = 1;          \t\t\t#atomic number\n",
    "n = 1;\t\t\t            #first bohr orbit\n",
    "\n",
    "# Calculation\n",
    "E_o = 8.854*10**-12;\t\t\t#permittivity of free space\n",
    "h = 6.625*10**-34;\t\t\t#planck consmath.tant\n",
    "e = 1.6*10**-19;\t\t\t#electron charge(in C)\n",
    "E_k = (m*(Z**2)*(e**4))/(8*(E_o**2)*(n**2)*(h**2));\t\t\t#Kinetic energy(in joule)\n",
    "E = E_k/e;\t\t\t#Kinetic energy(in eV)\n",
    "E_t = -13.6*(Z**2/n**2);\t\t\t#Total Energy(in eV)\n",
    "E_p = E_t-E;\t\t\t#Potential energy(in eV)\n",
    "\n",
    "# Results\n",
    "print 'Total energy in = %.1f eV'%E_t\n",
    "print 'kinetic energy in = %.1f eV'%E\n",
    "print 'potential energy in = %.1f eV'%E_p\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2.8 Page No : 35"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "velocity of electron in hydrogen atom in bohr first orbit(in meter/sec) = 2.189e+06\n"
     ]
    }
   ],
   "source": [
    "\t\t\t\n",
    "import math \n",
    "\n",
    "# Variables\n",
    "h = 6.626*10**-34;\t\t\t#planck consmath.tant\n",
    "E_o = 8.825*10**-12;\t\t\t#permittivity of free space\n",
    "e = 1.6*10**-19;\t\t\t#electron charge(in C)\n",
    "n = 1;\t\t\t#first bohr orbit\n",
    "Z = 1;\t\t\t#atomic number\n",
    "\n",
    "# Calculation\n",
    "v = Z*(e**2)/(2*E_o*n*h);\t\t\t#velocity of electron in hydrogen atom in bohr first orbit\n",
    "\n",
    "# Results\n",
    "print 'velocity of electron in hydrogen atom in bohr first orbit(in meter/sec) = %.3e'%v\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2.9 Page No : 35"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "principal quntum number when 10.2 eV energy excites electron = 2\n",
      "wavelength of radiation when 10.2 eV energy excites electron(in A) = 1216\n",
      "principal quntum number when 12.09 eV energy excites electron = 3\n",
      "wavelength of radiation when 12.09 eV energy excites electron in = 1026 A\n"
     ]
    }
   ],
   "source": [
    "\n",
    "\n",
    "import math \n",
    "\n",
    "\n",
    "# Variables\n",
    "n_1 = 1.;\t\t\t#electron excited from ground state\n",
    "h = 6.62*10**-34;\t\t\t#Planck consmath.tant\n",
    "c = 3.*10**8;\t\t\t#speed of light\n",
    "E_o = 8.825*10**-12;\t\t\t#permittivity of free space\n",
    "e = 1.6*10**-19;\t\t\t#electron charge(in C)\n",
    "m = 9.11*10**-31;\t\t\t#mass of electron(in Kg)\n",
    "E_1 = 10.2;\t\t\t#energy excites the hydrogen from ground level(in eV)\n",
    "\n",
    "# Calculation and Results\n",
    "K = m*e**4/(8*(E_o**2)*(h**2))\t\t\t#in joule\n",
    "K_e = K/e;\t\t\t#in eV\n",
    "#E_1 = K_e*((1/n_1**2)-(1/n**2))\n",
    "#1/(n**2) = 1/(n_1**2)-E_1/K_e\n",
    "#n**2 = 1/(1/(n_1**2)-E_1/K_e)\n",
    "n = (1/(1/(n_1**2)-E_1/K_e))**(1./2);\t\t\t#principal quntum number when 10.2 eV energy excites electron\n",
    "print 'principal quntum number when 10.2 eV energy excites electron = %.f'%(n)\n",
    "\n",
    "W_1 = h*c/(E_1*e)*10**10;\t\t\t#wavelength of radiation when 10.2 eV energy excites electron\n",
    "print 'wavelength of radiation when 10.2 eV energy excites electron(in A) = %d'%W_1\n",
    "\n",
    "E_2 = 12.09;\t\t\t#energy excites the hydrogen from ground level(in eV)\n",
    "n_2 = (1./(1./(n_1**2)-E_2/K_e))**(1./2);\t\t\t#principal quntum number when 12.09 eV energy excites electron\n",
    "W_2 = h*c/(E_2*e)*10**10;\t\t\t#wavelength of radiation when 12.09 eV energy excites electron\n",
    "print 'principal quntum number when 12.09 eV energy excites electron = %.f'%(n_2)\n",
    "print 'wavelength of radiation when 12.09 eV energy excites electron in = %d A'%W_2\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2.13 Page No : 58"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "weight of one atom in 1.055e-22 gm\n",
      "weight of one proton in 1.675e-24 gm\n"
     ]
    }
   ],
   "source": [
    "\t\t\t\n",
    "import math \n",
    "\n",
    "# Variables\n",
    "At_w = 63.54;\t\t\t#atomic weight of copper\n",
    "N = 6.023*10**23;\t\t\t#avogadro's number\n",
    "\n",
    "# Calculation\n",
    "W_a = At_w/N;\t\t\t#weight of one atom(in gm)\n",
    "W_p = W_a/63;\t\t\t#weight of one proton(in gm)\n",
    "\n",
    "# Results\n",
    "print 'weight of one atom in %.3e gm'%W_a\n",
    "print 'weight of one proton in %.3e gm'%W_p\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2.15 Page No : 59"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "percentage of Si in Copper silicide Cu_5_Si is = 8.12 %\n"
     ]
    }
   ],
   "source": [
    "\n",
    "import math \n",
    "\n",
    "# Variables\n",
    "Atw_Cu = 63.54;\t\t\t#atomic weight of copper\n",
    "Atw_Si = 28.09;\t\t\t#atomic weight of silicon\n",
    "\n",
    "# Calculation\n",
    "# 5 atoms of copper working in Cu_5_Si\n",
    "Tw_Cu = 5*Atw_Cu;\t\t\t#total weight of copper used in copper silicide\n",
    "Tw_Si = Atw_Si;\t\t\t#total weight of silicon used in copper silicide\n",
    "Percentage = (Tw_Si/(Tw_Cu+Tw_Si))*100;\t\t\t#percentage of Si in Copper silicide\n",
    "\n",
    "# Results\n",
    "print 'percentage of Si in Copper silicide Cu_5_Si is = %.2f %%'%Percentage\n"
   ]
  }
 ],
 "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
