{
 "metadata": {
  "name": "",
  "signature": "sha256:972acff7d45b02187de1954b7975da8c6079f6322a8b7b9b83d194bbf84a5e53"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 7 : The second law of thermodynamics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.1 Page No : 137"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "T1 = 308 \t\t\t#K\n",
      "T2 = 373. \t\t\t#K\n",
      "T3 = 538. \t\t\t#K\n",
      "\n",
      "# Calculations\n",
      "e1 = (T2-T1)/T2\n",
      "e2 = (T3-T1)/T3\n",
      "\n",
      "# Results\n",
      "print  'Efficiency  = %.3f '%(e1)\n",
      "print  ' Efficiency  = %.3f '%(e2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Efficiency  = 0.174 \n",
        " Efficiency  = 0.428 \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.2 Page No : 139"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "T = 25  \t\t\t#C\n",
      "T1 = 0. \t\t\t#C\n",
      "h = 79.8 \t\t\t#cal g**-1\n",
      "j = 4.18*10**7 \t\t\t#ergs\n",
      "\n",
      "# Calculations\n",
      "Wc = (T-T1)*h/(273+T1)\n",
      "W = (T-T1)*h*j/(273+T1)\n",
      "\n",
      "# Results\n",
      "print  'Work required  = %.1f cal'%(Wc)\n",
      "print  ' Work required  = %.2e ergs'%(W)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Work required  = 7.3 cal\n",
        " Work required  = 3.05e+08 ergs\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.3 Page No : 151"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "import math \n",
      "R = 1.98 \t\t\t#cal\t\t\t#mol K\n",
      "x = 0.75\n",
      "n = 9\n",
      "\n",
      "# Calculations\n",
      "dS = -R*(n*(x/n)*math.log(x/n)+(1-x)*math.log(1-x))\n",
      "\n",
      "# Results\n",
      "print  'Entropy  = %.2f cal deg**-1 mole**-1'%(dS)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Entropy  = 4.38 cal deg**-1 mole**-1\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}