{
 "metadata": {
  "name": "",
  "signature": "sha256:a295b23ddf355cc98776039dc2c765e71624b4961371dafae0a82fd3d3a044d3"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 9: Control of Traction Motors"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.1, Page 268"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V=600.;# in volts\n",
      "I=350.;#in A\n",
      "Ts=20.;# in sec\n",
      "R=0.15;# in ohm\n",
      "\n",
      "#Calculations&Results\n",
      "E_bse=(V/2)-(I*R);\n",
      "E_bp=V-(I*R);\n",
      "Tse=(E_bse/E_bp)*Ts;\n",
      "Tp=Ts-Tse;\n",
      "Vd=V-(2*I*R);\n",
      "Ed1=(Vd/2)*I*(Tse/3600);\n",
      "Ed2=((V/2)/2)*2*I*(Tp/3600);\n",
      "El=(Ed1+Ed2)*10**-3;\n",
      "print \"part (a)\"\n",
      "print \"Energy lost in starting rhestat,El(kWh) = %.4f\"%El\n",
      "El_1=(2*(I**2)*R*Ts)/(3600*1000);\n",
      "print \"part (b)\"\n",
      "print \"Energy lost in  motors,El(kWh) = %.3f\"%El_1\n",
      "#answer is wrong in  part b in the textbook\n",
      "Et=((V*I*Tse)+(2*V*I*Tp))/(3600*1000);\n",
      "print \"part (c)\"\n",
      "print \"Total Energy,Et(kWh) = %.3f\"%Et"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "part (a)\n",
        "Energy lost in starting rhestat,El(kWh) = 0.5372\n",
        "part (b)\n",
        "Energy lost in  motors,El(kWh) = 0.204\n",
        "part (c)\n",
        "Total Energy,Et(kWh) = 1.806\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.2, Page 269"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V=600.;# in volts\n",
      "I=300.;#in A\n",
      "Ts=15.;# in sec\n",
      "R=0.1;# in ohm\n",
      "\n",
      "#Calculations&Results\n",
      "E_bse=(V/2)-(I*R);\n",
      "E_bp=V-(I*R);\n",
      "Tse=(E_bse/E_bp)*Ts;\n",
      "Tp=Ts-Tse;\n",
      "Vd=V-(2*I*R);\n",
      "Ed1=(round((Vd/2)*I*(Tse/3600))*10**-3);#\n",
      "print \"part (i)\"\n",
      "print \"rheostatic in series,Ed1(kWh) = %.2f\"%Ed1\n",
      "Ed2=((V/2)/2)*2*I*(Tp/3600)*10**-3;\n",
      "print \"rheostatic in parallel,Ed2(kWh) = %.3f\"%Ed2\n",
      "Vm=29;# in kmph\n",
      "alfa=Vm/Ts;\n",
      "S=alfa*Tse;\n",
      "print \"part (ii)\"\n",
      "print \"Speed at the end of series period,S(km/h) = %.1f\"%S"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "part (i)\n",
        "rheostatic in series,Ed1(kWh) = 0.16\n",
        "rheostatic in parallel,Ed2(kWh) = 0.197\n",
        "part (ii)\n",
        "Speed at the end of series period,S(km/h) = 13.7\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.3, Page 270"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V=600;# in volts\n",
      "I=200;#in A\n",
      "Ts=20;# in sec\n",
      "R=0.1;# in ohm\n",
      "\n",
      "#Calculations&Results\n",
      "E_bse=(V/2)-(I*R);\n",
      "E_bp=V-(I*R);\n",
      "Tse=(E_bse/E_bp)*Ts;\n",
      "Tp=Ts-Tse;\n",
      "Vd=V-(2*I*R);\n",
      "Mi=((V*I*Tse)/(2*3600))+((V*I*Tp)/3600);\n",
      "Er=((Vd/4)*I*(Tse/3600))+(((V/2)/2)*I*(Tp/3600));\n",
      "El=(I**2*R*Ts)/(3600);\n",
      "Mo=Mi-Er-El;\n",
      "eta=(Mo/Mi)*100;\n",
      "print \"part (a)\"\n",
      "print \"Starting efficiency = %.1f%%\"%eta\n",
      "Vm=80;# in kmph\n",
      "alfa=Vm/Ts;\n",
      "S=alfa*Tse;\n",
      "print \"part (b)\"\n",
      "print \"speed,S(kmph) = %.2f\"%S"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "part (a)\n",
        "Starting efficiency = 63.7%\n",
        "part (b)\n",
        "speed,S(kmph) = 38.62\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.4, Page 271"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "W=150;# in tonne\n",
      "We=1.1*W;# in tonnes\n",
      "Vm=30;#kmph\n",
      "V=600;# in volts\n",
      "r=10;# N/tonne\n",
      "I=300;#in A\n",
      "R=0.1;# in ohm\n",
      "Ft=4*15000;# in N\n",
      "G=1;#gradient in %\n",
      "\n",
      "#Calculations&Results\n",
      "alfa=(Ft-(W*r)-(98.1*W*G))/(277.8*We);\n",
      "Ts=Vm/alfa;\n",
      "E_bse=(V/2)-(I*R);\n",
      "E_bp=V-(I*R);\n",
      "Tse=(E_bse/E_bp)*Ts;\n",
      "print \"part (a)\"\n",
      "print \"Duration of starting period,Ts(seconds) = %.1f\"%Ts\n",
      "print \"Duration for Series running,Tse(seconds) = %.1f\"%Tse\n",
      "sptr=alfa*Tse;#in kmph\n",
      "print \"part (b)\"\n",
      "print \"speed of train at transition in kmph is %.2f\"%sptr\n",
      "sptr=alfa*Tse;#in kmph\n",
      "rls=((V-(2*I*R))/2)*(2*I)*(Tse/3600);#watts hours\n",
      "rlp=((V/2)/2)*(4*I)*((Ts-Tse)/3600);#watts hours\n",
      "tl=rls+rlp;#\n",
      "print \"part (c)\"\n",
      "print \"rheostat losses during series operation is %.1f W-hours\"%rls\n",
      "print \"rheostat losses during parallel operation is %.f W-hours\"%rlp\n",
      "print \"total losses in W-hours is %.1f \"%tl"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "part (a)\n",
        "Duration of starting period,Ts(seconds) = 31.4\n",
        "Duration for Series running,Tse(seconds) = 14.9\n",
        "part (b)\n",
        "speed of train at transition in kmph is 14.21\n",
        "part (c)\n",
        "rheostat losses during series operation is 669.4 W-hours\n",
        "rheostat losses during parallel operation is 826 W-hours\n",
        "total losses in W-hours is 1495.9 \n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.5, Page 272"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "nf=1.; \n",
      "n2=1.25*nf; \n",
      "of=1; \n",
      "of2=nf/n2; \n",
      "isef=1; \n",
      "ise2=0.66667; \n",
      "\n",
      "#Calculations\n",
      "ia2=(1./ise2); \n",
      "idiv=ia2-ise2; \n",
      "rdiv=ise2/idiv; \n",
      "\n",
      "#Result\n",
      "print \"diverter resistance required as percentage of the field resistance is %.f%%\"%(rdiv*100)\n",
      "#answer is wrong in the textbook"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "diverter resistance required as percentage of the field resistance is 80%\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.6, Page 272"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "Ia=[60,80,100,120,160,180];# in amperes\n",
      "sp1=[47.4,40.3,35.8,33.9,29.8,28.5];#in kmph\n",
      "dpk=[440,700,970,1245,1800,2360];#in kg\n",
      "sp2=[58.1,50,45,40.3,35,32];#\n",
      "\n",
      "#Calculations&Results\n",
      "for i in range(0,6):\n",
      "    dpk1= ((dpk[i])*(sp1[i]))/(sp2[i]);#\n",
      "    print \"For current = \",Ia[i],\"A, speed is \",sp2[i],\"kmph and drawbar pull is\",round(dpk1),\"kg\"\n",
      "    \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "For current =  60 A, speed is  58.1 kmph and drawbar pull is 359.0 kg\n",
        "For current =  80 A, speed is  50 kmph and drawbar pull is 564.0 kg\n",
        "For current =  100 A, speed is  45 kmph and drawbar pull is 772.0 kg\n",
        "For current =  120 A, speed is  40.3 kmph and drawbar pull is 1047.0 kg\n",
        "For current =  160 A, speed is  35 kmph and drawbar pull is 1533.0 kg\n",
        "For current =  180 A, speed is  32 kmph and drawbar pull is 2102.0 kg\n"
       ]
      }
     ],
     "prompt_number": 33
    }
   ],
   "metadata": {}
  }
 ]
}