{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter No - 6 : Properties Of Steam And Steam Cycle\n",
      "    "
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.1 - Page No :  170"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "# Given data\n",
      "P = 10 # in bar\n",
      "P = P  *10**5 # in N/m**2\n",
      "V = 2 #volume of water in m**3\n",
      "W = P * V # in J\n",
      "W = W * 10**-6 # in MJ\n",
      "print \"Work done = %0.0f MJ \" %W"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Work done = 2 MJ \n"
       ]
      }
     ],
     "prompt_number": 34
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.2 - Page No :  170"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P = 1.013 # atm pressure in bar\n",
      "P = P * 10**5 # in N/m**2\n",
      "area= 1000*10**-4 # in m**2\n",
      "L_w = 1000 # in N\n",
      "P_L = L_w/area # Pressure due to load in N/m**2\n",
      "PressOnPiston = P_L+P # absolute pressure to piston in N/m**2\n",
      "a = 10**-3 # in m**2\n",
      "U = PressOnPiston*a # in Joules\n",
      "print \"Energy required to pump 1 kg of water at 0\u00b0C into the cylinder = %0.1f joules\" %U \n",
      "# Part (b)\n",
      "absPressure= 111.3*10**3 # in N/m**2\n",
      "increaseInVol= (1.02-1)*10**-3 # in m**3\n",
      "u_f= increaseInVol*absPressure # in joules\n",
      "print \"Energy required to effect the change in volume = %0.3f joules \" %u_f \n",
      "# Part (c)\n",
      "increaseInVol= (1.52-0.001) # in m**3\n",
      "ExternalWorkDone= absPressure*increaseInVol # in joules\n",
      "print \"External work done = %0.3f kJ\" %(ExternalWorkDone*10**-3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Energy required to pump 1 kg of water at 0\u00b0C into the cylinder = 111.3 joules\n",
        "Energy required to effect the change in volume = 2.226 joules \n",
        "External work done = 169.065 kJ\n"
       ]
      }
     ],
     "prompt_number": 35
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.3 - Page No :  175"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "m_s = 92.3 # mass of steam in kg\n",
      "m_w = 0.78 # mass of water in kg\n",
      "m = m_s + m_w # total mass in kg\n",
      "D_s = 92.3 # Dry steam in kg\n",
      "D_F = D_s/m # Dryness fraction\n",
      "print \"Dryness fraction = %0.2f \" %D_F"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Dryness fraction = 0.99 \n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.4 - Page No :  176"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "L = 693.3 # Liquid heat in kJ/kg\n",
      "L1 = 125.7 # Liquid heat of feed water in kJ/kg\n",
      "m = 2 # mass of water in kg\n",
      "Q = m * (L-L1) # in kJ\n",
      "print \"Heat required to raise temperature = %0.1f kJ \" %Q\n",
      "print \"The water is still liquid at the end of the heat supply\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Heat required to raise temperature = 1135.2 kJ \n",
        "The water is still liquid at the end of the heat supply\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.5 - Page No :  176"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "x = 0.9 \n",
      "h_f = 762.2 # in kJ/kg\n",
      "h_fg = 2013.8 # in kJ/kg\n",
      "H_wet = h_f + (x*h_fg) # in kJ/kg\n",
      "En = 125.7 # Enthapy of liquid in kJ/kg\n",
      "H_wet = H_wet - En # in kJ\n",
      "print \"When dry fraction is 0.9, Heat required, to convert = %0.1f kJ \" %H_wet\n",
      "# Part (b) when dry fraction is saturated\n",
      "H_sat = h_f + h_fg # in kJ/kg\n",
      "H_sat = H_sat-En # in kJ\n",
      "print \"Heat required when steam is dry and saturated = %0.1f kJ \" %H_sat\n",
      "C_P = 2.093 # in kJ/kg-K\n",
      "t_sup = 300 # in degree C\n",
      "t_sat = 179.9 # in degree C\n",
      "H_sup = h_f + h_fg + C_P*(t_sup-t_sat) # in kJ\n",
      "H_sup1 = H_sup - En # in kJ\n",
      "print \"Heat required when the steam is super heated = %0.1f kJ \" %H_sup1"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "When dry fraction is 0.9, Heat required, to convert = 2448.9 kJ \n",
        "Heat required when steam is dry and saturated = 2650.3 kJ \n",
        "Heat required when the steam is super heated = 2901.7 kJ \n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.6 - Page No :  177"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "x = 0.95 \n",
      "v_f = 0.001 \n",
      "v_g = 0.1238 # in m**3/kg\n",
      "V_wet = ((1-x)*v_f)+(x*v_g) # in m**3 correction little diff in ans \n",
      "print \"Specific volume of wet steam = %0.5f m**3 \" %V_wet\n",
      "print \"When the steam is dry saturated, the specific volume = %0.4f m**3/kg \" %v_g\n",
      "T_sat = 201.3 # in degree C\n",
      "T_sat = T_sat + 273 # in K\n",
      "T_sup = 300 # in degree C\n",
      "T_sup = T_sup + 273 # in K\n",
      "V_sup = v_g  * (T_sup/T_sat) # in m**3\n",
      "print \"When the steam is superheated, the specific volume = %0.2f m**3 \" %V_sup"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Specific volume of wet steam = 0.11766 m**3 \n",
        "When the steam is dry saturated, the specific volume = 0.1238 m**3/kg \n",
        "When the steam is superheated, the specific volume = 0.15 m**3 \n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.7 - Page No :  178"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "h_f = 720.7 # in kJ\n",
      "h_fg = 2046.6 # in kJ\n",
      "v_g = 0.2405 # in m**3\n",
      "x = 0.9 \n",
      "P = 8*10**2 # in kN/m**2\n",
      "U_sat = h_f+x*h_fg-x*v_g*P # in kJ\n",
      "print \"When the steam is wet, the internal energy = %0.2f kJ \" %U_sat\n",
      "En = 2767.3 # Enthalpy of dry saturated stream\n",
      "U_sat = En-(v_g*P) #in kJ/kg\n",
      "print \"When the steam is dry and saturated, the internal energy = %0.2f kJ/kg \" %U_sat\n",
      "C_P = 2.093 \n",
      "del_s = 100 # in degree C\n",
      "H_sup = h_f + h_fg + (C_P*del_s) # in kJ/kg\n",
      "t_sat = 170.4+273 # in K\n",
      "V_sup = (v_g*(t_sat+del_s))/t_sat # in m**3\n",
      "U_sup = H_sup - P*V_sup # in kJ/kg\n",
      "print \"When the steam is super heated, the internal energy = %0.1f kJ/kg \" %U_sup"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "When the steam is wet, the internal energy = 2389.48 kJ \n",
        "When the steam is dry and saturated, the internal energy = 2574.90 kJ/kg \n",
        "When the steam is super heated, the internal energy = 2740.8 kJ/kg \n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.8 - Page No :  179"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "x = 0.88 # dryness fraction\n",
      "h_fg = 2392.7 # in kJ/kg\n",
      "H_wet = x * h_fg # in kJ/kg\n",
      "Vs = 14.67 # Specific volume in m**3/kg\n",
      "V_wet = x * Vs # in m**3/kg\n",
      "Q = H_wet/V_wet # in kJ/m**3\n",
      "print \"Heat to be extracted = %0.1f kJ/m**3 \" %Q "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Heat to be extracted = 163.1 kJ/m**3 \n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.9 - Page No :  180"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P = 12*10**2 # in kN/m**2\n",
      "h_f = 798.1 # in kJ/kg\n",
      "h_fg = 1984.5 # in kJ/kg\n",
      "x = 0.8 \n",
      "H_wet = h_f + (x*h_fg) # in kJ/kg\n",
      "v_f = 0.001 # in m**3\n",
      "v_g = 0.1684 # in m**3\n",
      "V_wet = ((1-x)*v_f) + (x*v_g) # in m**3\n",
      "En = H_wet/V_wet # kJ/m**3\n",
      "print \"The enthalpy = %0.3f kJ/m**3 \" %En\n",
      "U_wet = H_wet - ( V_wet * P ) # in kJ\n",
      "U_wet1 = (U_wet/V_wet) # in kJ/m**3\n",
      "print \"Internal energy = %0.3f kJ/m**3 \" %U_wet1\n",
      "\n",
      "# Note: There is calculation error to find the value of V_wet.( the correct value of V_wet is 0.13492 not 0.1308), \n",
      "#       so there is some difference between the output of coding and the answer of the book"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The enthalpy = 17682.330 kJ/m**3 \n",
        "Internal energy = 16482.330 kJ/m**3 \n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.10 - Page No :  185"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import log\n",
      "# Given data\n",
      "T = 0 # in degree C\n",
      "T = T + 273 # in K\n",
      "T_sat = 179.9 # in degree C\n",
      "T_sat = T_sat + 273 # in K\n",
      "x = 0.8 \n",
      "h_fg = 2013.8 # in kJ/kg\n",
      "c_f = 4.188 \n",
      "Phi_wet = c_f*log(T_sat/T)+x*h_fg/T_sat # in kJ/kg-K\n",
      "print \"The entropy of wet steam = %0.2f kJ/kg-K \" %Phi_wet\n",
      "Phi_g = (c_f*(log(T_sat/T))) + (h_fg/T_sat) # in kJ/kg-K\n",
      "print \"The entropy of dry saturated steam = %0.2f kJ/kg-K \" %Phi_g\n",
      "C_P = 2.3 \n",
      "T_sup = 200+273 # in K\n",
      "Phi = c_f *log(T_sat/T) + h_fg/T_sat+  C_P*log(T_sup/T_sat) # in kJ/kg-K\n",
      "print \"The entropy of superheated steam = %0.2f kJ/kg-K \" %Phi"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The entropy of wet steam = 5.68 kJ/kg-K \n",
        "The entropy of dry saturated steam = 6.57 kJ/kg-K \n",
        "The entropy of superheated steam = 6.67 kJ/kg-K \n"
       ]
      }
     ],
     "prompt_number": 36
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.11 - Page No :  186"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import log\n",
      "# Given data\n",
      "T_sat = 198.3 # in degree C\n",
      "T_sat = T_sat + 273 # in K\n",
      "T_sup = 300 # in degree C\n",
      "T_sup = T_sup + 273 # in K\n",
      "c_f = 4.188 \n",
      "h_fg = 1945 # in kJ/kg-K\n",
      "T = 273 # in K\n",
      "C_P = 2.093 # in kJ/kg-K\n",
      "Phi_sup =c_f *log(T_sat/T)+h_fg/T_sat+C_P*log(T_sup/T_sat) # in kJ/kg-K\n",
      "print \"The value of specific entropy = %0.2f kJ/kg-K \" %Phi_sup"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The value of specific entropy = 6.82 kJ/kg-K \n"
       ]
      }
     ],
     "prompt_number": 37
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.12 - Page No : \t195"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "P = 16 # in bar\n",
      "m_w = 73 # in gm\n",
      "m_s = 980 # in gm\n",
      "x = m_s/(m_s+m_w) \n",
      "print \"Dryness fraction of steam = %0.2f \" %x"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Dryness fraction of steam = 0.93 \n"
       ]
      }
     ],
     "prompt_number": 38
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.13 - Page No :  196"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P1 = 7 # in bar\n",
      "P2 = 1.2 # in bar\n",
      "h_f1 = 696.9 # in kJ/kg\n",
      "h_fg1 = 2065 # in kJ/kg\n",
      "h_g2 = 2684.9 # in kJ/kg\n",
      "T_sup = 112 # in degree C\n",
      "T_sat = 104.77 # in degree C\n",
      "C_P = 2.1 # in kJ/kg\n",
      "x1 = (h_g2+(C_P*(T_sup-T_sat))-h_f1)/h_fg1 \n",
      "print \"Dryness fraction of steam = %0.3f\"%x1"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Dryness fraction of steam = 0.970\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.14 - Page No :  197"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P1 = 14 # in bar\n",
      "P2 = 1.2 # in bar\n",
      "h_f1 = 830 \n",
      "h_fg1 = 1958 \n",
      "h_g2 = 2684.9 \n",
      "x = (h_g2-h_f1)/h_fg1 \n",
      "print \"Dryness fraction of steam = %0.4f\" %x"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Dryness fraction of steam = 0.9473\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.15 - Page No :  199"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "m_s = 2.2 # in kg \n",
      "m_w = 0.18 # in kg\n",
      "x1 = m_s/(m_s+m_w) \n",
      "h_f1 = 743 \n",
      "h_fg1 = 2031 \n",
      "h_g2 = 2685 \n",
      "C_P = 2 \n",
      "T_sup = 115 # in degree C\n",
      "T_sat = 104.8 # in degree C\n",
      "x2 = (h_g2 + (C_P*(T_sup-T_sat)) - h_f1)/h_fg1 \n",
      "x = x1 *  x2 \n",
      "print \"The dryness fraction of steam = %0.4f\" %x"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The dryness fraction of steam = 0.8931\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.16 - Page No :  200"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "h_f1 = 232 # in kJ/kg\n",
      "h_fg = 2369 # in kJ/kg\n",
      "x = 0.8 \n",
      "h_f2 = 167.5 # in kJ/kg\n",
      "H_wet1 = h_f1 + (x*h_fg) # in kJ/kg\n",
      "H_wet = H_wet1 - h_f2 # in kJ/kg\n",
      "T1 = 38 # in degree C\n",
      "T2 = 25 # in degree C\n",
      "T = T1-T2 # in degree C\n",
      "SpeHeat = 4.188 # in kJ/kg-K\n",
      "m = H_wet/(T*SpeHeat) # in kJ/kg\n",
      "print \"The quantity of circulating water required of condensed steam = %0.0f kJ/kg \" %round(m)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The quantity of circulating water required of condensed steam = 36 kJ/kg \n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.17 - Page No :  200"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "V1 = 0.4 # volume of dry saturated steam\n",
      "P1 = 1.5 # in MN/m**2\n",
      "print \"Part (i) :  For Isothermal operation :\"\n",
      "Vs = 0.1318 # specific volume of dry steam\n",
      "m = V1/Vs # quantity of steam present in the vessel in kg\n",
      "h_f1= 844.6 # in kJ/kg\n",
      "x1= 0.5 # dryness fraction\n",
      "h_fg1= 1945.2 # in kJ/kg\n",
      "Specific_Enth= h_f1+x1*h_fg1 # in kJ/kg\n",
      "En= Specific_Enth*m # kJ\n",
      "print \"Enthalpy of the fluid = %0.2f kJ \" %En\n",
      "HeatLost= m*(1-x1)*h_fg1 # in kJ\n",
      "print \"The loss of heat during the constant temperature process = %0.1f kJ \" % HeatLost\n",
      "print \"Part (ii) : For Hyperbolic operation :\"\n",
      "h_f2= 1008.3 # in kJ/kg\n",
      "h_fg2= 1794 # in kJ/kg\n",
      "Vs= 0.0659 # Specific volume after compression in m**3/kg\n",
      "Vs1= 0.0666 # Specific volume of dry saturated steam in m**3/kg\n",
      "x2=Vs/Vs1 \n",
      "H_wet= h_f2+x2*h_fg2 # in kJ/kg\n",
      "H= m*H_wet # in kJ\n",
      "print \"Enthalpy of the fluid = %0.1f kJ\" %H\n",
      "# Note : The calculation in the book is not accurate"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Part (i) :  For Isothermal operation :\n",
        "Enthalpy of the fluid = 5515.02 kJ \n",
        "The loss of heat during the constant temperature process = 2951.7 kJ \n",
        "Part (ii) : For Hyperbolic operation :\n",
        "Enthalpy of the fluid = 8447.5 kJ\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.18 - Page No :  201"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from numpy import pi\n",
      "# Given data\n",
      "P = 13.5 # power developed by engine in kW\n",
      "P1 = 12 # Steam consumption of the engine in kg/kWh\n",
      "S_C = P*P1 #steam consumed per hour  in kg\n",
      "S_C = S_C/60 # in kg/min\n",
      "x = 0.85 \n",
      "V_g = 1.430 \n",
      "Volume = x * V_g # in m**3/kg\n",
      "Volume = S_C * Volume # in m**3\n",
      "d = 15*10**-2 #diameter of exhaust pipe in meter\n",
      "A = (pi/4) * (d)**2 # in m**2\n",
      "C = Volume/A # in meter/minute\n",
      "print \"The velocity of steam = %0.1f metre/minute\"  %C"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The velocity of steam = 185.7 metre/minute\n"
       ]
      }
     ],
     "prompt_number": 39
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.19 - Page No :  202"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P = 2 #pressure of steam in bar\n",
      "m = 0.1 #mass of steam in kg\n",
      "V = 0.080 #volume of steam in m**3\n",
      "V1 = 0.8872 #volume of 1kg dry saturated steam in m**3\n",
      "x = V/(m*V1) \n",
      "print \"Dryness fraction of steam = %0.3f\" %x"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Dryness fraction of steam = 0.902\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.20 - Page No :  202"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Given data\n",
      "P1 = 7+ 1 # in bar\n",
      "H = 2767 # Enthalpy in kJ/kg\n",
      "P2 = 1.5+1 # in bar\n",
      "H1 = 2717 # enthalpy of 1kg of dry steam in kJ/kg\n",
      "H_sup = H - H1 # Superheated of 1kg of steam in kJ\n",
      "S1 = 2.17 # super heated steam in kJ/kg-K\n",
      "theta = H_sup/S1 # in degree C\n",
      "T_sat = 127.4 # in degree C\n",
      "T_sup = T_sat + theta # in degree C\n",
      "print \"The super heated temperature = %0.0f degree C \" %(T_sup)\n",
      "# Note : The calculation in the book is not accurate"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The super heated temperature = 150 degree C \n"
       ]
      }
     ],
     "prompt_number": 67
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.21 - Page No :  203"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "T_sat = 99.6 # in degree C\n",
      "h_fg = 2258 # in kJ/kg\n",
      "m = 1 # steam output of the boiler in (assumed)\n",
      "m1 = 0.03 # exhaust steam\n",
      "x = 0.9 \n",
      "T1 = 21 # in degree C\n",
      "Cp = 4.187 # kJ/kg-K\n",
      "# Formula m1*(Cp*(T_sat-t)+x*h_fg)= m*Cp*(t-T1)\n",
      "t= (m1*(Cp*T_sat+x*h_fg)+m*Cp*T1)/(Cp*(m+m1))\n",
      "print \"Temperature of the feed water leaving the heater = %0.1f degree C \" %t"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Temperature of the feed water leaving the heater = 37.4 degree C \n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.22 - Page No :  203"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "T = 20 # in degree C\n",
      "H1 = 3039 # Enthalpy in kJ/kg\n",
      "H2 = 2725 # Enthalpy of 1kg dry saturated steam\n",
      "H_sup = H1-H2 # superheat of 1kg of steam in kJ/kg\n",
      "H= 2621.4 # heat required for 1kg or water in kJ\n",
      "m = H_sup/H # in kg\n",
      "print \"Quantity of water = %0.2f kg \" %m"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Quantity of water = 0.12 kg \n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.23 - Page No :  204"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "x = 0.9 \n",
      "h_f1 = 1087.4 # in kJ/kg\n",
      "h_fg1 = 1712.9 # in kJ/kg\n",
      "H_wet1 = h_f1 + (x*h_fg1) # in kJ/kg\n",
      "H_sup2 = 3095 # in kJ/kg\n",
      "H = H_sup2 - H_wet1 # in kJ/kg\n",
      "print \"Heat recieved = %0.0f kJ/kg \" %H"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Heat recieved = 466 kJ/kg \n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.24 - Page No :  204"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "V_fg =0.1632 # in m**3\n",
      "T_sup = 200 # in degree C\n",
      "T_sup = T_sup + 273 # in K\n",
      "T_sat = 188 # in degree C\n",
      "T_sat = T_sat + 273 # in K\n",
      "V_sup = (V_fg*T_sup)/T_sat # in m**3/kg\n",
      "V = 0.24 # Capacity of the vessel in m**3\n",
      "Q = V/V_sup # in kg\n",
      "V1 = 0.9774 #volume of 1kg dry saturated steam in m**3\n",
      "x = V_sup/V1 \n",
      "print \"Dryness fraction of steam = %0.4f\" %x"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Dryness fraction of steam = 0.1713\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.25 - Page No :  205"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "V = 0.6 # in m**3\n",
      "P2 = 2*10**2 # in kN/m**2\n",
      "P1 = 10*10**2 # in kN/m**2\n",
      "m = V/0.1946 # in kg\n",
      "V_s = 0.8872 # Specific volume of dry saturated steam in m**3\n",
      "x = 0.1946/V_s \n",
      "h_f1 = 505 # in kJ/kg\n",
      "h_fg1 = 2202 # in kJ/kg\n",
      "H2 = m*(h_f1 + (x*h_fg1)) # in kJ\n",
      "H1 = m*2776 # in kJ\n",
      "Q = (H2-H1) - (V*(P2-P1)) # in kJ\n",
      "print \"The mass of steam in the vessel = %0.2f kg \" %m\n",
      "print \"The dryness fraction of steam = %0.4f the vessel \" %x\n",
      "print \"The amount o heat transferred = %0.0f kJ \" %int(Q)\n",
      "print \"Thus during cooling process there is loss of heat\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The mass of steam in the vessel = 3.08 kg \n",
        "The dryness fraction of steam = 0.2193 the vessel \n",
        "The amount o heat transferred = -5032 kJ \n",
        "Thus during cooling process there is loss of heat\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.26 - Page No :  206"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "x1 = 0.95 \n",
      "P1 = 9 # in bar\n",
      "P1= P1*10**2 # in kN/m**2\n",
      "h_f1 = 743 # in kJ/kg\n",
      "h_fg1 = 2030 # in kJ/kg\n",
      "V = 0.204 # in m**3\n",
      "x2 = 0.544\n",
      "P2 = 5 # in bar\n",
      "P2= P2*10**2 # in kN/m**2\n",
      "h_f2 = 640 # in kJ/kg\n",
      "h_fg2 = 2108 # in kJ/kg\n",
      "H_wet1 = h_f1 + (x1*h_fg1) # in kJ/kg\n",
      "print \"Total energy = %0.1f kJ/kg \" %H_wet1\n",
      "U1 = H_wet1 - P1*V # in kJ/kg\n",
      "print \"The internal energy = %0.1f kJ/kg \" %U1\n",
      "V_g1 = 0.204 # in m**3\n",
      "V1 = 0.3753 #volume of 1kg of dry stream in m**3\n",
      "x2 = V_g1/V1 \n",
      "H_wet2 = h_f2 + (x2*h_fg2) # in kJ\n",
      "U2 = H_wet2 - P2*V # in kJ\n",
      "del_U = U1-U2 # in kJ\n",
      "H = del_U/V # in kJ\n",
      "print \"Heat removed from 1 m**3 of steam = %0.1f kJ \" %H"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Total energy = 2671.5 kJ/kg \n",
        "The internal energy = 2487.9 kJ/kg \n",
        "Heat removed from 1 m**3 of steam = 3941.5 kJ \n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.27 - Page No :  206"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P1 = 2.1 # in MN/m**2\n",
      "P1= P1*10**3 #in kN/m**2\n",
      "P2 = 0.7 # in MN/m**2\n",
      "P2= P2*10**3 #in kN/m**2\n",
      "V1 = 0.1281 # in m**3\n",
      "x = 0.9 \n",
      "n = 1.25 \n",
      "h_f1= 920 # in kJ/kg\n",
      "h_fg1= 1878.6 # in kJ/kg\n",
      "h_f2= 697.0 # in kJ/kg\n",
      "h_fg2= 2065.0 # in kJ/kg\n",
      "V_wet1 = x * 0.0949 # in m**3/kg\n",
      "m = V1/V_wet1 # in kg\n",
      "print \"Mass of steam = %0.1f kg \" %m\n",
      "V2 = V1*((P1/P2)**(1/n)) #in m**3\n",
      "del_W = (P1*V1-P2*V2)/(n-1) # in kJ\n",
      "print \"External work done = %0.1f kJ \" %del_W\n",
      "V_2 = V2/m # in m**3/kg\n",
      "x2 = V_2/0.273 \n",
      "H1= h_f1+x*h_fg1 # in kJ/kg\n",
      "U1= H1-P1*V_wet1 # in kJ/kg\n",
      "H2= h_f2+x2*h_fg2 # in kJ/kg\n",
      "U2= H2-P2*V_2 # in kJ/kg\n",
      "del_E = m*(U2-U1) #in kJ\n",
      "print \"Change in internal energy = %0.1f kJ \" %del_E\n",
      "Q = del_W +del_E # in kJ\n",
      "print \"Heat exchange = %0.1f kJ \" %Q\n",
      "print \"Heat is lost to the surroundings.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Mass of steam = 1.5 kg \n",
        "External work done = 212.3 kJ \n",
        "Change in internal energy = -483.7 kJ \n",
        "Heat exchange = -271.5 kJ \n",
        "Heat is lost to the surroundings.\n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.28 - Page No :  207"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "h_f1 = 670 # in kJ/kg\n",
      "h_fg1 = 2085 # in kJ/kg\n",
      "h_f2 = 475 # in kJ/kg\n",
      "h_fg2 = 2221 # in kJ/kg\n",
      "P2 = 6*10**2 # in kJ/kg \n",
      "P1 = 1.6*10**2 # in kJ/kg\n",
      "n = 1.1 \n",
      "x1 = 0.9 \n",
      "V1 = 0.3159 # in m**3\n",
      "V2 = 1.092 # in m**3\n",
      "H_wet = h_f1 + (x1*h_fg1) # in kJ/kg\n",
      "V_wet1 = x1*V1 # in m**3\n",
      "V_wet2 = V_wet1*(P2/P1)**(1/n) # in m**3\n",
      "x2 = V_wet2/V2 \n",
      "H_wet2 = h_f2 + (x2*h_fg2) # in kJ/kg\n",
      "U2= H_wet2-H_wet+P2*V_wet1-P1*V_wet2 # in kJ/kg\n",
      "W= (P2*V_wet1-P1*V_wet2)/(n-1) # in kJ/kg\n",
      "Q= U2+W # in kJ/kg\n",
      "print \"Heat recieved by steam = %0.1f kJ/kg \" %Q"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Heat recieved by steam = 63.9 kJ/kg \n"
       ]
      }
     ],
     "prompt_number": 25
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.29 - Page No :  208"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P1 = 0.85*10**3 # in kN/m**2\n",
      "P2 = 0.17*10**3 # in kN/m**2\n",
      "n = 1.13 \n",
      "x1 = 0.95 \n",
      "V1 = x1*0.227 # in m**3/kg\n",
      "V2 = V1 * ((P1/P2)**(1/n)) # in m**3/kg\n",
      "x2 = V2/1.032 \n",
      "print \"Final dryness fraction of steam = %0.3f\" %x2\n",
      "W = (P1*V1-P2*V2)/(n-1) # in kJ/kg\n",
      "print \"Change in internal energy = %0.1f kJ/kg \" %W"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Final dryness fraction of steam = 0.868\n",
        "Change in internal energy = 238.3 kJ/kg \n"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.30 - Page No :  209"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Given data\n",
      "Cp= 2.3 # in kJ/kg-K\n",
      "T_sat= 179.9 # in \u00b0C\n",
      "T_sat= T_sat+273 # in K\n",
      "H= 3052 # enthalpy in kJ/kg\n",
      "P= 10*10**2 # in kN/m**2\n",
      "h_f= 763 # in kJ/kg\n",
      "h_fg= 2015 # in kJ/kg\n",
      "V= 0.1944 # in m**3\n",
      "# Formula H= h_f+h_fg*Cp*(t_sup-T_sat)-P*V*(t_sup/T_sat)\n",
      "t_sup= (h_f+h_fg-Cp*T_sat-H)/(P*V/T_sat-Cp) # in K\n",
      "t_sup= t_sup-273 # in \u00b0C\n",
      "print \"The final temperature of the steam = %0.0f \u00b0C \" %math.ceil(t_sup)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The final temperature of the steam = 431 \u00b0C \n"
       ]
      }
     ],
     "prompt_number": 40
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.31 - Page No :  209"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import log\n",
      "# Given data\n",
      "m1 = 3 # in kg\n",
      "m2 = 2 # in kg\n",
      "T1 = 10 # in degree C\n",
      "T2 = 80 # In Degree C\n",
      "T = ((m1*T1)+(m2*T2))/(m1+m2) # in degree C\n",
      "T = T + 273 # in K\n",
      "T1 = T1 + 273 # in K\n",
      "T2 = T2 + 273 # in K\n",
      "c_f = 4.188 \n",
      "del_phi1 = m1 * c_f*log(T/T1) # in kJ/K\n",
      "del_phi2 = m2 * c_f*log(T/T2) # in kJ/K\n",
      "Phi = del_phi1 + del_phi2 # in kJ/K\n",
      "print \"Total change in entropy = %0.3f kJ/K \" %Phi"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Total change in entropy = 0.124 kJ/K \n"
       ]
      }
     ],
     "prompt_number": 32
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.32 - Page No :  216"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P1 = 15 # in bar\n",
      "P2 = 0.15 # in bar\n",
      "T_sat = 198.3 # in degree C\n",
      "T_sat = T_sat + 273 # in K\n",
      "h_fg1 = 1947 # in kJ/kg\n",
      "h_fg2= 2369 # in kJ/kg\n",
      "h_g1 = 845 # in kJ/kg\n",
      "h_f2 = 232 # in kJ/kg\n",
      "f_g2 = 7.985 # in kJ/kg-K\n",
      "x1 = 0.8 \n",
      "Phi_f1 = 2.315 # in kJ/kg-K\n",
      "Phi_f2 = 0.772 # in kJ/kg-K\n",
      "Phi1 = Phi_f1 + ((x1*h_fg1)/T_sat) # in kJ/kg-K\n",
      "H1 = h_g1 + (x1*h_fg1) # in kJ/kg-K\n",
      "Phi2 = Phi1 # in kJ/kg-K\n",
      "x2 = (Phi1 - Phi_f2)/(f_g2 - Phi_f2) \n",
      "H2 = h_f2 + (x2*h_fg2) # in kJ/kg\n",
      "Eta = ((H1-H2)/(H1-h_f2))*100 # in %\n",
      "print \"Part (i) When the steam supply is wet and dryness fraction is 0.8\"\n",
      "print \"Rankine efficiency = %0.1f %% \" %Eta\n",
      "delH = H1-H2 #theoretical work of steam in kJ/kg\n",
      "W = delH*60/100 # in kJ/kg\n",
      "Energy_Equivalent= 3600 # in kJ\n",
      "Steam_C = Energy_Equivalent/W # Steam consumption in kg\n",
      "print \"Steam consumption per kW-hr = %0.2f kg\" %Steam_C\n",
      "print \"Part (ii) When the steam supply is dry and saturated\"\n",
      "H_1 = 2792 # in kJ/kg\n",
      "Phi_g1 = 6.445 # in kJ/kg-K\n",
      "x_2 = (Phi_g1-Phi_f2)/(f_g2-Phi_f2) \n",
      "H_2 = h_f2 + (x_2*h_fg2) # in kJ/kg\n",
      "Eta1 = (H_1-H_2)/(H_1-h_f2) \n",
      "print \"Rankine efficiency =\",round(Eta1,3),\"=\",round(Eta1*100,1),\"%%\" \n",
      "W1 = (H_1-H_2)*60/100 # in kJ/kg\n",
      "Steam_C= Energy_Equivalent/W1 # in kg\n",
      "print \"Steam consumption per kW-hr = %0.2f kg is :\" %Steam_C\n",
      "print \"Part (iii) When steam is superheated and  temperature is 300\u00b0C\"\n",
      "H_1 = 3039 # in kJ/kg\n",
      "Phi_1 = 6.919 # in kJ/kg-K\n",
      "x_2 = (Phi_1 - Phi_f2)/(f_g2-Phi_f2) \n",
      "H_2 = h_f2 + (x_2 * h_fg2) # in kJ/kg\n",
      "Eta = (H_1 - H_2)/(H_1-h_f2) \n",
      "print \"Rankine efficiency =\",round(Eta,3),\"=\",round(Eta*100,1),\"%%\" \n",
      "W2 = (H_1-H_2)*60/100 # in kJ/kg\n",
      "Steam_C= Energy_Equivalent/W2 # in kg\n",
      "print \"Steam consumption per kW-hr = %0.2f kg \" % Steam_C"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Part (i) When the steam supply is wet and dryness fraction is 0.8\n",
        "Rankine efficiency = 26.6 % \n",
        "Steam consumption per kW-hr = 10.37 kg\n",
        "Part (ii) When the steam supply is dry and saturated\n",
        "Rankine efficiency = 0.272 = 27.2 %%\n",
        "Steam consumption per kW-hr = 8.61 kg is :\n",
        "Part (iii) When steam is superheated and  temperature is 300\u00b0C\n",
        "Rankine efficiency = 0.281 = 28.1 %%\n",
        "Steam consumption per kW-hr = 7.61 kg \n"
       ]
      }
     ],
     "prompt_number": 29
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.33 - Page No :  218"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "T1 = 400 # in degree C\n",
      "T1 = T1 + 273 # in K\n",
      "T2 = 72.7 # in degree C\n",
      "T2 = T2 + 273 # in K\n",
      "Eta = ((T1-T2)/T1)*100 # in %\n",
      "print \"For carnot cycle : \"\n",
      "print \"Rankine efficiency = %0.1f %% \" %Eta\n",
      "H1 = 3248 # in kJ/kg\n",
      "h_f2 = 304.5 # in kJ/kg\n",
      "del_H = 809.2 # in kJ/kg\n",
      "Eta = (del_H/(H1-h_f2))*100 # in %\n",
      "print \"For Rankine cycle : \"\n",
      "print \"Rankine efficiency = %0.2f %% \" %Eta"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "For carnot cycle : \n",
        "Rankine efficiency = 48.6 % \n",
        "For Rankine cycle : \n",
        "Rankine efficiency = 27.49 % \n"
       ]
      }
     ],
     "prompt_number": 30
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example No :  6.34 - Page No :  218"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P1 = 15 # in bar\n",
      "H1 = 3039 # in kJ/kg\n",
      "V_g1 = 0.1697 # in m**3/kg\n",
      "Phi1 = 6.919 # in kJ/kg-K\n",
      "P2_desh = 3.5*10**2 # in kN/m**2\n",
      "Phi_g2 = 6.941 # in kJ/kg-K\n",
      "Phi_f2 = 1.727 # in kJ/kg-K\n",
      "P2 = 0.15*10**2 # in kN/m**2\n",
      "h_f2 = 232 # in kJ/kg\n",
      "x = (Phi1-Phi_f2)/(Phi_g2 - Phi_f2) \n",
      "h_f = 584 # in kJ/kg\n",
      "h_fg = 2148 # in kJ/kg\n",
      "H2 = h_f + (x*h_fg) # in kJ/kg\n",
      "V = 0.5241 # in m**3\n",
      "V2=x*V # in m**3/kg\n",
      "W = (H1-H2) + (P2_desh-P2)*V2 #work output of the cycle in kJ/kg\n",
      "Eta = W/(H1-h_f2)*100 # in %\n",
      "print \"The efficiency of the cycle = %0.1f %% \" %Eta\n",
      "Energy_equivalent= 3600 # in kJ\n",
      "S_consumption = Energy_equivalent/W # in kg\n",
      "V = S_consumption* V_g1 # in m**3\n",
      "print \"Total volume of steam = %0.2f m**3 \" %V"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The efficiency of the cycle = 17.5 % \n",
        "Total volume of steam = 1.24 m**3 \n"
       ]
      }
     ],
     "prompt_number": 31
    }
   ],
   "metadata": {}
  }
 ]
}