{
 "metadata": {
  "name": "",
  "signature": "sha256:b5b8074cf42c7ca646f91bd1caedd392aed8b3ed9b13fedd0aed1677334f5b33"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 7 : IC Engines"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.1 Page No : 23"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\t\n",
      "# Variables :\n",
      "T = 10.;\t\t\t#N-m\n",
      "N = 1500.;\t\t\t#rpm\n",
      "IP = 1.85;\t\t\t#KW\n",
      "\n",
      "#Calculation\n",
      "BP = T*2*math.pi*N/60/1000;\t\t\t#KW\n",
      "FP = IP-BP;\t\t\t#KW\n",
      "\n",
      "# Results\n",
      "print \"Friction power(KW) : %.2f\"%FP\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Friction power(KW) : 0.28\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.2 Page No : 23"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\t\t\t\n",
      "# Variables :\n",
      "d = 18./100;\t\t\t#m\n",
      "L = 26./100;\t\t\t#m\n",
      "N = 400.;\t\t\t#rpm\n",
      "positive_mep = 6;\t\t\t#bar\n",
      "negative_mep = -0.3;\t\t\t#bar\n",
      "n = 180.;\t\t\t#strokes/min\n",
      "Etta_m = 0.75;\n",
      "\n",
      "#Calculation\n",
      "Pm = positive_mep+negative_mep;\t\t\t#bar\n",
      "A = math.pi/4*d**2;\t\t\t#m**2\n",
      "IP = Pm*10**5*A*L*n/60/1000;\t\t\t#KW\n",
      "BP = IP*Etta_m;\t\t\t#KW\n",
      "\n",
      "# Results\n",
      "print \"B.P. of engine in KW : %.3f\"%BP\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "B.P. of engine in KW : 8.485\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.3 Page No : 24"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\t\n",
      "# Variables :\n",
      "r = 6.;\t\t\t        #cm\n",
      "d = 10./100;\t\t\t#m\n",
      "L = 12.5/100;\t\t\t#m\n",
      "Pmi = 2.6;\t\t    \t#bar\n",
      "W = 60.;\t\t    \t#N\n",
      "S = 19.;\t\t\t    #N\n",
      "R = 40./100;\t\t\t#m\n",
      "mf = 1.;\t    \t\t#Kg/hr\n",
      "mf = mf/60/60;\t\t\t#Kg/sec\n",
      "CV = 42000.;\t\t\t#KJ/Kg\n",
      "N = 2000.;  \t\t\t#rpm\n",
      "\n",
      "#Calculation and Results\n",
      "A = math.pi/4*d**2;\t\t\t#m**2\n",
      "n = N/2;\t\t\t#no. of strokes/min\n",
      "IP = Pmi*10**5*A*L*n/60/1000;\t\t\t#KW\n",
      "print \"Indicated Power in KW : %.3f\"%IP\n",
      "\n",
      "BP = (W-S)*R*2*math.pi*N/60/1000;\t\t\t#KW\n",
      "print \"Brake Power in KW : %.3f\"%BP\n",
      "Etta_m = BP/IP*100;\t\t\t#%\n",
      "print \"Mechanical efficiency in %% : %.2f\"%Etta_m\n",
      "Etta_o = BP/mf/CV*100;\t\t\t#%\n",
      "print \"Overall efficiency in %% : %.2f\"%Etta_o\n",
      "Gamma = 1.4;\t\t\t#consmath.tant\n",
      "Etta_a = (1-1/(r**(Gamma-1)))*100 ;\t\t\t#%\n",
      "print \"Air standard efficiency in %% : %.2f\"%Etta_a\n",
      "Etta_r = Etta_o/Etta_a*100;\t\t\t#%\n",
      "print \"Relative efficiency in %% : %.2f\"%Etta_r\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Indicated Power in KW : 4.254\n",
        "Brake Power in KW : 3.435\n",
        "Mechanical efficiency in % : 80.74\n",
        "Overall efficiency in % : 29.44\n",
        "Air standard efficiency in % : 51.16\n",
        "Relative efficiency in % : 57.54\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.4 Page No : 24"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\t\n",
      "# Variables :\n",
      "IP = 50.;\t\t\t    #KW\n",
      "Vf = 16.;\t\t\t    #litre/hr\n",
      "Sp_gravity_fuel = 0.755;\n",
      "CV = 44500.;\t\t\t#KJ/Kg\n",
      "N = 3000.;\t    \t\t#rpm\n",
      "Pmi = 5.2;\t\t    \t#bar\n",
      "\n",
      "#Calculation and Results\n",
      "mf = Vf*10**-3*Sp_gravity_fuel*1000;\t\t\t#Kg/hr\n",
      "mf = mf/3600;\t\t\t#Kg/s\n",
      "Etta_i = IP/mf/CV*100;\t\t\t#%\n",
      "print \"Indicated thermal efficiency in %% : %.2f\"%Etta_i\n",
      "\n",
      "#IP = Pmi*10**5*math.pi/4*d**2*L*N/2/60/1000;\t\t\t#KW\n",
      "d = (IP*60*1000/Pmi/10**5/(math.pi/4)/1.1/(N/2))**(1./3);\t\t\t#meter(L = 1.1*d)\n",
      "print \"Bore in cm : %.2f\"%(d*100)\n",
      "L = 1.1*d;\t\t\t#meter\n",
      "print \"Length of stroke in cm : %.3f\"%(L*100)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Indicated thermal efficiency in % : 33.48\n",
        "Bore in cm : 16.45\n",
        "Length of stroke in cm : 18.096\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.5 Page No : 25"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\t\n",
      "# Variables :\n",
      "Vs = 5.7;\t\t\t#litre\n",
      "Vs = Vs/1000;\t\t\t#m**3\n",
      "Pm = 600.;\t\t\t#KN/m**2\n",
      "N = 800.;\t\t\t#rpm\n",
      "\n",
      "#Calculation\n",
      "n = N/2;\t\t\t#No. of strokes/min\n",
      "IP = Pm*Vs*n/60;\t\t\t#KW\n",
      "\n",
      "# Results\n",
      "print \"Indicated power of Engine in KW :  \",IP\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Indicated power of Engine in KW :   22.8\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.6 Page No : 25"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\t\n",
      "# Variables :\n",
      "n1 = 6.;\t\t\t#cylinders\n",
      "IP = 100.;\t\t\t#KW\n",
      "N = 800.;\t\t\t#rpm\n",
      "Lbyd = 1.25;\t\t\t#stroke to bore ratio\n",
      "Etta_m = 80./100;\n",
      "bmep = 5.;\t\t\t#bar\n",
      "\n",
      "#Calculation\n",
      "n = N/2;\t\t\t#No. of strokes/min\n",
      "#IP = Pm*math.pi/4*d**2*d*Lbyd*n/60000\n",
      "d = (IP/(bmep*math.pi/4*Lbyd*n/60000))**(1/3);\t\t\t#m\n",
      "L = Lbyd*d;\t\t\t#m\n",
      "\n",
      "# Results\n",
      "print \"Diameter in meter : \",d\n",
      "print \"Length ofstroke in meter :  \",L\n",
      "\n",
      "\t\t\t#Solution is not complete in the book.\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Diameter in meter :  1.0\n",
        "Length ofstroke in meter :   1.25\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.7 Page No : 26"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\t\n",
      "# Variables :\n",
      "d = 110./1000;\t\t\t#m\n",
      "L = 140./1000;\t\t\t#m\n",
      "Pmi = 600.;\t\t\t#KN/m**2\n",
      "N = 1000.;\t\t\t#rpm\n",
      "n = N;\t\t\t#strokes/min(for 2 stroke)\n",
      "\n",
      "# Calculations\n",
      "A = math.pi/4*d**2;\t\t\t#m**2\n",
      "IP = Pmi*A*L*n/60;\t\t\t#KW\n",
      "\n",
      "# Results\n",
      "print \"Indicated power of the engine in KW : %.3f\"%IP\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Indicated power of the engine in KW : 13.305\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.8 Page No : 26"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\t\t\t\n",
      "# Variables :\n",
      "n1 = 6.;\t\t\t#cylinders\n",
      "IP = 150.;\t\t\t#KW\n",
      "N = 800.;\t\t\t#rpm\n",
      "TwoLN = 320.;\t\t\t#m/s\n",
      "Lbyd = 1.2;\t\t\t#stroke to bore ratio\n",
      "Pmi = 650.;\t\t\t#Kn/m**2\n",
      "\n",
      "#Calculation\n",
      "#IP = n1*Pmi*(math.pi/4*d**2)*L*n/60;\t\t\t#KW\n",
      "d = math.sqrt(IP/n1/Pmi/(math.pi/4)*2/TwoLN*2*60);\t\t\t#meter(L*N replaced by TwoLN/2)\n",
      "L = Lbyd*d;\t\t\t#in meter\n",
      "N = TwoLN/2/L;\t\t\t#rpm\n",
      "\n",
      "# Results\n",
      "print \"Engine crank shaft speed in rpm : %.2f\"%N\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Engine crank shaft speed in rpm : 695.73\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.9 Page No : 26"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\t\n",
      "# Variables :\n",
      "d = 250./1000;\t\t\t#meter\n",
      "L = 400./1000;\t\t\t#meter\n",
      "Pmi = 6.50;\t\t\t    #bar\n",
      "N = 250.;\t\t\t    #rpm\n",
      "NetBrakeLoad = 1080.;\t\t#N\n",
      "Db = 1.5;\t    \t\t#meter\n",
      "mf = 10.;\t\t    \t#Kg/hr\n",
      "mf = mf/60./60;\t\t\t#Kg/sec\n",
      "CV = 44300.;\t\t\t#KJ/Kg\n",
      "\n",
      "#Calculation and Results\n",
      "n = N/2;\t\t\t#stroke/min\n",
      "IP = Pmi*10**5*(math.pi/4*d**2)*L*n/60/1000;\t\t\t#KW\n",
      "print \"Indicated Power in KW : %.2f\"%IP\n",
      "\n",
      "Rb = Db/2;\t\t\t#meter\n",
      "BP = NetBrakeLoad*Rb*2*math.pi*N/60/1000;\t\t\t#KW\n",
      "print \"Brake Power in KW : %.3f\"%BP\n",
      "Etta_m = BP/IP*100;\t\t\t#%\n",
      "print \"Mechanical Efficiency in %% : %.2f\"%Etta_m\n",
      "Etta_i = IP/mf/CV*100;\t\t\t#%\n",
      "print \"Indicated Thermal Efficiency in %% : %.2f\"%Etta_i\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Indicated Power in KW : 26.59\n",
        "Brake Power in KW : 21.206\n",
        "Mechanical Efficiency in % : 79.75\n",
        "Indicated Thermal Efficiency in % : 21.61\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.10 Page No : 27"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\t\n",
      "# Variables :\n",
      "mf = 20.;\t\t\t#Kg/hr\n",
      "BP = 80.;\t\t\t#KW\n",
      "Etta_m = 80./100;\n",
      "CV = 45000.;\t\t\t#KJ/Kg\n",
      "\n",
      "# Calculations and Results\n",
      "bsfc = mf/BP;\t\t\t#break specified fuel consumption in Kg/KWh\n",
      "print \"Break specified fuel consumption in Kg/KWh : \",bsfc\n",
      "\n",
      "IP = BP/Etta_m;\t\t\t#KW\n",
      "mf = mf/60/60;\t\t\t#Kg/s\n",
      "n = mf/100;\t\t\t#Kg/KWh\n",
      "Etta_b = BP/mf/CV*100;\t\t\t#%\n",
      "print \"Break Efficiency in % : \",Etta_b\n",
      "Etta_I = Etta_b/Etta_m;\t\t\t#\n",
      "print \"Indicated thermal Efficiency in % : \",Etta_I\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Break specified fuel consumption in Kg/KWh :  0.25\n",
        "Break Efficiency in % :  32.0\n",
        "Indicated thermal Efficiency in % :  40.0\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.11 Page No : 28"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\t\n",
      "# Variables :\n",
      "d = 270./1000;\t\t\t#meter\n",
      "L = 380./1000;\t\t\t#meter\n",
      "Pmi = 6.;\t\t\t#bar\n",
      "N = 350.;\t\t\t#rpm\n",
      "WsubS = 1000.;\t\t\t#N\n",
      "Db = 1.5;\t\t\t#meter\n",
      "mf = 10.;\t\t\t#Kg/hr\n",
      "CV = 44400.;\t\t\t#KJ/Kg\n",
      "\n",
      "# Calculations and Results\n",
      "IP = Pmi*10**5*(math.pi/4*d**2)*L*N/2/60/1000;\t\t\t#KW\n",
      "print \"Indicated Power in KW : %.3f\"%IP\n",
      "\n",
      "BP = (WsubS)*math.pi*Db*N/60/1000;\t\t\t#KW\n",
      "print \"Brake Power in KW : %.2f\"%BP\n",
      "\n",
      "Etta_m = BP/IP*100;\t\t\t#%\n",
      "print \"Mechanical Efficiency in %% : %.1f\"%Etta_m\n",
      "\n",
      "mf = mf/60/60;\t\t\t#Kg/s\n",
      "Etta_b = BP/mf/CV*100;\t\t\t#\n",
      "print \"Indicated thermal Efficiency in %% : %.2f\"%Etta_b\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Indicated Power in KW : 38.075\n",
        "Brake Power in KW : 27.49\n",
        "Mechanical Efficiency in % : 72.2\n",
        "Indicated thermal Efficiency in % : 22.29\n"
       ]
      }
     ],
     "prompt_number": 11
    }
   ],
   "metadata": {}
  }
 ]
}