{
 "metadata": {
  "name": "",
  "signature": "sha256:73456f874b64111f39ff6e1df283939e5a576ba362e30194dc5083b7ddd99204"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 1: Synchronous Machines(Additional problems)"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 1, Page 120"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "phase = 3  #three phase winding\n",
      "ns = 36.    #number of slots\n",
      "np = 4     #number of poles\n",
      "\n",
      "#Calculations\n",
      "nsp = ns/phase  #number of slots per phase\n",
      "npp = nsp/np    #number of slots pole/phase\n",
      "alpha = 180*np/ns #slot angle\n",
      "Kd = math.sin(npp*alpha/2*math.pi/180)/(3*math.sin(alpha/2*math.pi/180))\n",
      "\n",
      "#Results\n",
      "print \"The distribution factor is %.2f\"%Kd"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The distribution factor is 0.96\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 2, Page 120"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "np = 3    #number of phases\n",
      "npl = 4   #number of poles\n",
      "ns = 24   #number of slots\n",
      "\n",
      "#calculaions\n",
      "nsp = ns/npl    #number of slot/pole\n",
      "alpha = 180/nsp #slot pitch(degrees)\n",
      "m = ns/(npl*np) \n",
      "Kd = math.sin(m*alpha/2*math.pi/180)/(m*math.sin(alpha/2*math.pi/180))\n",
      "Kc = math.cos(alpha/2*math.pi/180)\n",
      "\n",
      "#Results\n",
      "print \"Distribution factor = %.2f\"%Kd\n",
      "print \"Pitch factor = %.3f degrees\"%Kc"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Distribution factor = 0.97\n",
        "Pitch factor = 0.966 degrees\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 3, Page 120"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "Vl= 11000     #V\n",
      "N = 1500      #rpm\n",
      "f = 50        #Hz\n",
      "\n",
      "#Calculations\n",
      "P = (120*f)/N\n",
      "Vp = Vl/math.sqrt(3)\n",
      "\n",
      "#Results\n",
      "print \"Number of poles = %d\"%P\n",
      "print \"Voltage per phase of alternator = %d V\"%Vp"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Number of poles = 4\n",
        "Voltage per phase of alternator = 6350 V\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 4, Page 120"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "P = 4    #number of poles\n",
      "ph = 3   #number of phases\n",
      "s = 36   #number of slots\n",
      "cs = 8   #coil span\n",
      "\n",
      "#calculations\n",
      "nsp = s/P    #number of slots/pole\n",
      "alpha = 180/nsp   #slot pitch\n",
      "m = s/(P*ph)\n",
      "Kd = math.sin(m*alpha/2*math.pi/180)/(m*math.sin(alpha/2*math.pi/180))\n",
      "ns = nsp-cs   #no. of slots by which coil is short pitched\n",
      "B = 1*alpha\n",
      "Kc= math.cos(B/2*math.pi/180)\n",
      "\n",
      "#Results\n",
      "print \"Distribution factor = %.3f\"%Kd\n",
      "print \"Pitch factor = %.3f degrees\"%Kc"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Distribution factor = 0.960\n",
        "Pitch factor = 0.985 degrees\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 5, Page 120"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "P= 16.    #number of poles\n",
      "N = 375  #rpm\n",
      "s = 144.  #number of slots\n",
      "c = 10   #number of conductors\n",
      "phase = 3\n",
      "phi = 0.035  #flux per pole\n",
      "\n",
      "#Calculations\n",
      "f = (P*N)/120  #Hz\n",
      "ns = s/P         #slot/pole\n",
      "m = ns/phase\n",
      "alpha = 180/ns   #slot angle\n",
      "Kd = math.sin(m*alpha/2*math.pi/180)/(m*math.sin(alpha/2*math.pi/180))\n",
      "Tc = s*c         #total number of conductor\n",
      "Tcp = Tc/phase   #total number of conductors/phase\n",
      "Ncp = Tcp/2      #number of turns/phase\n",
      "emf = 4.44*Kd*phi*f*Ncp\n",
      "Vl = math.sqrt(3)*emf\n",
      "\n",
      "#Results\n",
      "print \"Frequency = %d Hz\"%f\n",
      "print \"E.M.F = %d V\"%emf\n",
      "print \"Line voltage = %d V\"%Vl"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Frequency = 50 Hz\n",
        "E.M.F = 1789 V\n",
        "Line voltage = 3100 V\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 6, Page 120"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "P = 4   #no. of poles\n",
      "s = 36  #no. of slots\n",
      "ph = 3  #no. of phases\n",
      "cs = 8  #coil span\n",
      "\n",
      "#Calculations\n",
      "ns = s/P  #no. of slots/pole\n",
      "alpha = 180/ns  #slot pitch\n",
      "m = s/(P*ph)\n",
      "Kd = math.sin(m*alpha/2*math.pi/180)/(m*math.sin(alpha/2*math.pi/180))\n",
      "Ns = ns-cs\n",
      "Kc = math.cos(alpha/2*math.pi/180)\n",
      "\n",
      "#Results\n",
      "print \"Distribution factor = %.2f\"%Kd\n",
      "print \"Pitch factor = %.4f degrees\"%Kc"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Distribution factor = 0.96\n",
        "Pitch factor = 0.9848 degrees\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 7, Page 120"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "El = 6600    #V\n",
      "P = 4        #number of poles\n",
      "s = 60       #number of slots\n",
      "ph = 3       #number of phases\n",
      "c = 2        #number of conductors\n",
      "sn = 13      #slot number\n",
      "f = 50       #Hz\n",
      "T = 20       #V\n",
      "\n",
      "#Calculations\n",
      "n = s/P\n",
      "m = n/ph\n",
      "Zp = (s*c)/ph\n",
      "B = 180/n     #degrees\n",
      "Kd = math.sin(m*B/2*math.pi/180)/(m*math.sin(B/2*math.pi/180))\n",
      "Cs = (sn-1)*180/n  #degrees\n",
      "Kp = math.cos((180-Cs)/2*math.pi/180)\n",
      "phi = El/(math.sqrt(3)*4.44*Kd*Kp*f*T)\n",
      "\n",
      "#Results\n",
      "print \"The required flux pole is %.3f V\"%phi"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The required flux pole is 0.943 V\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 8, Page 120"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Varible declaration\n",
      "Vl = 230    #V\n",
      "Rt = 10*10**3  #VA\n",
      "ph = 3      #no. of phases\n",
      "Ra = 0.5    #ohms/phase\n",
      "Xs = 1.2    #ohms/phase\n",
      "cos_phi = 0.8  #lagging\n",
      "sin_phi = 0.6  #leading\n",
      "V = 132.8      #V\n",
      "\n",
      "#Calculations\n",
      "I = Rt/(ph*V)  #A\n",
      "print I\n",
      "#Part(a)\n",
      "Eo = math.sqrt(((V*cos_phi)+(I*Ra))**2+((V*sin_phi)+(I*Xs))**2)\n",
      "Reg1 = (Eo-V)/V*100\n",
      "\n",
      "#Part(b)\n",
      "Eo = math.sqrt((V*cos_phi+I*Ra)**2+(V*sin_phi-I*Xs)**2)\n",
      "Reg2 = (Eo-V)/V*100\n",
      "\n",
      "#Results\n",
      "print \"Part(a): Regulation = %.2f %%\"%Reg1\n",
      "print \"Part(b): Regulation = %.2f %%\"%Reg2"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "25.1004016064\n",
        "Part(a): Regulation = 21.81 %\n",
        "Part(b): Regulation = -3.08 %\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 9, Page 120"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "El = 10000   #V\n",
      "Kd = 0.96\n",
      "Kp = 1.0\n",
      "phi = 15*10**-2  #wb\n",
      "f = 50       #Hz\n",
      "\n",
      "#Calculations\n",
      "T = El/(math.sqrt(3)*4.44*Kd*Kp*phi*f)\n",
      "Zp = 2*T\n",
      "\n",
      "#Result\n",
      "print \"Number of armature conductors in series/phase = %d\"%Zp\n",
      "#Answer differs due to rounding-off errors"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Number of armature conductors in series/phase = 361\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 10, Page 120"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "s = 90   #no. of slots\n",
      "P = 10   #no. of poles\n",
      "ph = 3   #no. of phases\n",
      "E = 11000. #E.M.F(V)\n",
      "phi = 0.16 #flux(Wb)\n",
      "f = 50     #Hz\n",
      "\n",
      "#Calculations\n",
      "nsp = s/(P*ph)  #slot/pole/phase\n",
      "alpha = 180/(s/P) #slot angle\n",
      "m = s/(P*ph)\n",
      "Kd = math.sin(m*alpha/2*math.pi/180)/(m*math.sin(alpha/2*math.pi/180))\n",
      "N = E/(math.sqrt(3)*4.44*Kd*phi*f)\n",
      "Nc = 2*N\n",
      "\n",
      "#Result\n",
      "print \"Number of conductors/phase are %d\"%Nc\n",
      "#Incorrect answer for N in the textbook. Hence the result differs"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Number of conductors/phase are 372\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 11, Page 121"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "Vl = 400    #V\n",
      "cos_phi = 1 #pf\n",
      "n = 85./100 #efficiency\n",
      "Zs = 10     #reactance(ohms)\n",
      "\n",
      "#Calculations\n",
      "out = Zs*735.5  #output\n",
      "mi = out/n      #motor input(W)\n",
      "Il = mi/(math.sqrt(3)*Vl*cos_phi)\n",
      "I = Il   #since current is minimum when power factor is unity\n",
      "Er = I*Zs\n",
      "V = Vl/math.sqrt(3)\n",
      "E = math.sqrt(V**2+Er**2)\n",
      "emf = math.sqrt(3)*E\n",
      "\n",
      "#Results\n",
      "print \"Minimum current = %.1f A\"%I\n",
      "print \"Line induces e.m.f. = %d V\"%emf\n",
      "#Answers differ due to rounding-off errors"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Minimum current = 12.5 A\n",
        "Line induces e.m.f. = 454 V\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 12, Page 121"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "P = 6\n",
      "phi = 25*10**-3   #wb\n",
      "f = 50            #Hz\n",
      "ph = 3            #no. of phases\n",
      "s = 12            #no. of slots/pole\n",
      "nc = 4            #no. of conductors/slot\n",
      "\n",
      "#Calculations\n",
      "Zph = nc*s*P/ph\n",
      "T = Zph/2\n",
      "alpha = 180*(1-5./P)\n",
      "Kc = math.cos(alpha/2*math.pi/180)\n",
      "m = s/ph\n",
      "B = 180/s\n",
      "Kd = math.sin(m*alpha/2*math.pi/180)/(m*math.sin(alpha/2*math.pi/180))\n",
      "Eph = 4.44*Kc*Kd*f*phi*T\n",
      "El = math.sqrt(3)*Eph\n",
      "\n",
      "#Results\n",
      "print \"Line e.m.f. = %.1f V\"%El\n",
      "#incorrect answer for Kd in the textbook. Hence the result differs"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Line e.m.f. = 372.8 V\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 13, Page 121"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "P = 1200   #kW\n",
      "V = 2300   #V\n",
      "Ia = 200   #A\n",
      "cos_phi_a = 0.9  #lagging\n",
      "\n",
      "#Calculations\n",
      "Pa = V*Ia*cos_phi_a/10**3  #kW\n",
      "phi = math.atan(cos_phi_a)\n",
      "Pra = Pa*math.tan(phi)\n",
      "Pr = 0    #since power factor is unity\n",
      "Prb = Pr-Pra\n",
      "Pb = P-Pa\n",
      "tan_phi = Prb/Pb\n",
      "cos_phi_b = math.cos(math.atan(tan_phi))\n",
      "Ia = Pb*10**3/(V*cos_phi_b)\n",
      "\n",
      "#Results\n",
      "print \"Power = %d kW\"%Pb\n",
      "print \"Power factor = %.3f\"%cos_phi_b\n",
      "print \"Current = %.1f A\"%Ia\n",
      "#incorrect answers in the textbook"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power = 786 kW\n",
        "Power factor = 0.904\n",
        "Current = 378.2 A\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 14, Page 121"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "\n",
      "#Part (a) - for lighting load\n",
      "P1 = 600   #kW\n",
      "cos_phi =1 #power factor\n",
      "tan_phi = 0\n",
      "Prl = P1*tan_phi\n",
      "\n",
      "#Part(b) - for inductive load\n",
      "P2 = 800    #W\n",
      "cos_phi = 0.9\n",
      "tan_phi = 0.4843\n",
      "Pri = P2*tan_phi\n",
      "\n",
      "#Part(c) - for capacitive power\n",
      "P3 = 800\n",
      "cos_phi = 0.8\n",
      "tan_phi = 0.75\n",
      "Prc = -P3*tan_phi\n",
      "\n",
      "P = P1+P2+P3\n",
      "Pr = Prl+Pri+Prc\n",
      "Pa = 1000    #kW\n",
      "cos_phi_a = 0.85\n",
      "tan_phi_a = math.tan(math.acos(cos_phi_a))\n",
      "Pra = Pa*tan_phi_a\n",
      "Pb = P-Pa\n",
      "Prb = Pr-Pra\n",
      "tan_phi_2 = Prb/Pb\n",
      "cos_phi_b = math.cos(math.atan(tan_phi_2))\n",
      "\n",
      "#Results\n",
      "print \"Active power supplied by alternator B = %d kW\"%Pb\n",
      "print \"Power factor of alternator B = %.4f leading\"%cos_phi_b\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Active power supplied by alternator B = 1200 kW\n",
        "Power factor of alternator B = 0.8217 leading\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 15, Page 121"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "E = 1000   #KVa\n",
      "Vl = 11000  #V\n",
      "ph = 3     #no. of phases\n",
      "Ra = 3.5   #armature resistance(ohms)\n",
      "Xs = 40     #armature reactance(ohms)\n",
      "cos_phi = 0.8\n",
      "\n",
      "#Calculations\n",
      "Ia = round(E*1000/(math.sqrt(3)*Vl),1)\n",
      "V = Vl/math.sqrt(3)\n",
      "phi = math.degrees(math.acos(cos_phi))\n",
      "Rad = round(Ia*Ra)     #armature resistance drop/phase\n",
      "Xad = round(Ia*Xs)     #armature reactance drop per phase\n",
      "Er = math.sqrt(Rad**2+Xad**2) #incorrect answer in the textbook\n",
      "theta = math.degrees(math.atan(Xs/Ra))\n",
      "\n",
      "#Part a - Unity p.f.\n",
      "Eba = math.sqrt(V**2+Er**2-(2*V*Er*math.cos(theta*math.pi/180)))\n",
      "Vla = Eba*math.sqrt(3)\n",
      "#From triangle OAB\n",
      "alpha_a = math.degrees(math.asin((Er*math.sin(theta*math.pi/180))/Eba))\n",
      "\n",
      "#Part b - At p.f. 0.8 lagging\n",
      "BOA_b = theta-phi\n",
      "Ebb = math.sqrt(V**2+Er**2-(2*V*Er*math.cos(BOA_b*math.pi/180)))\n",
      "Vlb = Ebb*math.sqrt(3)\n",
      "alpha_b = math.degrees(math.asin(Er*math.sin(BOA_b*math.pi/180)/Ebb))\n",
      "\n",
      "#Part c - At p.f. 0.8 leading\n",
      "BOA_c = theta+phi\n",
      "Ebc = math.sqrt(V**2+Er**2-(2*V*Er*math.cos(BOA_c*math.pi/180)))\n",
      "Vlc = Ebc*math.sqrt(3)\n",
      "alpha_c = math.degrees(math.asin(Er*math.sin(BOA_c*math.pi/180)/Ebc))\n",
      "\n",
      "#Results\n",
      "print \"Induced e.m.f. and angular retardation are as below:\"\n",
      "print \"Part a : %d V,%.2f degrees\"%(Vla,alpha_a)\n",
      "print \"Part b : %d V,%.2f degrees\"%(Vlb,alpha_b)\n",
      "print \"Part c : %d V,%.2f degrees\"%(Vlc,alpha_c)\n",
      "\n",
      "#Incorrect answers in the textbook"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Induced e.m.f. and angular retardation are as below:\n",
        "Part a : 11284 V,18.80 degrees\n",
        "Part b : 8984 V,17.62 degrees\n",
        "Part c : 13294 V,13.49 degrees\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 16, Page 121"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "Em = 6000    #V\n",
      "Xs = 1.5     #ohms/phase\n",
      "Il = 1000    #amps\n",
      "sin_phi = 1  #power factor\n",
      "\n",
      "#Calculations\n",
      "#Since load is inductive\n",
      "Vt = Em-Il*Xs\n",
      "Vl = round(math.sqrt(3)*Vt)   #since winding is connected in star\n",
      "Pr = math.sqrt(3)*Vl*Il*sin_phi/10**6\n",
      "\n",
      "#Results\n",
      "print \"Reactive power supplied to the load is %.2f MVAR\"%Pr\n",
      "#Incorrect answer in textbook"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Reactive power supplied to the load is 13.50 MVAR\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 17, Page 121"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "V = 7000   #V\n",
      "I = 1400   #amps\n",
      "Xs = 1.2   #ohms\n",
      "f = 50     #Hz\n",
      "Po = 4      #number of poles\n",
      "cos_phi = 1 #power factor, since load is resistive\n",
      "\n",
      "#Calculations\n",
      "E = math.sqrt(V**2+(I*Xs)**2)  #V\n",
      "P = 3*V*I*cos_phi     #W\n",
      "N = 120*f/Po          #rpm\n",
      "w = (2*math.pi*N)/60  #rad/sec\n",
      "T = P/(w*9.81)\n",
      "\n",
      "#Result\n",
      "print \"The required torque is %.2e kg-meter\"%T"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The required torque is 1.91e+04 kg-meter\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 18, Page 122"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "Ep = 5700      #V\n",
      "Xs = 1.5       #ohms\n",
      "\n",
      "#Calculations\n",
      "#Since windings are connected in star\n",
      "Ip = Ep/Xs   #phase current(A)\n",
      "Il = Ip\n",
      "\n",
      "#Result\n",
      "print \"The current per phase is %d Amps\"%Il"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The current per phase is 3800 Amps\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 19, Page 122"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "Vt = 15   #KV\n",
      "Ps = 100*10**6   #power supplied by generator VA\n",
      "cos_phi = 0.8  #power factor(lagging)\n",
      "Xs = 0.7       #ohm per phase\n",
      "Vl = 15        #KV\n",
      "f = 50         #Hz\n",
      "Po = 2          #no. of poles\n",
      "\n",
      "#Calculations\n",
      "Vp = Vl/math.sqrt(3)   #KV\n",
      "AC = Vp*cos_phi\n",
      "sin_phi = 0.6\n",
      "BC = Vp*sin_phi        #KV\n",
      "Il = Ps/(math.sqrt(3)*Vl*10**3)  #amps\n",
      "Vd = Il*Xs             #voltage drop in synchronous reactance KV\n",
      "BL = 2.697\n",
      "LC = BL+BC             #V\n",
      "AL = math.sqrt(AC**2+LC**2)  #V\n",
      "Em = AL*math.sqrt(3)          #V\n",
      "Ns = (120*f)/Po           #rpm\n",
      "P = Ps*cos_phi          #W\n",
      "wT = 80*10**6\n",
      "T = (wT*60)/(2*math.pi*Ns)\n",
      "print \n",
      "#Result\n",
      "print \"Induced e.m.f. = %.2f V\"%Em\n",
      "print \"Torque = %.2e Nw-m\"%T\n",
      "print \"Speed = %d rpm\"%Ns\n",
      "#Answers differ due to rounding-off errors"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "Induced e.m.f. = 18.19 V\n",
        "Torque = 2.55e+05 Nw-m\n",
        "Speed = 3000 rpm\n"
       ]
      }
     ],
     "prompt_number": 21
    }
   ],
   "metadata": {}
  }
 ]
}