{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter No - 1 : Introduction\n",
      "    "
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  1.1 - Page No : 6"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "# Given data\n",
      "P_m = 760 # pressure of mercury in mm\n",
      "P_m_bar = P_m/750 # in bar\n",
      "P_W = 0.006867 # pressure of water in bar\n",
      "P = P_m_bar+P_W # in bar\n",
      "print \"The absolute pressure of gas = %0.3f bar \" %P"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The absolute pressure of gas = 1.020 bar \n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  1.2 - Page No : 6"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Given data\n",
      "Rho = 13.6 \n",
      "g = 9.81 \n",
      "a = 760 # in mm\n",
      "b = 480 # in mm\n",
      "h = a-b # in mm\n",
      "P = (1000*Rho*g*h)/(1000) # in N/m**2\n",
      "print \"The absolute pressure = %0.f N/m**2 \" %P\n",
      "P = math.floor(P /100) # in mbar\n",
      "print \"The absolute pressure = %0.f mbar \" %P"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The absolute pressure = 37356 N/m**2 \n",
        "The absolute pressure = 373 mbar \n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  1.3 - Page No : 6"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "G_P = 30 # guage pressure of steam in bar\n",
      "P1 = 745 # in mm\n",
      "P1= P1/750 #  in bar\n",
      "PressureInBoiler = G_P+P1 # in bar\n",
      "print \"The absolute pressure in the bioler = %0.3f bar\" %PressureInBoiler"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The absolute pressure in the bioler = 30.993 bar\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  1.4 - Page No : 7"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "Rho = 0.78 # in kg/m**3\n",
      "g = 9.81 \n",
      "h = 3 # in m\n",
      "b = g*Rho*h*1000 # in N/m**2\n",
      "b = b * 10**-3 # in kN/m**2\n",
      "print \"The gauge pressure = %0.3f kN/m**2 \" %b"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The gauge pressure = 22.955 kN/m**2 \n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  1.5 - Page No : 7"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "B_h = 755 # Barometric height in mm\n",
      "M_h= 240 # Manometer height in mm\n",
      "P = B_h+M_h # in mm \n",
      "P = P/750 # absolute pressure in bar\n",
      "P= P*10**5 # in N/m**2\n",
      "print \"The absolute pressure in the vessel = %0.5f MN/m**2 \" %(P*10**-6)\n",
      "print \"The absolute pressure in the vessel = %0.4f bar \" %(P*10**-5)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The absolute pressure in the vessel = 0.13267 MN/m**2 \n",
        "The absolute pressure in the vessel = 1.3267 bar \n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  1.6 - Page No : 12"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "T = 287 # in degree C\n",
      "T = T + 273 # in K\n",
      "print \"The temperature on absolute scale = %0.f K \" %T"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The temperature on absolute scale = 560 K \n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  1.7 - Page No : 12"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt\n",
      "# Given data\n",
      "a = 0.26 \n",
      "b = 5*10**-4 \n",
      "E = 10 # in mV\n",
      "T = (a/(2*b))*( sqrt(1+(4*E*b/a**2)) - 1 ) # in degree C\n",
      "print \"The unit of a will be mV/\u00b0C and the unit of b will be mV/\u00b0C**2\"\n",
      "print \"The Temperature = %0.2f degree C \" %T"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The unit of a will be mV/\u00b0C and the unit of b will be mV/\u00b0C**2\n",
        "The Temperature = 35.97 degree C \n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  1.8 - Page No : 15"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "Q_w = 500 # quantity of water flowing in kg/minute\n",
      "T1 = 80 # in \u00b0 C\n",
      "T2 = 20 # in \u00b0C\n",
      "del_T = T1-T2 # in \u00b0C\n",
      "Spe_heat = 4.182 # in kJ/kg\n",
      "Q_h = Q_w*del_T*Spe_heat # in kJ/minute\n",
      "\n",
      "a= 15\n",
      "b= 16\n",
      "print \"Quantity of heat supplied to water in the economizer = %0.f kJ/minute\" %Q_h\n",
      "print \"                                                     = %0.2f MJ/minute\" %(Q_h*10**-3) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Quantity of heat supplied to water in the economizer = 125460 kJ/minute\n",
        "                                                     = 125.46 MJ/minute\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  1.9 - Page No : 15"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "CopperMass = 3 # in kg\n",
      "WaterMass= 6 # in kg\n",
      "Spe_heat_copper= 0.394 # in kJ/kg-K\n",
      "T1 = 90 # in degree C\n",
      "T2 = 20 # in degree C\n",
      "del_T = T1-T2 # in degree C\n",
      "H_C = CopperMass*Spe_heat_copper*del_T # heat required by copper in kJ\n",
      "Spe_heat_water= 4.193 # in kJ/kg-K\n",
      "H_W = WaterMass*Spe_heat_water*del_T # heat required by water in kJ\n",
      "H = H_C+H_W #heat required by vessel and water  in kJ\n",
      "H = H * 10**-3 # in MJ\n",
      "print \"Heat required by vessel and water = %0.3f MJ \" %H"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Heat required by vessel and water = 1.844 MJ \n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  1.10 - Page No : 15"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "m = 18.2 #quantity of air supplied of coal in kg\n",
      "T1 = 200 # in degree C\n",
      "T2 = 18 # in degree C\n",
      "del_T = T1-T2 # in degree C\n",
      "Spe_heat = 1 # in kJ/kg-K\n",
      "Q_C = m*Spe_heat*del_T # in kJ\n",
      "print \"The Quantity of heat supplied per kg of coal = %0.2f kJ \" %Q_C"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Quantity of heat supplied per kg of coal = 3312.40 kJ \n"
       ]
      }
     ],
     "prompt_number": 22
    }
   ],
   "metadata": {}
  }
 ]
}