{
 "metadata": {
  "name": "",
  "signature": "sha256:b620865a516deeb75cd703005b53698c7a7013658cab02400acc0bf08c43a5d1"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 17 - Internal-combustion engines"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1 - Pg 358"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the indicated efficiency, brake thermal efficiency in both cases\n",
      "#Initalization of variables\n",
      "hp1=2000. #bhp\n",
      "m=792. #lb/hr\n",
      "ex=0.5\n",
      "hp2=210.\n",
      "hv=18900. #Btu/lb\n",
      "etth=51.3\n",
      "#calculations\n",
      "ihp=hp1+hp2\n",
      "ietat= ihp*2544/(m*hv) *100\n",
      "betat=ietat*hp1/ihp\n",
      "betat2=hp1*2544/(m*hv) *100\n",
      "ietae=ietat/etth *100\n",
      "betae=betat/etth *100\n",
      "brake= ietae*hp1/ihp\n",
      "#results\n",
      "print '%s %.1f %s' %(\"Indicated efficiency =\",ietat,\"percent\")\n",
      "print '%s %.1f %s' %(\"\\n Brake thermal efficiency =\",betat,\" percent\")\n",
      "print '%s %.1f %s' %(\"\\n In case 2, Brake thermal efficiency =\",betat2,\"percent\")\n",
      "print '%s %.1f %s' %(\"\\n Indicated thermal efficiency =\",ietae,\" percent\")\n",
      "print '%s %.1f %s' %(\"\\n Brake engine efficiency =\",betae,\" percent\")\n",
      "print '%s %.1f %s' %(\"\\n In case 2, Brake engine efficiency =\",brake,\"percent\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Indicated efficiency = 37.6 percent\n",
        "\n",
        " Brake thermal efficiency = 34.0  percent\n",
        "\n",
        " In case 2, Brake thermal efficiency = 34.0 percent\n",
        "\n",
        " Indicated thermal efficiency = 73.2  percent\n",
        "\n",
        " Brake engine efficiency = 66.3  percent\n",
        "\n",
        " In case 2, Brake engine efficiency = 66.3 percent\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2 - Pg 361"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the indicated mep\n",
      "#Initalization of variables\n",
      "J=778.\n",
      "o2=12.5\n",
      "theo=0.95\n",
      "N=56.5\n",
      "R0=1545.\n",
      "T=540. #R\n",
      "p=14. #psia\n",
      "LHV=2368089. #Btu/lb\n",
      "ther=39.4\n",
      "iep=0.78\n",
      "ve=0.8\n",
      "#calculations\n",
      "Ar=o2/0.21 *theo\n",
      "vol=N*R0*T/(144*p)\n",
      "hv=(LHV -17730)/LHV\n",
      "ithep=iep*ther\n",
      "pd=ithep/100 *ve *100.5\n",
      "mep=J*pd\n",
      "#results\n",
      "print '%s %d %s' %(\"Indicated mep =\",mep,\"lb/sq ft\")\n",
      "print '%s' %(\"The answer might differ from textbook due to rounding off error\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Indicated mep = 19223 lb/sq ft\n",
        "The answer might differ from textbook due to rounding off error\n"
       ]
      }
     ],
     "prompt_number": 1
    }
   ],
   "metadata": {}
  }
 ]
}