{
 "metadata": {
  "name": "",
  "signature": "sha256:d1e925900cff60559a1ba3f62c2c267140215c90675c4dba42b1a473becca175"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "9: Molecular spectra"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 9.1, Page number 172"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "twoB=3.8626;   #average spacing(per cm)\n",
      "h=6.626*10**-34;    #planck's constant(Js)\n",
      "c=3*10**8;    #speed of light(m/s)\n",
      "NA=6.022*10**23;   #avagadro number(atoms/mole)\n",
      "mC=0.012;   #isotopic mass of C(kg/mol)\n",
      "mO=0.016;   #isotopic mass of O(kg/mol)\n",
      "\n",
      "#Calculation\n",
      "B=(twoB/2)*100;   #average spacing(per m)\n",
      "I=h/(8*math.pi**2*B*c); \n",
      "mew=mC*mO/((mC+mO)*NA);   #reduced mass(kg)\n",
      "r=math.sqrt(I/mew);   #bond length(m)\n",
      "\n",
      "#Result\n",
      "print \"bond length is\",round(r*10**10,3),\"*10**-10 m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "bond length is 1.128 *10**-10 m\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 9.2, Page number 173"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "T=300;    #temperature(K)\n",
      "k=1.38*10**-23;   #boltzmann constant(J/K)\n",
      "h=6.626*10**-34;    #planck's constant(Js)\n",
      "c=3*10**8;    #speed of light(m/s)\n",
      "lamda=10**-2;    #wavelength(m)\n",
      "\n",
      "#Calculation\n",
      "E=3*k*T/2;    #kinetic energy(J)\n",
      "deltaE=h*c/lamda;   #energy seperation(J)\n",
      "\n",
      "#Result\n",
      "print \"kinetic energy is\",E,\"J\"\n",
      "print \"energy seperation is\",round(deltaE*10**23),\"*10**-23 J\"\n",
      "print \"deltaE is much smaller than E. hence substantial number of molecules will be there\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "kinetic energy is 6.21e-21 J\n",
        "energy seperation is 2.0 *10**-23 J\n",
        "deltaE is much smaller than E. hence substantial number of molecules will be there\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 9.3, Page number 175"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "ff=1876.06;    #frequency of fundamental(per cm)\n",
      "fo=3724.2;     #frequency of 1st overtone(per cm)\n",
      "\n",
      "#Calculation\n",
      "#ff=vebar*(1-(2*xe)) and fo=2*vebar*(1-(3*xe)). on solcing we get\n",
      "vebar=1903.98;   #equilibrium vibration frequency(per cm)\n",
      "xe=7.33*10**-3;   #anharmonicity constant\n",
      "E=vebar/2;   #zero point energy(per cm)\n",
      "\n",
      "#Result\n",
      "print \"equilibrium vibration frequency is\",vebar,\"per cm\"\n",
      "print \"anharmonicity constant is\",round(xe*10**3,2),\"*10**-3\"\n",
      "print \"zero point energy is\",round(E),\"per cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "equilibrium vibration frequency is 1903.98 per cm\n",
        "anharmonicity constant is 7.33 *10**-3\n",
        "zero point energy is 952.0 per cm\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 9.4, Page number 175"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "m=1.67*10**-27;    #mass of proton(kg)\n",
      "m1=1.0087;    #mass of 1H(u)\n",
      "m2=35.453;    #mass of Cl(u)\n",
      "c=3*10**8;    #velocity of light(m/sec)\n",
      "lamda0=3.465*10**-6;   #wavelength(m)\n",
      "\n",
      "#Calculation\n",
      "mew=m*m1*m2/(m1+m2);     #reduced mass(kg)\n",
      "k=4*math.pi**2*mew*(c/lamda0)**2;   #force constant(N/m)\n",
      "\n",
      "#Result\n",
      "print \"force constant is\",round(k,1),\"N/m\"\n",
      "print \"answer varies due to rounding off errors\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "force constant is 484.7 N/m\n",
        "answer varies due to rounding off errors\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 9.5, Page number 187"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "lamdae=4358.3*10**-8;      #excited wavelength(cm)\n",
      "lamda=4768.5*10**-8;    #wavelength(cm)\n",
      "\n",
      "#Calculation\n",
      "wne=1/lamdae;    #wave number of exciting radiation(per cm)\n",
      "wn=1/lamda;   #wave number of Raman line(per cm)\n",
      "new=wne-wn;   #vibrational frequency(per cm)\n",
      "\n",
      "#Result\n",
      "print \"vibrational frequency is\",round(new),\"per cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "vibrational frequency is 1974.0 per cm\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 9.6, Page number 188"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "h=6.626*10**-34;    #planck's constant(Js)\n",
      "c=3*10**8;    #speed of light(m/s)\n",
      "sixB=346;   #1st rotational Raman line(per cm)\n",
      "m1=1.673*10**-27;    #mass of proton(kg)\n",
      "\n",
      "#Calculation\n",
      "m2=m1;\n",
      "B=(sixB/6)*100;   #average spacing(per m)\n",
      "I=h/(8*math.pi**2*B*c); \n",
      "mew=m1*m2/(m1+m2);   #reduced mass(kg)\n",
      "r=math.sqrt(I/mew);   #bond length(m)\n",
      "\n",
      "#Result\n",
      "print \"bond length is\",round(r*10**10,3),\"*10**-10 m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "bond length is 0.762 *10**-10 m\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 9.7, Page number 193"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "gN=5.585;    #value of gN\n",
      "h=6.626*10**-34;    #planck's constant(Js)\n",
      "new=120*10**6;   #frequency(Hz)\n",
      "mewn=5.0508*10**-27;\n",
      "\n",
      "#Calculation\n",
      "B0=h*new/(gN*mewn);    #magnetic field strength(T)\n",
      "\n",
      "#Result\n",
      "print \"magnetic field strength is\",round(B0,3),\"T\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "magnetic field strength is 2.819 T\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 9.8, Page number 194"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "gN=5.585;    #value of gN\n",
      "h=6.626*10**-34;    #planck's constant(Js)\n",
      "mewn=5.0508*10**-27;\n",
      "B0=1.65;    #magnetic field(T)\n",
      "new=510*10**6;   #frequency separation(Hz)\n",
      "\n",
      "#Calculation\n",
      "new0=gN*mewn*B0/h;\n",
      "delta=new/new0;    #chemical shift(ppm)\n",
      "\n",
      "#Result\n",
      "print \"chemical shift is\",round(delta,2),\"ppm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "chemical shift is 7.26 ppm\n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 9.10, Page number 198"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "h=6.626*10**-34;    #planck's constant(Js)\n",
      "new=35*10**9;    #frequency(Hz)\n",
      "mewB=9.27*10**-24;\n",
      "B0=1.3;    #magnetic field(T)\n",
      "\n",
      "#Calculation\n",
      "g=h*new/(mewB*B0);   #electron g-factor\n",
      "\n",
      "#Result\n",
      "print \"electron g-factor is\",round(g,3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "electron g-factor is 1.924\n"
       ]
      }
     ],
     "prompt_number": 26
    }
   ],
   "metadata": {}
  }
 ]
}