{
 "metadata": {
  "name": "",
  "signature": "sha256:c994036a387ecf3d6e1af15e46c49ba61b58c1363388a5e580f169263936cabd"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 7 : Reversibility and The Thermodynamic Temperature Scale"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.1 Page No : 174"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "print \"Part a\";\n",
      "\t\t\t\n",
      "# Variables\n",
      "Q1 = 500. \t\t\t#kJ \t\t\t#Heat transfer from reservoir at t1\n",
      "Q2 = 187.5 \t\t\t#kJ \t\t\t#Heat transfer from reservoir at t2\n",
      "\n",
      "\t\t\t\n",
      "# Calculations and Results\n",
      "nr = 1-(Q2/Q1) \t\t\t#Efficiency\n",
      "W = nr*Q1 \t\t\t#kJ \t\t\t#Work output of the engine\n",
      "print \"Work output of the engine = %.1f kJ\"%(W);\n",
      "\n",
      "\t\t\t#Part(b)\n",
      "print \"Part b\";\n",
      "\t\t\t\n",
      "# Variables\n",
      "Q1 = 500. \t\t\t#kJ \t\t\t#Heat transfer from reservoir at t1\n",
      "\t\t\t\n",
      "# Calculations and Results\n",
      "COP_hp = 1/nr\n",
      "W = Q1/COP_hp \t\t\t#kJ \t\t\t#Work input to heat pump\n",
      "Q2 = Q1-W \t\t\t#kJ \t\t\t#heat ineraction with reservoir at t2\n",
      "print \"Heat ineraction with reservoir at t2 = %.1f kJ\"%(Q2);\n",
      "print \"Work input to the heat pump = %.1f kJ\"%(W);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Part a\n",
        "Work output of the engine = 312.5 kJ\n",
        "Part b\n",
        "Heat ineraction with reservoir at t2 = 187.5 kJ\n",
        "Work input to the heat pump = 312.5 kJ\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.2 Page No : 178"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\t\n",
      "# Variables\n",
      "nr = 0.7 \t\t\t#maximum efficiency\n",
      "W = 80. \t\t\t#kJ \t\t\t#Work\n",
      "Q1 = 100. \t\t\t#kJ \t\t\t#heat transfered\n",
      "\t\t\t\n",
      "# Calculations and Results\n",
      "nx = W/Q1 \t\t\t#claimed efficiency\n",
      "if nx>nr :\n",
      "    print \"Engine X is not a viable proposition because the claimed efficiency %.2f is greater than maximum efficiency %.2f\"%(nx,nr)\n",
      "else:\n",
      "    print \"Engine X is a viable proposition because the claimed efficiency %.2f is less than maximum efficiency %.2f\"%(nx,nr)   \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Engine X is not a viable proposition because the claimed efficiency 0.80 is greater than maximum efficiency 0.70\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.4 Page No : 191"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\t\n",
      "# Variables\n",
      "T1 = (527.+273) \t\t\t#K\n",
      "T2 = (27.+273) \t\t\t#K\n",
      "\n",
      "# calculations and results\n",
      "#Part (a)\n",
      "print \"Part a\";\n",
      "nr = 1 - (T2/T1) \t\t\t#reversible efficiency\n",
      "print \"Reversible efficiency = %.3f \"%(nr);\n",
      "\n",
      "#Part(b)\n",
      "print \"Part b\";\n",
      "print \"As the values of at least any two from among Q1,Q2 and W \\\n",
      "are not given the efficiency of the engine cannot be evaluated.However\\\n",
      "according to Carnots statement, the efficiency will be less than %.3f\"%(nr)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Part a\n",
        "Reversible efficiency = 0.625 \n",
        "Part b\n",
        "As the values of at least any two from among Q1,Q2 and W are not given the efficiency of the engine cannot be evaluated.Howeveraccording to Carnots statement, the efficiency will be less than 0.625\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.5 Page No : 192"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\t\t\t\n",
      "# Variables\n",
      "T1 = 273. + 37 \t\t\t#K \n",
      "T2 = 273. - 13 \t\t\t#K\n",
      "\n",
      "\t\t\t#Part(a)\n",
      "print \"Part a\";\n",
      "COP_ref = T2/(T1-T2) \t\t\t#COP of reversible heat engine as refrigerator.\n",
      "print \"COP of reversible heat engine as refrigerator = %.1f\"%(COP_ref)\n",
      "\t\t\t#Part(b)\n",
      "print \"Part b\";\n",
      "COP_hp = T1/(T1-T2) \t\t\t#COP of reversible heat engine as heat pump.\n",
      "print \"COP of reversible heat engine as heat pump = %.1f\"%(COP_hp)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Part a\n",
        "COP of reversible heat engine as refrigerator = 5.2\n",
        "Part b\n",
        "COP of reversible heat engine as heat pump = 6.2\n"
       ]
      }
     ],
     "prompt_number": 5
    }
   ],
   "metadata": {}
  }
 ]
}