{
 "metadata": {
  "name": "",
  "signature": "sha256:567a331a7783164e40dcbd30f4cdd5679a7a2dc34fb757d2d02e98a98daba061"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 4 - Molecular energy levels"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1 - pg 104"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the Moment of inertia\n",
      "#initialization of variables\n",
      "import math\n",
      "B=10.34 #cm**-1\n",
      "c=2.998*10**10 #cm/s\n",
      "h=6.625*10**-27 #erg sec\n",
      "#calculations\n",
      "I=h/(8*math.pi**2 *B*c)\n",
      "#results\n",
      "print '%s %.2e %s' %(\"Moment of inertia =\",I,\" g cm^2\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Moment of inertia = 2.71e-40  g cm^2\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2 - pg 105"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the Bond length\n",
      "#Initialization of variables\n",
      "import math\n",
      "ma=1.0080\n",
      "mb=35.457\n",
      "Na=6.0232*10**23\n",
      "I=2.707*10**-40 #g cm**2\n",
      "#calculations\n",
      "mu1=ma*mb/(ma+mb)\n",
      "mu2=mu1/Na\n",
      "r=math.sqrt(I/mu2)\n",
      "#results\n",
      "print '%s %.2e %s' %(\"Bond length =\",r,\"cm\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Bond length = 1.29e-08 cm\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Example 3 - pg 110"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the Force constant\n",
      "#Initialization of variables\n",
      "import math\n",
      "c=2.998*10**10 #cm/s\n",
      "wave=2990 #cm**-1\n",
      "mu=1.627*10**-24 #g\n",
      "#calculations\n",
      "k=mu*(2*math.pi*c*wave)**2\n",
      "#results\n",
      "print '%s %.2e %s' %(\"Force constant =\",k,\"dynes/cm\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Force constant = 5.16e+05 dynes/cm\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4 - pg 111"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the anharmonicity constant\n",
      "#initialization of variables\n",
      "l1=2886. #cm^-1\n",
      "l2=5668. #cm^-1\n",
      "#calculations\n",
      "wave=2*l1-l2 \n",
      "wave2= wave+l1\n",
      "x=wave/(2*wave2)\n",
      "#results\n",
      "print '%s %.4f' %(\"anharmonicity constant = \",x)\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "anharmonicity constant =  0.0174\n"
       ]
      }
     ],
     "prompt_number": 4
    }
   ],
   "metadata": {}
  }
 ]
}