{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 02 : Equilibrium and Kinetics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.1, Page No 13"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "del_h = 6.02     #Heat added in kJ/mol\n",
      "t_m = 273.15     #mean temperature in kelvin\n",
      "\n",
      "#Calculations\n",
      "del_s = del_h*1e3/t_m\n",
      "\n",
      "#Results\n",
      "print(\"Increase in entropy is %.2f J mol^-1 K^-1\" %del_s)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Increase in entropy is 22.04 J mol^-1 K^-1\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2, Page No 16"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "E = 1.0      # energy in electron volt\n",
      "e = 1.6e-19  # charge on electron\n",
      "k = 1.38e-23 # constant\n",
      "t1 = 300.0    # temperature in K\n",
      "t2 = 1500.0  # temperature in K\n",
      "\n",
      "#Calculations\n",
      "print(\"Part A:\")\n",
      "n_N = math.exp(-(e/(k*t1)))\n",
      "print(\"Fraction of atoms with energy equal to or greater than 1eV at temperature %.2f K \" %t1)    #numerical value of answer in book is 2e-17\n",
      "print(\" is %.2e \" %n_N)\n",
      "print(\"Part B:\")\n",
      "n_N = math.exp(-(e/(k*t2)))\n",
      "\n",
      "#Results\n",
      "print(\"Fraction of atoms with energy equal to or greater than 1eV at temperature %.2f K \" %t2)    #numerical value of answer in book is 4.3e4\n",
      "print(\" is %.2e \" %n_N)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Part A:\n",
        "Fraction of atoms with energy equal to or greater than 1eV at temperature 300.00 K \n",
        " is 1.64e-17 \n",
        "Part B:\n",
        "Fraction of atoms with energy equal to or greater than 1eV at temperature 1500.00 K \n",
        " is 4.40e-04 \n"
       ]
      }
     ],
     "prompt_number": 2
    }
   ],
   "metadata": {}
  }
 ]
}