{
 "metadata": {
  "name": "",
  "signature": "sha256:35ca703091135bbc509f1d4a29922b1e16306a20c7163e4334307fd974e6f56e"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 5: Direct-Current Generators\n"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.1, Page 290"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "P1=2;\n",
      "P2=4.;\n",
      "S=10.;#no. of slots\n",
      "\n",
      "#Calculations&Results\n",
      "S_p1=S/P1;#slots per pole\n",
      "y1=int(S_p1);#coil pitch in slots\n",
      "S_s1=180./S_p1;#slot span\n",
      "C_p1=S_s1*y1;#coil pitch(electrical)\n",
      "print 'coil pitch for 2-pole winding (electrical)=%.f degrees'%C_p1\n",
      "S_p2=S/P2;#slots per pole\n",
      "S_s2=180./S_p2;#slot span\n",
      "y2=int(S_p2);#coil pitch in slots\n",
      "C_p2=S_s2*y2;#coil pitch(electrical)\n",
      "print 'coil pitch for 4-pole winding(electrical)=%.f degrees'%C_p2"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "coil pitch for 2-pole winding (electrical)=180 degrees\n",
        "coil pitch for 4-pole winding(electrical)=144 degrees\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.2, Page 297"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "C = 35.  #no. of segments\n",
      "P = 6.   #no. of poles\n",
      "\n",
      "#Calculations\n",
      "yc1 = (C+1)/(P/2)\n",
      "yc2 = (C-1)/(P/2)\n",
      "\n",
      "#Result\n",
      "print \"The required windings are %d and %.2f\"%(yc1,yc2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The required windings are 12 and 11.33\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.3, Page 301"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "C=24.;#no. of coils\n",
      "N_c=18.;#no. of turns per coil\n",
      "P=2.;#no. of pole\n",
      "W_m=183.2;#angular velocity(in rad/sec)\n",
      "\n",
      "#Calculations&Results\n",
      "Z=2*C*N_c;#total armature conductors\n",
      "a=2.;#no. of parallel paths\n",
      "L=0.2;#effective length of machine(in meter)\n",
      "r=0.1;#radius of armature(in meter)\n",
      "A_p=(2*math.pi*r*L)/P;#actual pole area\n",
      "A_e=A_p*0.8;#effective pole area\n",
      "B=1.;#flux density per pole(in Tesla)\n",
      "Phy=round(B*A_e,2);#effective flux per pole\n",
      "K_a=round((Z*P)/(2*math.pi*a),2);#machine constant\n",
      "E_a=K_a*Phy*W_m;\n",
      "print '(a) induced emf in armature winding  (in Volts)=%.1f'%E_a\n",
      "E_coil=E_a/(C/a);\n",
      "print '(b) induced emf per coil  (in Volts)=%.2f'%E_coil\n",
      "E_turn=E_coil/N_c;\n",
      "print '(c) induced emf per turn  (in Volts)=%.2f'%E_turn\n",
      "E_cond=E_turn/2;\n",
      "print '(d) induced emf per conductor  (in Volts)=%.3f'%E_cond"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) induced emf in armature winding  (in Volts)=1259.6\n",
        "(b) induced emf per coil  (in Volts)=104.97\n",
        "(c) induced emf per turn  (in Volts)=5.83\n",
        "(d) induced emf per conductor  (in Volts)=2.916\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.4, Page 304"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "K_a=137.51;#Refer to exa:5.3\n",
      "Phy=0.05;#flux per pole (Refer to exa:5.3)\n",
      "E_a=1259.6;#induced emf (Refer to exa:5.3)\n",
      "I=25;#current in the machine (in Amperes)\n",
      "a=2;#no. of parallel paths\n",
      "\n",
      "#Calculations&Results\n",
      "I_cond=I/a;\n",
      "print '(a) current in each conductor (in Amperes)=%.1f'%I_cond\n",
      "T_d=K_a*Phy*I;\n",
      "print '(b) torque developed by machine (in Newton-meter)=%.2f'%T_d\n",
      "P_d=E_a*I;\n",
      "print '(c) Power developed (in Watts)=%.f'%P_d"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) current in each conductor (in Amperes)=12.0\n",
        "(b) torque developed by machine (in Newton-meter)=171.89\n",
        "(c) Power developed (in Watts)=31490\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.5, Page 321"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "N_m=600.;#speed of rotor (in rpm)\n",
      "R_a=0.01;#armature resistance (in ohms)\n",
      "R_fw=30.;#feild winding resistance(in ohms)\n",
      "V_f=120.;# voltage of external source (in volts)\n",
      "N_f=500.;#no. of turns per pole\n",
      "P_r=10000;#in watts\n",
      "V_t=240.;#terminal voltage (in volts)\n",
      "P_o=240*10**3;#rated power (in watts)\n",
      "\n",
      "#Calculations&Results\n",
      "I_L=P_o/V_t;#load current\n",
      "I_a=I_L;#armature current\n",
      "E_afl=V_t+(I_a*R_a);#refer to eqn:5.27\n",
      "print '(a) induced emf at full load (in Volts)=%.f'%E_afl\n",
      "P_d=E_afl*I_a;\n",
      "print '(b) power developed (in watts)=%.f'%P_d\n",
      "W_m=(2*math.pi*N_m)/60;#angular velocity (Refer to Eqn:5.5&5.6)\n",
      "T_d=P_d/W_m;\n",
      "print '(c) torque developed (in Newton-meter)=%.2f'%T_d\n",
      "P_inm=P_d+P_r;#mechanical power input\n",
      "T_s=P_inm/W_m;\n",
      "print '(d) Applied torque (in Newton-meter)=%.2f'%T_s\n",
      "#Refer fig:5.21 (magnetization curve)\n",
      "I_f=2.5;#effective feild current\n",
      "mmf=(2.5*N_f)+(0.25*I_a);#total  mmf\n",
      "I_fa=mmf/N_f;#actual feild current\n",
      "P_in=P_inm+(V_f*I_fa);#total power input\n",
      "Eff=(P_o/P_in)*100;\n",
      "print '(e) efficiency (%%)=%.1f'%Eff\n",
      "R_f=V_f/I_fa;\n",
      "R_fx=R_f-R_fw;\n",
      "print '(f) external resistance in feild winding (in ohms)=%.f'%R_fx\n",
      "VR=((266-V_t)/V_t)*100;#Refer to fig:5.21\n",
      "print '(g) voltage regulation (%%)=%.2f'%VR"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) induced emf at full load (in Volts)=250\n",
        "(b) power developed (in watts)=250000\n",
        "(c) torque developed (in Newton-meter)=3978.87\n",
        "(d) Applied torque (in Newton-meter)=4138.03\n",
        "(e) efficiency (%)=92.2\n",
        "(f) external resistance in feild winding (in ohms)=10\n",
        "(g) voltage regulation (%)=10.83\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.6, Page 327"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "R_fw=30;#in ohms\n",
      "R_a=0.2;#in ohms\n",
      "N_f=200;#turns/pole\n",
      "P_r=1200;#in Watts\n",
      "I_L=100;\n",
      "D_mmf=0.5*I_L;#demagnetizing mmf\n",
      "V_nL=170;#no load voltage (in Volts)\n",
      "#Refer to fig:5.26 (magnetization curve)\n",
      "I_f=3.5;#field current in Amperes\n",
      "\n",
      "#Calculations&Results\n",
      "R_f=V_nL/I_f;\n",
      "R_fx=R_f-R_fw;\n",
      "print 'R_fx (in ohms)=%.2f'%R_fx\n",
      "#First iteration:\n",
      "#Assume \n",
      "E_a=170;\n",
      "V_t1=E_a-103.5*R_a;\n",
      "#Second iteration:\n",
      "I_f2=V_t1/R_f;#actual field current\n",
      "I_fe2=(N_f*I_f2-D_mmf)/N_f;\n",
      "#Refer to fig:5.26\n",
      "E_a2=165;\n",
      "V_t2=E_a2-103.07*R_a;\n",
      "#third iteration\n",
      "I_f3=V_t2/R_f;#actual field current\n",
      "I_fe=(N_f*I_f-D_mmf)/N_f;\n",
      "#Refer to fig:\n",
      "E_a3=163;\n",
      "V_t3=E_a3-102.97*R_a;\n",
      "V_t=V_t3;\n",
      "print '(a) Terminal voltage (in Volts)=%.2f'%V_t\n",
      "I_f=V_t/R_f;\n",
      "E_a=E_a3;\n",
      "VR=(V_nL-V_t)*100/V_t;\n",
      "print '(b) Voltage Regulation (%%)=%.2f'%VR\n",
      "P_o=V_t*I_L;#power output\n",
      "P_cu=R_a*(I_L+I_f)**2+R_f*I_f**2;#copper loss\n",
      "P_d=P_o+P_cu;#power developed\n",
      "P_in=P_d+P_r;#power input\n",
      "Eff=P_o*100/P_in;\n",
      "print '(c) Efficiency (%%)=%.2f'%Eff"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "R_fx (in ohms)=18.57\n",
        "(a) Terminal voltage (in Volts)=142.41\n",
        "(b) Voltage Regulation (%)=19.38\n",
        "(c) Efficiency (%)=79.22\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.7, Page 331"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V_o=240;#bus bar voltage (in Volts)\n",
      "I_d=0;\n",
      "I_s=300;#current in series winding (in Amperes)\n",
      "R_s=0.03;#resistance of series feild winding(in ohms)\n",
      "R_a=0.02;#resistance of armature winding(in ohms)\n",
      "R_fe=0.25;#resistance of feeder (in ohms)\n",
      "#Refer to eqn:5.33\n",
      "I_a=I_s;\n",
      "\n",
      "#Calculations\n",
      "E_a=0.4*I_s;#induced emf\n",
      "V_d=I_s*(R_s+R_a+R_fe);#voltage drop (in Volts)\n",
      "V_t=V_o+E_a-V_d;\n",
      "\n",
      "#Result\n",
      "print ' voltage between far end of feeder and bus bar  (in Volts)=%.f'%V_t"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " voltage between far end of feeder and bus bar  (in Volts)=270\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.8, Page 335"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "Vt = 240  #V\n",
      "Il = 100  #A\n",
      "Is = 3   #shunt field current,A\n",
      "Ra = 50*10**-3 #armature resistance,ohms\n",
      "Rs = 10*10**-3 #series field resistance,ohms\n",
      "Rd = 40*10**-3 #field diverter resistance,ohms\n",
      "Pr = 2*10**3   #rotational loss,W\n",
      "Rfe = 30*10**-3 #ohms\n",
      "\n",
      "#Calculations\n",
      "Po = Vt*Il   #W\n",
      "If = 3     #A\n",
      "Ia = Il+If  #A\n",
      "Is = Rd/(Rd+Rs)*Il  #A\n",
      "Id = Il-Is\n",
      "Ea = Vt+(Il*Rfe)+(Is*Rs)+(Ia*Ra)  #V\n",
      "Vf = Ea-(Ia*Ra)    #V\n",
      "Rf = Vf/3  #ohms\n",
      "#Copper losses\n",
      "Pa = Ia**2*Ra   #armature loss\n",
      "Pse = Is**2*Rs  #series filed loss\n",
      "Psf = If**2*Rf  #shunt field loss\n",
      "Pdr = Id**2*Rd  #diverter resistance loss\n",
      "Pfr = Il**2*Rfe #feeder resistance loss\n",
      "Pcu = Pa+Pse+Psf+Pdr+Pfr  #total copper loss\n",
      "Pd = Po+Pcu  #power developed\n",
      "Pin = Pd+Pr  #power input\n",
      "N = Po/Pin*100\n",
      "\n",
      "#Result \n",
      "print \"Efficiency = %.2f %%\"%N"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Efficiency = 86.82 %\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.9, Page 340"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "R_a=50*10**-3;#armature resistance (in ohms)\n",
      "R_s=20*10**-3;#series field resistance\n",
      "R_sh=40;#shunt field resistance\n",
      "P_rot=2000;#rotational loss (in watts)\n",
      "V=120;#voltage (in vollts)\n",
      "\n",
      "#Calculations\n",
      "I_f=V/R_sh;#shunt field current\n",
      "#Refer toeqn 5.49\n",
      "I_Lm=math.sqrt((P_rot+(R_a+R_s+R_sh)*(I_f**2))/(R_a+R_s));\n",
      "P_o=I_Lm*V;#power output at max efficiency\n",
      "P_cu=(((I_Lm**2)*(R_a+R_s))+((I_f**2)*R_sh));#total copper loss\n",
      "P_d=P_o+P_cu;#Power developed at max efficiency\n",
      "P_in=P_d+P_rot;\n",
      "Eff=(P_o/P_in)*100;\n",
      "\n",
      "#Result\n",
      "print 'Max efficiency of generator(%%)=%.2f'%Eff"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Max efficiency of generator(%)=82.36\n"
       ]
      }
     ],
     "prompt_number": 9
    }
   ],
   "metadata": {}
  }
 ]
}