{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "CHAPTER 4: DC DYNAMO TORQUE RELATIONS-DC MOTORS"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.1, Page number 100"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "d = 0.5        #Diameter of the coil(m)\n",
      "l = 0.6        #Axial length of the coil(m)\n",
      "B = 0.4        #Flux density(T)\n",
      "I = 25.0       #Current carried by the coil(A)\n",
      "theta = 60.0   #Angle between the useful force & the interpolar reference axis(degree)\n",
      "\n",
      "#Calculation\n",
      "F = B*I*l                             #Force developed on each coil side(N)\n",
      "f = F*math.sin(theta*math.pi/180)     #Useful force at the instant the coil lies at an angle of 60\u00b0 w.r.t the interpolar ref axis(N)\n",
      "r = d/2                               #Radius of the coil(m)\n",
      "T_c = f*r                             #Torque developed(N-m)\n",
      "T_c1 = T_c*0.2248*3.281               #Torque developed in lb-ft by first method\n",
      "T_c2 = T_c*0.737562                   #Torque developed in lb-ft by second method\n",
      "\n",
      "#Result\n",
      "print('Case(a): Force developed on each coil side , F = %.f N' %F)\n",
      "print('Case(b): Useful force at the instant the coil lies at an angle of 60\u00b0 w.r.t the interpolar ref axis , f = %.1f N' %f)\n",
      "print('Case(c): Torque developed , T_c = %.1f N-m' %T_c)\n",
      "print('Case(d): Torque developed by first method , 1.3 N.m * 0.2248 lb/N * 3.281 ft/m = %.2f lb-ft' %T_c1)\n",
      "print('         Torque developed by second method , 1.3 N.m * 0.737562 lb.ft/N.m = %.2f lb-ft' %T_c2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Force developed on each coil side , F = 6 N\n",
        "Case(b): Useful force at the instant the coil lies at an angle of 60\u00b0 w.r.t the interpolar ref axis , f = 5.2 N\n",
        "Case(c): Torque developed , T_c = 1.3 N-m\n",
        "Case(d): Torque developed by first method , 1.3 N.m * 0.2248 lb/N * 3.281 ft/m = 0.96 lb-ft\n",
        "         Torque developed by second method , 1.3 N.m * 0.737562 lb.ft/N.m = 0.96 lb-ft\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.2, Page number 100"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "d = 18.0       #Diameter of the coil(inches)\n",
      "l = 24.0       #Axial length of the coil(inches)\n",
      "B = 24000.0    #Flux density(lines/sq.inches)\n",
      "I = 26.0       #Current carried by the coil(A)\n",
      "theta = 60.0   #Angle between the useful force & the interpolar ref axis(degree)\n",
      "\n",
      "#Calculation\n",
      "F = (B*I*l*10**-7)/1.13             #Force developed on each conductor(lb)\n",
      "f = F*math.sin(theta*math.pi/180)   #Useful force at the instant the coil lies at an angle of 60\u00b0 w.r.t the interpolar ref axis(lb)\n",
      "r = d/2                             #Radius of the coil(inches)\n",
      "T_c = f*(r*1.0/12)                  #Torque developed(lb.ft/conductor)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Force developed on each conductor , F = %.3f lb' %F)\n",
      "print('Case(b): Useful force , f = %.2f lb' %f)\n",
      "print('Case(c): Torque developed , T_c = %.3f lb-ft/conductor' %T_c)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Force developed on each conductor , F = 1.325 lb\n",
        "Case(b): Useful force , f = 1.15 lb\n",
        "Case(c): Torque developed , T_c = 0.861 lb-ft/conductor\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.3, Page number 102"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "Z = 700.0       #Number of conductors\n",
      "d = 24.0        #Diameter of the armature of the dc motor(inches)\n",
      "l = 34.0        #Axial length of the coil(inches)\n",
      "B = 50000.0     #Flux density(lines/sq.inches)\n",
      "I = 25.0        #Current carried by the coil(A)\n",
      "per = 0.7       #Conductors lying directly under poles\n",
      "\n",
      "#Calculation\n",
      "F_av = (B*I*l*10**-7)/1.13*(Z*per)   #Average total force tending to rotate the armature(lb) \n",
      "r = d/2                              #Radius of the coil(inches)\n",
      "T_av = F_av*(r/12)                   #Armature torque(lb-ft)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Average total force tending to rotate the armature , F_av = %.f lb' %F_av)\n",
      "print('Case(b): Armature torque , T_av = %.f lb-ft' %T_av)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Average total force tending to rotate the armature , F_av = 1843 lb\n",
        "Case(b): Armature torque , T_av = 1843 lb-ft\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.4, Page number 102"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "slots = 120.0                #Number of armature slots\n",
      "conductors_per_slot = 6.0    #Number of conductors per slot\n",
      "B = 60000.0                  #Flux density(lines/sq.inches)\n",
      "d = 28.0                     #Diameter of the armature(inches)\n",
      "l = 14.0                     #Axial length of the coil(inches)\n",
      "A = 4.0                      #Number of parallel paths\n",
      "span = 0.72                  #Pole arcs span 72% of the armature surface\n",
      "I = 133.5                    #Armature current(A)\n",
      "\n",
      "#Calculation\n",
      "Z_Ta = slots*conductors_per_slot*span     #Number of armature conductors\n",
      "F_t = (B*I*l)/(1.13*10**7 *A)*Z_Ta        #Force developed(lb)\n",
      "r = (d/2)/12                              #Radius of the armature(feet)\n",
      "T = F_t*r                                 #Total torque developed(lb-ft)\n",
      "\n",
      "#Result\n",
      "print('Total developed armature torque , T = %.f lb-ft' %T)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Total developed armature torque , T = 1500 lb-ft\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.5, Page number 103"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "slots = 120.0                #Number of armature slots\n",
      "conductors_per_slot = 6.0    #Number of conductors per slot\n",
      "B = 60000.0                  #Flux density(lines/sq.inches)\n",
      "d = 28.0                     #Diameter of the armature(inches)\n",
      "l = 14.0                     #Axial length of the coil(inches)\n",
      "A = 4.0                      #Number of parallel paths\n",
      "span = 0.72                  #Pole arcs span 72% of the armature surface\n",
      "T_a = 1500.0                 #Total armature torque(lb-ft)\n",
      "\n",
      "#Calculation\n",
      "Z = slots*conductors_per_slot         #Number of armature conductors\n",
      "r = (d/2)/12                          #Radius of the armature(feet)\n",
      "I_a = T_a*A*1.13*10**7/(B*l*Z*r*span) #Total external armature current(A)\n",
      "\n",
      "#Result\n",
      "print('Total external armature current , I_a = %.1f A' %I_a)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Total external armature current , I_a = 133.5 A\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.6, Page number 104"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "phi_orig = 1.0    #Original flux\n",
      "Ia_orig = 1.0     #Original armature current\n",
      "T_orig = 150.0    #Original torque(N-m)\n",
      "phi_new = 0.9     #New flux\n",
      "Ia_new = 1.5      #New armature current\n",
      "\n",
      "#Calculation\n",
      "T_new = T_orig*(phi_new/phi_orig)*(Ia_new/Ia_orig)     #New torque produced(N-m)\n",
      "\n",
      "#Result\n",
      "print('New torque produced , T = %.1f N-m' %T_new)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "New torque produced , T = 202.5 N-m\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.7, Page number 105"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "R_a = 0.25    #Armature resistance(ohm)\n",
      "BD = 3.0      #Brush contact drop(V)\n",
      "V = 120.0     #Applied voltage(V)\n",
      "E_ca = 110.0  #counter EMF at a given load(V)\n",
      "E_cb = 105    #Counter EMF due to application of additional load(V)\n",
      "\n",
      "#Calculation\n",
      "I_a_a = (V-(E_ca+BD))/R_a            #Armature current(A)\n",
      "I_a_b = (V-(E_cb+BD))/R_a            #Armature current(A)\n",
      "del_Ec = ((E_ca-E_cb)/E_ca)*100      #Change in counter EMF(percent)\n",
      "del_Ia = ((I_a_b-I_a_a)/I_a_a)*100   #Change in armature current(percent)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Aramature current , I_a = %.f A' %I_a_a)\n",
      "print('Case(b): Aramature current due to additional load , I_a = %.f A' %I_a_b)\n",
      "print('Case(c): Change in counter EMF , \u03b4E_c = %.2f percent' %del_Ec)\n",
      "print('         Change in armature current , \u03b4I_a = %.1f percent' %del_Ia)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Aramature current , I_a = 28 A\n",
        "Case(b): Aramature current due to additional load , I_a = 48 A\n",
        "Case(c): Change in counter EMF , \u03b4E_c = 4.55 percent\n",
        "         Change in armature current , \u03b4I_a = 71.4 percent\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.8, Page number 106"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V_a = 120.0       #Rated terminal voltage of the DC motor(V)\n",
      "R_a = 0.2         #Armature circuit resistance(ohm)\n",
      "R_sh = 60.0       #Shunt field resistance(ohm)\n",
      "I_l = 40.0        #Line current at full-load(A)\n",
      "BD = 3.0          #Brush voltage drop(V)\n",
      "S_orig = 1800.0   #Rated full-load speed(rpm)\n",
      "per = 125.0/100   #Overload speed\n",
      "\n",
      "#Calculation\n",
      "#Case(a)\n",
      "I_f = V_a/R_sh                     #Field current(A)\n",
      "I_a_fl = I_l-I_f                   #Armature current at full-load(A)\n",
      "E_c_orig = V_a-(I_a_fl*R_a+BD)     #Back EMF at full-load(V)\n",
      "I_a_nl = I_a_fl/2                  #Armature current at half-load(A)\n",
      "E_c_final = V_a-(I_a_nl*R_a+BD)    #Back EMF at half load(V)\n",
      "S_a = S_orig*(E_c_final/E_c_orig)  #Speed at full load(rpm)\n",
      "#Case(b)\n",
      "I_a_b = I_a_fl*per                 #Armature current at 125% overload(A)\n",
      "E_c_b = V_a-(I_a_b*R_a+BD)         #Back EMF at 125% overload(V)\n",
      "S_b = S_orig*(E_c_b/E_c_orig)      #Speed at 125% overload(rpm)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Speed at half load , S = %.f rpm' %S_a)\n",
      "print('Case(b): Speed at an overload of 125 perecent , S = %.f rpm' %S_b)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Speed at half load , S = 1863 rpm\n",
        "Case(b): Speed at an overload of 125 perecent , S = 1769 rpm\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.9, Page number 106"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "I_l_orig = 40.0         #Original line current(A)\n",
      "I_l_final = 66.0        #Final line current(A)\n",
      "phi_orig = 1.0          #Original flux\n",
      "phi_final = 112.0/100   #Final flux\n",
      "V_a = 120.0             #Rated terminal voltage of the DC motor(V)\n",
      "R_sh_orig = 60.0        #Original Field circuit resistance(ohm)\n",
      "R_sh_final = 50.0       #Decreased final field circuit resistance(ohm)\n",
      "R_a = 0.2               #Armature circuit resistance(ohm)\n",
      "BD = 3.0                #Brush voltage drop(V)\n",
      "S_orig = 1800.0         #Rated full-load speed(rpm)\n",
      "\n",
      "#Calculation\n",
      "I_f_orig = V_a/R_sh_orig                              #Original Field current(A)\n",
      "I_a_orig = I_l_orig-I_f_orig                          #Original Armature current at full-load(A)\n",
      "E_c_orig = V_a-(I_a_orig*R_a+BD)                      #Back EMF at full load(V)\n",
      "I_f_final = V_a/R_sh_final                            #Final field current(A)\n",
      "I_a_final = I_l_final-I_f_final                       #Final Armature current(A)\n",
      "E_c_final = V_a-(I_a_final*R_a+BD)                    #Final EMF induced(V)\n",
      "S = S_orig*(E_c_final/E_c_orig)*(phi_orig/phi_final)  #Final speed of the motor(rpm)\n",
      "\n",
      "#Result\n",
      "print('Speed of the motor , S = %.f rpm' %S)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed of the motor , S = 1532 rpm\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.10, Page number 108"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "I_a_1 = 38.0      #Armature current at full-load(A) from example 4-8a\n",
      "E_c_1 = 109.4     #Back EMF at full-load(V)\n",
      "S_1 = 1800.0      #Speed at full-load(rpm)\n",
      "I_a_2 = 19.0      #Armature current at half-load(A) from example 4-8a\n",
      "E_c_2 = 113.2     #Back EMF at half-load(V)\n",
      "S_2 = 1863.0      #Speed at half-load(rpm)\n",
      "I_a_3 = 47.5      #Armature current at 125% overload(A) from example 4-8b\n",
      "E_c_3 = 107.5     #Back EMF at 125% overload(V)\n",
      "S_3 = 1769.0      #Speed at 125% overload(rpm)\n",
      "I_a_4 = 63.6      #Armature current at overload(A) from example 4-9\n",
      "E_c_4 = 104.3     #Back EMF at overload(V)\n",
      "S_4 = 1532.0      #Speed at overload(rpm)\n",
      "\n",
      "#Calculation\n",
      "P_d_1 = E_c_1*I_a_1    #Armature power developed at full-load(W)\n",
      "P_d_2 = E_c_2*I_a_2    #Armature power developed at half-load(W)\n",
      "P_d_3 = E_c_3*I_a_3    #Armature power developed at 125% overload(W)\n",
      "P_d_4 = E_c_4*I_a_4    #Armature power developed at overload(W)\n",
      "\n",
      "#Result\n",
      "print(' Example \\t I_a \\t E_c \\t Speed \\t P_d or (E_c*I_a)')\n",
      "print(' _______________________________________________________________________')\n",
      "print(' 4-8a \\t\\t %d \\t %.1f \\t %d \\t %d W at full-load' %(I_a_1,E_c_1,S_1,P_d_1))\n",
      "print('      \\t\\t %d \\t %.1f \\t %d \\t %.f W at half-load' %(I_a_2,E_c_2,S_2,P_d_2))\n",
      "print(' 4-8b \\t\\t %.1f \\t %.1f \\t %d \\t %d W at 125 percent overload' %(I_a_3,E_c_3,S_3,P_d_3))\n",
      "print(' 4-9  \\t\\t %.1f \\t %.1f \\t %d \\t %d W at overload' %(I_a_4,E_c_4,S_4,P_d_4))\n",
      "print(' _______________________________________________________________________')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Example \t I_a \t E_c \t Speed \t P_d or (E_c*I_a)\n",
        " _______________________________________________________________________\n",
        " 4-8a \t\t 38 \t 109.4 \t 1800 \t 4157 W at full-load\n",
        "      \t\t 19 \t 113.2 \t 1863 \t 2151 W at half-load\n",
        " 4-8b \t\t 47.5 \t 107.5 \t 1769 \t 5106 W at 125 percent overload\n",
        " 4-9  \t\t 63.6 \t 104.3 \t 1532 \t 6633 W at overload\n",
        " _______________________________________________________________________\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.11, Page number 110"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "T_a = 6.5     #Torque(dyne-centimeters)\n",
      "T_b = 10.6    #Torque in (gram-centimeters)\n",
      "T_c = 12.2    #Torque in (ounce-inches)\n",
      "\n",
      "#Calculation\n",
      "T_a_Nm = T_a*1.416*10**-5*7.0612*10**-3    #Torque(N-m)\n",
      "T_a_lbft = T_a*1.416*10**-5*5.208*10**-3   #Torque(lb-ft)\n",
      "T_b_Nm = T_b*(1/72.01)*7.0612*10**-3       #Torque(N-m)\n",
      "T_b_lbft = T_b*(1/72.01)*5.208*10**-3      #Torque(lb-ft)\n",
      "T_c_Nm = T_c*7.0612*10**-3                 #Torque(N-m)\n",
      "T_c_lbft = T_c*5.208*10**-3                #Torque(lb-ft)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Torque , T = %.1e N-m' %T_a_Nm)\n",
      "print('         Torque , T = %.1e lb-ft' %T_a_lbft)\n",
      "print('Case(b): Torque , T = %.2e N-m' %T_b_Nm)\n",
      "print('         Torque , T = %.2e lb-ft' %T_b_lbft)\n",
      "print('Case(c): Torque , T = %.3e N-m' %T_c_Nm)\n",
      "print('         Torque , T = %.2e lb-ft' %T_c_lbft)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Torque , T = 6.5e-07 N-m\n",
        "         Torque , T = 4.8e-07 lb-ft\n",
        "Case(b): Torque , T = 1.04e-03 N-m\n",
        "         Torque , T = 7.67e-04 lb-ft\n",
        "Case(c): Torque , T = 8.615e-02 N-m\n",
        "         Torque , T = 6.35e-02 lb-ft\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.12, Page number 110"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V_a = 120.0    #Rated terminal voltage of dc shunt motor(V)\n",
      "R_a = 0.2      #Armature resistance(ohm)\n",
      "BD = 2.0       #Brush drop(V)\n",
      "I_a = 75.0     #Full-load armature current(A)\n",
      "\n",
      "#Calculation\n",
      "I_st = (V_a-BD)/R_a           #Current at the instant of starting(A)\n",
      "percentage = I_st/I_a*100     #Percentage at full load\n",
      "\n",
      "#Result\n",
      "print('Current at the instant of starting , I_st = %.f A (Counter EMF is zero)' %I_st)\n",
      "print('Percentage at full load = %d percent' %percentage)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Current at the instant of starting , I_st = 590 A (Counter EMF is zero)\n",
        "Percentage at full load = 786 percent\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.13, Page number 111"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V_a = 120.0          #Rated terminal voltage of dc shunt motor(V)\n",
      "R_a = 0.2            #Armature resistance(ohm)\n",
      "BD = 2.0             #Brush drop(V)\n",
      "I_a = 75.0           #Full-load armature current(A)\n",
      "I_a_new = 1.5*I_a    #Armature current at 150% rated load(A) \n",
      "E_c_a = 0            #Back EMF at starting(V)\n",
      "E_c_b = 0.25* V_a    #Back EMF is 25% of Va at 150% rated load(V)\n",
      "E_c_c = 0.5*V_a      #Back EMF is 50% of Va at 150% rated load(V)\n",
      "\n",
      "#Calculation\n",
      "R_s_a = (V_a-E_c_a-BD)/I_a_new-R_a   #Starting resistance at starting(ohm)\n",
      "R_s_b = (V_a-E_c_b-BD)/I_a_new-R_a   #Starting resistance 25% of Va(ohm)\n",
      "R_s_c = (V_a-E_c_c-BD)/I_a_new-R_a   #Starting resistance 50% of Va(ohm)\n",
      "E_c_d = V_a-(I_a*R_a+BD)             #Counter EMF at full-load without starting resistance(V)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Starting resistance at the instant of starting , R_s = %.2f \u03a9' %R_s_a)\n",
      "print('Case(b): Starting resistance at 25 percent of armature voltage , R_s = %.3f \u03a9' %R_s_b)\n",
      "print('Case(c): Starting resistance at 50 percent of armature voltage , R_s = %.3f \u03a9' %R_s_c)\n",
      "print('Case(d): Counter EMF at full-load without starting resistance , E_c = %.f V' %E_c_d)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Starting resistance at the instant of starting , R_s = 0.85 \u03a9\n",
        "Case(b): Starting resistance at 25 percent of armature voltage , R_s = 0.582 \u03a9\n",
        "Case(c): Starting resistance at 50 percent of armature voltage , R_s = 0.316 \u03a9\n",
        "Case(d): Counter EMF at full-load without starting resistance , E_c = 103 V\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.14, Page number 115"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "T_orig = 160.0          #Original torque developed(lb-ft)\n",
      "I_a_orig = 140.0        #Original armature current(A)\n",
      "phi_f_orig = 1.6*10**6  #Original field flux(lines)\n",
      "T_final_a = 190.0       #Final torque developed when reconnected as a cumulative compound motor(lb-ft)\n",
      "I_a_b = 154.0           #Final armature current(A)\n",
      "\n",
      "#Calculation\n",
      "phi_f = phi_f_orig*(T_final_a/T_orig)                  #Field flux(lines)\n",
      "percentage = (phi_f/phi_f_orig)*100-100                #Percentage increase in flux\n",
      "phi_f_final = 1.1*phi_f                                #Final field flux(lines)\n",
      "T_f = T_final_a*(I_a_b/I_a_orig)*(phi_f_final/phi_f)   #Final torque developed(lb-ft)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Flux increase due to series field , \u03a6_f = %.1f percent' %percentage)\n",
      "print('Case(b): Final torque , T_f = %.f lb-ft' %T_f)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Flux increase due to series field , \u03a6_f = 18.8 percent\n",
        "Case(b): Final torque , T_f = 230 lb-ft\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.15, Page number 115"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "I_a_orig = 25.0    #Original armature current(A)\n",
      "I_a_final = 30.0   #Final armature current(A)\n",
      "T_orig = 90.0      #Original torque developed(lb-ft)\n",
      "phi_orig = 1.0     #Original flux\n",
      "phi_final = 1.1    #Final flux\n",
      "\n",
      "#Calculation\n",
      "T_a = T_orig*(I_a_final/I_a_orig)**2   #Final torque developed if field is unsaturated(lb-ft)\n",
      "T_b = T_orig*(I_a_final/I_a_orig)*(phi_final/phi_orig) #Final torque developed when current rises to 30A and flux increases by 10%\n",
      "\n",
      "#Result\n",
      "print('Case(a): Torque when field is unsaturated , T = %.1f lb-ft' %T_a)\n",
      "print('Case(b): Torque when current rises to 30 A and flux increases by 10 percent , T = %.1f lb-ft' %T_b)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Torque when field is unsaturated , T = 129.6 lb-ft\n",
        "Case(b): Torque when current rises to 30 A and flux increases by 10 percent , T = 118.8 lb-ft\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.16, Page number 119"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V_a = 230.0   #Rated armature voltage(V)\n",
      "P = 10.0      #Rated power(hp)\n",
      "S = 1250.0    #Rated speed(rpm)\n",
      "R_A = 0.25    #Armature resistance(ohm)\n",
      "R_p = 0.25    #Interpole resistance(ohm)\n",
      "BD = 5.0      #Brush voltage drop(V)\n",
      "R_s = 0.15    #Series field resistance(ohm)\n",
      "R_sh = 230.0  #Shunt field resistance(ohm)\n",
      "I_fl = 55.0   #Line current at rated load(A)\n",
      "I_ol = 4.0    #No-load line current(A)\n",
      "S_o = 1810.0  #No-load speed(rpm)\n",
      "\n",
      "#Calculation\n",
      "#Case(a)\n",
      "R_a = R_A+R_p                          #Effective armature resistance(ohm)\n",
      "I_f = V_a/R_sh                         #Field current(A)\n",
      "I_a = I_ol-I_f                         #Armature current at no-load(A)\n",
      "E_c_o = V_a-(I_a*R_a+BD)               #No-load back EMF(V)\n",
      "I_a_fl = I_fl-I_f                      #Armature current at full-load(A)\n",
      "E_c_full_load = V_a-(I_a_fl*R_a+BD)    #Back EMF at full-load(V)\n",
      "S_r = S_o*(E_c_full_load/E_c_o)        #Speed at rated load(rpm)\n",
      "#Case(b)\n",
      "P_d = E_c_full_load*I_a_fl             #Internal power(W)\n",
      "hp = P_d/746.0                         #Internal horse power(hp)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Speed at rated load , S_r = %.f rpm' %S_r)\n",
      "print('Case(b): Internal power in watts , P_d = %.f W' %P_d)\n",
      "print('         Internal horse-power developed , P_d = %.1f hp' %hp)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Speed at rated load , S_r = 1603 rpm\n",
        "Case(b): Internal power in watts , P_d = 10692 W\n",
        "         Internal horse-power developed , P_d = 14.3 hp\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.17, Page number 119"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V_a = 230.0    #Rated armature voltage(V)\n",
      "P = 10.0       #Rated power(hp)\n",
      "S = 1250.0     #Rated speed(rpm)\n",
      "R_A = 0.25     #Armature resistance(ohm)\n",
      "R_p = 0.25     #Interpole resistance(ohm)\n",
      "BD = 5.0       #Brush voltage drop in volt\n",
      "R_s = 0.15     #Series field resistance in ohm\n",
      "R_sh = 230.0   #Shunt field resistance in ohm\n",
      "phi_1 = 1.0    #Original flux per pole\n",
      "I_fl = 55.0    #Line current at rated load(A)\n",
      "phi_2 = 1.25   #Flux increased by 25% due to long-shunt cumulative connection\n",
      "I_ol = 4.0     #No-load line current(A)\n",
      "S_o = 1810.0   #No-load speed(rpm)\n",
      "\n",
      "#Calculation\n",
      "R_a = R_A+R_p                          #Effective armature resistance(ohm)\n",
      "I_f = V_a/R_sh                         #Field current(A)\n",
      "I_a = I_ol-I_f                         #Armature current at no-load(A)\n",
      "E_c_o = V_a-(I_a*R_a+BD)               #No-load back EMF(V)\n",
      "I_a_fl = I_fl-I_f                      #Armature current at full-load(A)\n",
      "#Case(a)\n",
      "E_c_o1 = V_a-(I_a*R_a+I_a*R_s+BD)      #No-load back EMF for long shunt cumulative connection(V)\n",
      "S_n1 = S_o*(E_c_o1/E_c_o)              #Speed at no-load(rpm)\n",
      "#Case(b)\n",
      "E_c_full_load_lsh = V_a-(I_a_fl*R_a+I_a_fl*R_s+BD )       #Back EMF at full-load for long-shunt cumulative motor(V)\n",
      "S_r_lsh = S_n1*(E_c_full_load_lsh/E_c_o1)*(phi_1/phi_2)   #Speed at rated load for long shunt connection(rpm)\n",
      "#Case(c)\n",
      "E_c_full_load = V_a-(I_a_fl*R_a+BD)                       #Back EMF at full-load(V)\n",
      "S_r = S_o*(E_c_full_load/E_c_o)                           #Speed at rated load for shunt connection(rpm)\n",
      "P_d = E_c_full_load*I_a_fl                                #Internal power(W)\n",
      "hp = P_d/746.0                                            #Internal horse power(hp)\n",
      "T_shunt = hp*5252/S_r                                     #Internal torque at full-load for shunt motor(lb-ft)\n",
      "I_a1 = I_a_fl                                             #Armature current for shunt motor(A)\n",
      "I_a2 = I_a_fl                                             #Armature current for long-shunt cumulative motor(A)\n",
      "T_comp = T_shunt*(phi_2/phi_1)*(I_a2/I_a1)                #Internal torque at full load for long-shunt cumulative motor(lb-ft)\n",
      "#Case(d)\n",
      "Horsepower = (E_c_full_load_lsh*I_a_fl)/746               #Internal horsepower of compound motor based on flux increase(hp)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Speed at no-load , S_n1 = %d rpm' %S_n1)\n",
      "print('Case(b): Speed at rated-load , S_r = %d rpm' %S_r_lsh)\n",
      "print('Case(c): Internal torque at full-load with series field , T_comp = %.2f lb-ft' %T_comp)\n",
      "print('         Internal torque at full-load without series field , T_shunt = %.2f lb-ft' %T_shunt)\n",
      "print('Case(d): Internal horsepower of the compound motor , Horsepower = %.1f hp' %Horsepower)\n",
      "print('Case(e): The internal hp exceeds the rated hp because the power developed in the motor must also overcome the internal mechanical rotational losses')\n",
      "print('\\nNOTE: The change in obtained answer from that of textbook is due to more precision i.e more number of decimal places in this case')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Speed at no-load , S_n1 = 1806 rpm\n",
        "Case(b): Speed at rated-load , S_r = 1230 rpm\n",
        "Case(c): Internal torque at full-load with series field , T_comp = 58.68 lb-ft\n",
        "         Internal torque at full-load without series field , T_shunt = 46.94 lb-ft\n",
        "Case(d): Internal horsepower of the compound motor , Horsepower = 13.7 hp\n",
        "Case(e): The internal hp exceeds the rated hp because the power developed in the motor must also overcome the internal mechanical rotational losses\n",
        "\n",
        "NOTE: The change in obtained answer from that of textbook is due to more precision i.e more number of decimal places in this case\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.18, Page number 120"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "P = 25.0      #Power rating of a series motor(hp)\n",
      "V_a = 250.0   #Rated voltage(V)\n",
      "R_a = 0.1     #Armature circuit resistance(ohm)\n",
      "BD = 3.0      #Brush voltage drop(V)\n",
      "R_s = 0.05    #Series field resistance(ohm)\n",
      "I_a = 85.0    #Armature current(A)\n",
      "I_a1 = 100.0  #Armature current(A)(case a)\n",
      "I_a2 = 40.0   #Armature current(A)(case b)\n",
      "S_1 = 600.0   #Speed(rpm)\n",
      "R_d = 0.05    #Diverter resistance(ohm)\n",
      "\n",
      "#Calculation\n",
      "#Case(a)\n",
      "E_c2 = V_a-I_a1*(R_a+R_s)-BD       #Back EMF when Ia = 100 A(V)\n",
      "E_c1 = V_a-I_a*(R_a+R_s)-BD        #Back EMF when Ia = 85 A(V)\n",
      "S_2 = S_1*(E_c2/E_c1)*(I_a/I_a1)   #Speed(rpm)\n",
      "#Case(b)\n",
      "E_c3 = V_a-I_a2*(R_a+R_s)-BD       #Back EMF when Ia = 40 A(V)\n",
      "S_3 = S_1*(E_c3/E_c1)*(I_a/I_a2)   #Speed(rpm)\n",
      "#Case(c)\n",
      "R_sd = (R_s*R_d)/(R_s+R_d )        #Effective series field resistance(ohm)\n",
      "E_c2_new = V_a-I_a1*(R_a+R_sd)-BD  #Back EMF when Ia = 100 A(V)\n",
      "S_2_new = S_1*(E_c2_new/E_c1)*(I_a/(I_a1/2))  #Speed(rpm) \n",
      "E_c3_new = V_a-I_a2*(R_a+R_sd)-BD  #Back EMF when Ia = 40 A(V)\n",
      "S_3_new = S_1*(E_c3_new/E_c1)*(I_a/(I_a2/2))  #Speed(rpm) \n",
      "\n",
      "#Result\n",
      "print('Case(a): Speed when current is 100 A , S_2 = %.f rpm' %S_2)\n",
      "print('Case(b): Speed when current is 40 A , S_3 = %d rpm' %S_3)\n",
      "print('Case(c): Speed when current is 100 A and using a diverter , S_2 = %.f rpm' %S_2_new)\n",
      "print('         Speed when current is 40 A and using a diverter , S_3 = %.f rpm' %S_3_new)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Speed when current is 100 A , S_2 = 505 rpm\n",
        "Case(b): Speed when current is 40 A , S_3 = 1311 rpm\n",
        "Case(c): Speed when current is 100 A and using a diverter , S_2 = 1021 rpm\n",
        "         Speed when current is 40 A and using a diverter , S_3 = 2634 rpm\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.19, Page number 121"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "S_n1 = 1810.0    #No-load speed(rpm) From Ex. 4-16\n",
      "S_f1 = 1603.0    #Full-load speed(rpm)\n",
      "S_n2 = 1806.0    #No-load speed(rpm) From Ex. 4-17\n",
      "S_f2 = 1231.0    #Full-load speed(rpm)\n",
      "S_n3 = 1311.0    #No-load speed(rpm) From Ex. 4-18\n",
      "S_f3 = 505.0     #Full-load speed(rpm)\n",
      "\n",
      "#Calculation\n",
      "SR_1 = (S_n1-S_f1)/S_f1*100   #Speed regulation for shunt motor(%)\n",
      "SR_2 = (S_n2-S_f2)/S_f2*100   #Speed regulation for compound motor(%)\n",
      "SR_3 = (S_n3-S_f3)/S_f3*100   #Speed regulation for series motor(%)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Speed regulation , SR(shunt) = %.1f percent' %SR_1)\n",
      "print('Case(b): Speed regulation , SR(compound) = %.1f percent' %SR_2)\n",
      "print('Case(c): Speed regulation , SR(series) = %.1f percent' %SR_3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Speed regulation , SR(shunt) = 12.9 percent\n",
        "Case(b): Speed regulation , SR(compound) = 46.7 percent\n",
        "Case(c): Speed regulation , SR(series) = 159.6 percent\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.20, Page number 121"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "SR = 0.1                    #Speed regulation of a shunt motor \n",
      "omega_f1 = 60.0*math.pi     #Full-load speed(rad/s)\n",
      "\n",
      "#Calculation\n",
      "omega_n1 = omega_f1*(1+SR)             #No-load speed(rad/s)\n",
      "S = omega_n1*(1/(2*math.pi))*(60.0/1)  #No-load speed(rpm) \n",
      "\n",
      "#Result\n",
      "print('Case(a): No-load speed , \u03c9_n1 = %.f\u03c0 rad/s' %(omega_n1/math.pi))\n",
      "print('Case(b): No-load speed , S = %.f rpm' %S)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): No-load speed , \u03c9_n1 = 66\u03c0 rad/s\n",
        "Case(b): No-load speed , S = 1980 rpm\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.21, Page number 122"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "S_int = 1603.0    #Internal rated speed(rpm)\n",
      "S_ext = 1250.0    #External rated speed(rpm)\n",
      "hp_int = 14.3     #Internal horsepower\n",
      "hp_ext = 10.0     #External horsepower\n",
      "\n",
      "#Calculation\n",
      "T_int = hp_int*5252/S_int   #Internal torque(lb-ft)\n",
      "T_ext = hp_ext*5252/S_ext   #External torque(lb-ft)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Internal torque , T_int = %.2f lb-ft' %T_int)\n",
      "print('Case(b): External torque , T_ext = %.1f lb-ft' %T_ext)\n",
      "print('Case(c): Internal hp developed due electromagnetic torque is used internally to overcome mechanical losses of the motor reducing the torque available at its shaft to perform work')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Internal torque , T_int = 46.85 lb-ft\n",
        "Case(b): External torque , T_ext = 42.0 lb-ft\n",
        "Case(c): Internal hp developed due electromagnetic torque is used internally to overcome mechanical losses of the motor reducing the torque available at its shaft to perform work\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.22, Page number 123"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "P = 50.0    #Power rating of the servo motor(W)\n",
      "S = 3000.0  #Full-load speed of the servo motor(rpm)\n",
      "\n",
      "#Calculation\n",
      "T_lbft = (7.04*P)/S          #Output torque(lb-ft)\n",
      "T_ounceinch = T_lbft*192     #Output torque(ounce-inches)\n",
      "\n",
      "#Result\n",
      "print('Output torque available at the motor pulley , T = %.1f oz-in' %T_ounceinch)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Output torque available at the motor pulley , T = 22.5 oz-in\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.23, Page number 123"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "P = 50.0    #Power rating of the servo motor(W)\n",
      "S = 3000.0  #Full-load speed of the servo motor(rpm)\n",
      "\n",
      "#Calculation\n",
      "S_rad_per_sec = S*2*math.pi/60         #Full-load speed of the servo motor(rad/s)\n",
      "omega = 314.2                          #Angular frequency(rad/s)\n",
      "T_Nm = P/omega                         #Output torque(N-m)\n",
      "T_ounceinch = T_Nm*1/(7.0612*10**-3)   #Output torque(oz-in)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Motor speed in radians per second = %.1f rad/s' %S_rad_per_sec)\n",
      "print('Case(b): Output torque in newton-meters , T = %.4f N-m' %T_Nm)\n",
      "print('Case(c): Output torque in ounce-inches , T = %.1f oz-in' %T_ounceinch)\n",
      "print('Case(d): Both answers are the same')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Motor speed in radians per second = 314.2 rad/s\n",
        "Case(b): Output torque in newton-meters , T = 0.1591 N-m\n",
        "Case(c): Output torque in ounce-inches , T = 22.5 oz-in\n",
        "Case(d): Both answers are the same\n"
       ]
      }
     ],
     "prompt_number": 1
    }
   ],
   "metadata": {}
  }
 ]
}