{

 "metadata": {

  "name": "",

  "signature": "sha256:2235c937260175b0ab97c5358d9d0f83ecc788771c1f725849b19d038912d334"

 },

 "nbformat": 3,

 "nbformat_minor": 0,

 "worksheets": [

  {

   "cells": [

    {

     "cell_type": "heading",

     "level": 1,

     "metadata": {},

     "source": [

      "Chapter01:Fundamental of Energy - Science and Technology"

     ]

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.1:pg-36"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# Given data:\n",

      "T1=500+273.0 #source temp in kelvin \n",

      "T2=100+273.0 #sink temperature in kelvin\n",

      "W=1 # output power in kW\n",

      "\n",

      "nth=1-(T2/T1) # thermal efficiency\n",

      "\n",

      "Q1=1/nth # heat supplied in kW\n",

      "\n",

      "Q2=Q1-W # heat rejected in kW\n",

      "\n",

      "print \" The heat rejected is \",Q2,\"kW\"\n",

      "\n",

      "# the answer in book is wrong due to incorrect  value of T1 "

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        " The heat rejected is  0.9325 kW\n"

       ]

      }

     ],

     "prompt_number": 7

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.2:pg-37"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# Given data:\n",

      "T1=40+273.0 # ambient temp in kelvin\n",

      "T2=-10+273.0 # freezer temp in kelvin\n",

      "Q2=2 # heat loss rate for freezer in kJ/s\n",

      "\n",

      "Q1=T1*(Q2/T2) # heat transfer rate in kJ/s\n",

      "\n",

      "W=Q1-Q2 # work in kW\n",

      "\n",

      "print \"The least power required is \",round(W,2),\"kW\""

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The least power required is  0.38 kW\n"

       ]

      }

     ],

     "prompt_number": 14

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.3:pg-37"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# Given data:\n",

      "Q1=3e4 # heat required in kJ/h\n",

      "W=2e3 # work required in kJ/h\n",

      "\n",

      "Q2=Q1-W # heat abstracted from outside in kJ/h\n",

      "\n",

      "COP=Q1/(Q1-Q2) # COP of heat pump\n",

      "\n",

      "print \"Heat abstracted from outside air is \",Q2,\"kJ/h\"\n",

      "print \"COP heat pump is \",COP\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "Heat abstracted from outside air is  28000.0 kJ/h\n",

        "COP het pump is  15.0\n"

       ]

      }

     ],

     "prompt_number": 16

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex1.4:pg-38"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "# Given data:\n",

      "T11=320+273.0 # temp at source 1 in kelvin\n",

      "Q1=10000.0 # heat transfer rate at source 1 in kJ/min\n",

      "T12=65+273.0 # temp at source 2 in kelvin\n",

      "Q2=120000.0 #  heat transfer rate at source 2 in kJ/min\n",

      "T2=35+273.0 # temp of surrounding in kelvin\n",

      "\n",

      "n1=1-(T2/T11) # efficiency by source 1\n",

      "n2=1-(T2/T12) # efficiency by source 2\n",

      "\n",

      "W1=Q1*n1 # work at source 1 in kJ/min\n",

      "W2=Q2*n2 # work at source 2 in kJ/min\n",

      "\n",

      "print \"The work done at two sources is W1=\",W1,\" kJ/min W2=\",W2,\"kJ/min\"\n",

      "print \"The larger power is provided by source 2\""

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The work done at two sources is W1= 4806.07082631  kJ/min W2= 10650.887574 kJ/min\n",

        "The larger power is provided by source 2\n"

       ]

      }

     ],

     "prompt_number": 17

    }

   ],

   "metadata": {}

  }

 ]

}