{
 "metadata": {
  "name": "",
  "signature": "sha256:f03a268884ccacb4d0b4a4e0ccceeba1a58caa51f0cbd85024ffaf9d558c0182"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 2 : D.C. Motors"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.1 page no : 5"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "# Variables\n",
      "V = 220.\n",
      "I_a = 30. \t\t\t#armature currnet\n",
      "R_a = 0.75 \t\t\t#Armature resistance\n",
      "\n",
      "# Calculations\n",
      "E_b = V - I_a*R_a   \t\t\t# Since V =  E_b+ I_a*R_a\n",
      "\n",
      "\n",
      "# Results\n",
      "print 'Induced EMF or back EMF in the motor is %.1f V'%(E_b)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Induced EMF or back EMF in the motor is 197.5 V\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2 page no : 6"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "Pole = 4.\n",
      "A = Pole \t\t\t#for lap winding\n",
      "V = 230.\n",
      "Z = 250. \t\t\t#number of armature conductors\n",
      "phi = 30.*10**-3 \t\t\t#flux per pole in weber\n",
      "I_a = 40.\n",
      "R_a = 0.6 \t\t\t#Armature resistance\n",
      "\n",
      "# Calculations \n",
      "E_b = V - I_a*R_a   \t\t\t# Since V =  E_b+ I_a*R_a\n",
      "N = E_b * 60*A/(phi*Pole*Z)   \t\t\t#because E_b  =  phi*P*N*Z/(60*A)\n",
      "\n",
      "# Results\n",
      "print 'Back emf is %.0f V and running speed is %.0f rpm'%(E_b,N)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Back emf is 206 V and running speed is 1648 rpm\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.3 page no : 9"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "Pole = 4.\n",
      "A = Pole \t\t\t#for lap winding\n",
      "Z = 480.\t\t\t#number of armature conductors\n",
      "phi = 20.*10**-3 \t\t\t#flux per pole in weber\n",
      "I_a = 50. \t\t\t#Armature current\n",
      "\n",
      "# Calculations\n",
      "T_a  =  0.159*phi*I_a*Pole*Z/A  \t\t\t#Gross torque developed by armature\n",
      "\n",
      "# Results\n",
      "print 'Gross torque developed by armature is %.3f N-m'%(T_a)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Gross torque developed by armature is 76.320 N-m\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.4 page no : 10"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "Pole = 4.\n",
      "A = Pole \t\t\t#for lap winding\n",
      "V = 230.\n",
      "R_a = 0.8 \t\t\t#Armature resistance\n",
      "N_0 = 1000. \t\t\t#no load speed in rpm\n",
      "Z = 540. \t\t\t#number of armature conductors\n",
      "phi = 25.*10**-3 \t\t\t#flux per pole in weber\n",
      "\n",
      "# Calculations and Results\n",
      "E_b0  =  phi*Pole*N_0*Z/(60*A)  \t\t\t#induced emf\n",
      "\n",
      "#part(i)\n",
      "print 'i)Induced e.m.f  =  %.0f V'%(E_b0)\n",
      "\n",
      "#part(ii)\n",
      "I_a0  =  (V- E_b0)/R_a  \t\t\t#because V =  E_b0+ I_a0*R_a\n",
      "print 'ii)Armature current  =  %.2f A'%(I_a0)\n",
      "\n",
      "#part(iii)\n",
      "stray_losses  =  E_b0*I_a0  \t\t\t#on no load ,power developed is fully power required to overcome strya losses\n",
      "print 'iii)Stray loss  =  %.2f W'%(stray_losses)\n",
      "\n",
      "#part(iv)\n",
      "T_f  =  E_b0*I_a0/(2*math.pi*N_0/60)  \t\t\t#lost torque\n",
      "print 'iv)Lost torque  =  %.3f N-m'%(T_f)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "i)Induced e.m.f  =  225 V\n",
        "ii)Armature current  =  6.25 A\n",
        "iii)Stray loss  =  1406.25 W\n",
        "iv)Lost torque  =  13.429 N-m\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.5 page no : 21"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "Pole = 4.\n",
      "Z = 200. \t\t\t    #No of armature conductors\n",
      "A = 2.   \t\t\t    #wave connected armature\n",
      "V = 250.\n",
      "phi = 25.*10**-3 \t\t\t#flux per pole in weber\n",
      "I_a  = 60.\n",
      "I_L  = I_a  \t    \t\t#armature current\n",
      "R_a = 0.15\n",
      "R_se = 0.2       \t\t\t#resistances of armature and series field winding\n",
      "\n",
      "# Calculations\n",
      "E_b =  V - I_a*(R_a+R_se)  \t\t\t#induced emf\n",
      "N = E_b * 60*A/(phi*Pole*Z)   \t\t\t#because E_b  =  phi*P*N*Z/(60*A)\n",
      "\n",
      "# Results\n",
      "print 'Required speed is %.0f r.p.m'%(N)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Required speed is 1374 r.p.m\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.6 page no : 22"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "V = 250.\n",
      "I_L  = 20. \t\t\t#load current\n",
      "R_a = 0.3\n",
      "R_sh = 200. \t\t\t#Armature and shunt field winding\n",
      "\n",
      "# Calculations\n",
      "I_sh = V/R_sh \t\t\t#shunt current\n",
      "I_a = I_L-I_sh \t\t\t#armature current\n",
      "E_b =  V - I_a*R_a \t\t\t#emf generated\n",
      "\n",
      "# Results\n",
      "print 'Armature current is %.2f A'%(I_a)\n",
      "print 'Back e.m.f is %.3f V'%(E_b)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Armature current is 18.75 A\n",
        "Back e.m.f is 244.375 V\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.7 page no : 22"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "V = 220.\n",
      "R_a = 0.3\n",
      "R_sh = 110. \t\t\t#resistance of armature and shunt field winding\n",
      "\n",
      "#no load\n",
      "N_0 = 1000. \t\t\t#no load speed in r.p.m\n",
      "I_L0  = 6. \t\t\t#line current on no load\n",
      "I_sh =  V/R_sh \t\t\t#no load shnt current\n",
      "I_a0  =  I_L0 - I_sh \t\t\t#no load armature current\n",
      "E_b0 =  V - I_a0*R_a \t\t\t#no load induced emf\n",
      "\n",
      "# Calculations\n",
      "#full load\n",
      "I_sh_FL =  V/R_sh\n",
      "I_L_FL = 50 \t\t\t#line current at full load\n",
      "I_a_FL =  I_L_FL - I_sh_FL\t\t\t#full load armature current\n",
      "E_b_FL =  V - I_a_FL * R_a \t\t\t#full load induced emf\n",
      "\t\t\t#using speed equation as treating phi as constant\n",
      "N_FL = N_0 * (E_b_FL/E_b0)\n",
      "\n",
      "# Results\n",
      "print 'Speed on full load is %.2f r.p.m'%(N_FL)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed on full load is 939.67 r.p.m\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.8 page no : 23"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "R_a = 0.2\n",
      "R_se  = 0.3 \t\t\t#resistance of armature and series field winding\n",
      "#following variables correspond to load 1\n",
      "V = 250.\n",
      "N_1 = 800.\n",
      "I_1 = 20.\n",
      "I_a1 = I_1\n",
      "I_se1 =  I_a1\n",
      "\n",
      "# Calculations\n",
      "E_b1 =  V - I_a1*(R_a+R_se)\n",
      "#following variables correspond to load 2\n",
      "I_2 = 50.\n",
      "I_a2 = I_2\n",
      "E_b2 =  V - I_a2*(R_a+R_se)\n",
      "\n",
      "#from speed equation it can be derived that\n",
      "\n",
      "N_2  =  N_1 * (E_b2/E_b1) * (I_a1/I_a2)\n",
      "\n",
      "# Results\n",
      "print 'Speed on motor on no load  is %.0f r.p.m'%(N_2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed on motor on no load  is 300 r.p.m\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.9 page no : 31"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "V = 250.\n",
      "R_a = 0.3\n",
      "R_sh = 200.  \t\t\t#resistance of armature and shunt field winding\n",
      "R_x = 150. \t\t\t#additional resistance added in series to field winding\n",
      "I_L1 = 22.\n",
      "I_sh1 = V/R_sh \t\t\t#initial shunt current before adding 150 ohms resistance\n",
      "I_a1  =  I_L1 - I_sh1 \t\t\t#initial armature current before adding 150 ohms resistance\n",
      "N_1 = 1500. \t\t\t#initial speed before adding 150 ohms resistance\n",
      "\n",
      "# Calculations\n",
      "#T (prop.) phi*I_a (prop.) I_sh*I_a and T_1 = T_2 and simplifying further \n",
      "I_sh2 = V/(R_sh + R_x) \t\t\t#new shunt current\n",
      "I_a2 =  I_sh1*I_a1/I_sh2  \t\t\t#New armature current\n",
      "\n",
      "E_b1 = V - I_a1*R_a   \t\t\t#induced emf before adding 150 ohms resistance\n",
      "E_b2 = V - I_a2*R_a   \t\t\t#new emf\n",
      "\n",
      "N_2  =  N_1 * (E_b2/E_b1) * (I_sh1/I_sh2) \t\t\t#new speed\n",
      "\n",
      "# Results\n",
      "print 'New armature current and speed are %.4f A and %.f r.p.m respectively'%(I_a2,N_2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "New armature current and speed are 36.3125 A and 2575 r.p.m respectively\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.10 page no : 36"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "V = 250.\n",
      "R_a = 0.15\n",
      "R_se = 0.1\n",
      "R_x = 0.1 \t\t\t#Resimath.tance of armature , series field winding and extra resistance\n",
      "N_1  =  800. \t\t\t#initial speed before load torque is increased\n",
      "I_1 =  30.\n",
      "I_a1 = I_1\n",
      "I_se1  =  I_1  \t\t\t#initial currents\n",
      "\n",
      "# Calculations\n",
      "T_2_by_T_1  =  1 + (50./100)  \t\t\t#50 percent increase as mentioned in question\n",
      "I_se2_by_I_a2  =  R_x/(R_x + R_se)  \t\t\t#from the figure\n",
      "\n",
      "#T (prop.) phi*I_a (prop.) I_sh*I_a and T_1 = T_2 and simplifying ,solving further \n",
      "I_a2 = math.sqrt(I_a1*I_se1*T_2_by_T_1/I_se2_by_I_a2) \t\t\t#new armature current\n",
      "I_se2  =  I_se2_by_I_a2 *I_a2 \t\t\t#new series field current\n",
      "\n",
      "E_b1  =  V - I_a1*R_a - I_se1*R_se \t\t\t#indiced emf initially\n",
      "E_b2  =  V - I_a2*R_a - I_se2*R_se \t\t\t#new induced emf\n",
      "N_2  =  N_1 * (E_b2/E_b1) * (I_se1/I_se2) \t\t\t#required speed\n",
      "\n",
      "# Results\n",
      "print 'The required running speed of motor is %.3f r.p.m'%(N_2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The required running speed of motor is 912.743 r.p.m\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.11 page no : 38"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "V = 220.\n",
      "I_1 = 50.\n",
      "I_a1 = I_1  \t\t\t#Currents before adding extra resistance\n",
      "T_2_by_T_1  = 0.5\n",
      "R_t = 0.15 \t\t\t#R_e + R_se  = 0.15\n",
      "\n",
      "# Calculations\n",
      "I_a2  = I_a1 * math.sqrt(T_2_by_T_1)  \t\t\t#Because T (prop.) I_a**2\n",
      "E_b1 = V-I_a1*(R_t) \t\t\t#induced emf before adding extra resistance\n",
      "N_1 = 500.\n",
      "N_2 = 300. \t\t\t#speeds before and adding extra resistance\n",
      "\n",
      "#N (prop.) E_b/phi (prop.) E_b/I_a\n",
      "E_b2 = E_b1 *(I_a2/I_a1)*(N_2/N_1) \t\t\t#induced emf after adding resistance\n",
      "R_x =  (V-E_b2)/I_a2 -R_t \t\t\t#because E_b2 = V - I_a2*(R_a + R_se + R_x)\n",
      "\n",
      "# Results\n",
      "print 'Desired extrea resistance =  %.4f ohms '%(R_x)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Desired extrea resistance =  3.5225 ohms \n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.12 page no : 43"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "R_a =  1.\n",
      "I_a = 1.2 \n",
      "V = 50.\n",
      "\n",
      "# Calculations and Results\n",
      "#part(i)\n",
      "E_b  =  V - I_a*R_a\n",
      "rot_loss_NL  = E_b*I_a \t\t\t#no load rotational loss \n",
      "print 'i)No load rotational losses  =  %.2f W'%(rot_loss_NL)\n",
      "\n",
      "#part(ii)\n",
      "omega_2000 = 2*math.pi*2000/60 \t\t\t#angular velocity when speed of motor  = 2000 rpm\n",
      "K_m = E_b/omega_2000   \t\t\t#to determine K_m\n",
      "V = 48.\n",
      "omega_1800 = 2*math.pi*1800/60 \t\t\t#angular velocity when speed of motor  = 1800 rpm\n",
      "E_b = K_m*omega_1800\n",
      "I_a  =  (V-E_b)/R_a  \t\t\t#armature current\n",
      "P_dev  =  E_b*I_a\t\t\t#power developed\n",
      "motor_output  =   P_dev - rot_loss_NL\n",
      "print 'ii)Motor output  =  %.f W'%(motor_output)\n",
      "\n",
      "#part(iii)\n",
      "E_b = 0. \t\t\t#when motor stalls\n",
      "V_stall = 20. \t\t\t#voltage during stalling\n",
      "I_a = V_stall/R_a \t\t\t#armature current during stalling\n",
      "T_stall  =  K_m*I_a \t\t\t#stalling torque\n",
      "print 'iii)Stalling torque  =  %.2f N-m'%(T_stall)\n",
      "print 'partii answer is slightly different due to inaccurate calculation of Power developed'\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "i)No load rotational losses  =  58.56 W\n",
        "ii)Motor output  =  121 W\n",
        "iii)Stalling torque  =  4.66 N-m\n",
        "partii answer is slightly different due to inaccurate calculation of Power developed\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.13 page no : 49"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "V = 120.\n",
      "R_a = 0.2 \n",
      "R_sh = 60. \t\t\t#armature and field resistance\n",
      "I_L1 = 40.\n",
      "N_1 = 1800. \n",
      "\n",
      "# Calculations\n",
      "I_sh =  V/R_sh\n",
      "\n",
      "I_a1 = I_L1 - I_sh \n",
      "E_b1  =  V -I_a1*R_a  \t\t\t#Induced emf at half load\n",
      "T2_by_T1  = 1./2 \n",
      "I_a2 = I_a1*(T2_by_T1)   \t\t\t#T (prop.)I_a\n",
      "E_b2 = V- I_a2*R_a\t\t\t#induced emf at half load\n",
      "N_2  =  N_1 *(E_b2/E_b1)  \t\t\t#N (prop.) E_b as phi is constant\n",
      "\n",
      "# Results\n",
      "print 'Speed on half load condition is %.2f r.p.m'%(N_2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed on half load condition is 1860.85 r.p.m\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.14 page no : 50"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "R_a = 0.08\n",
      "E_b1 = 242. \n",
      "V = 250.\n",
      "\n",
      "# Calculations and Results\n",
      "#part(i)\n",
      "I_a1 =  (V-E_b1)/R_a\n",
      "print 'i)Armature current  =  %.0f A'%(I_a1)\n",
      "\n",
      "#part(ii)\n",
      "N = 0.\n",
      "E_b = 0. \t\t\t#because N = 0\n",
      "I_a_start = V/R_a\n",
      "print 'ii)Starting armature current  =  %.0f A'%(I_a_start)\n",
      "\n",
      "#part(iii)\n",
      "I_a2 = 120.\n",
      "E_b2 = V-I_a2*R_a\n",
      "print 'iii)Back emf if armature current is changed to 120 A =    %.1f V'%(E_b2)\n",
      "\n",
      "#part(iv)\n",
      "I_a = 87.\n",
      "N_m = 1500.\n",
      "E_g = V + I_a*R_a \t\t\t#induced emf\n",
      "N_g = N_m*(E_g/E_b1)\t\t\t#as E (prop.) N\n",
      "print 'iv)Generator speed to deliver 87 A at 250 V  =  %.1f rpm'%(N_g)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "i)Armature current  =  100 A\n",
        "ii)Starting armature current  =  3125 A\n",
        "iii)Back emf if armature current is changed to 120 A =    240.4 V\n",
        "iv)Generator speed to deliver 87 A at 250 V  =  1592.7 rpm\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.15 page no : 51"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "from numpy import roots\n",
      "\n",
      "# Variables\n",
      "shaft_output  =  80.*746 \t\t\t#coverted to watts\n",
      "eta =  80./100           \t\t\t#efficiency\n",
      "V = 250.\n",
      "N_1 = 1200.\n",
      "R_a = 0.04\n",
      "R_sh  =  250. \t\t\t            #armature and shunt field resistance\n",
      "\n",
      "# Calculations and Results\n",
      "power_input  =  shaft_output/eta\n",
      "I_L =  power_input /V\n",
      "I_sh =  V / R_sh\n",
      "I_a  =  I_L - I_sh\n",
      "E_b1  =  V - I_a*R_a\n",
      "\n",
      "gross_mechanical_power =  E_b1*I_a \t\t\t#electrical equivalent of mechanical power developed\n",
      "stray_losses  =   gross_mechanical_power - shaft_output\n",
      "print 'Mechanical power developed on full load  =  %.3f kW'%(gross_mechanical_power/1000)\n",
      "\n",
      "#on no load shaft_output = 0 and entire gross power is used to overcome stray losses\n",
      "Eb0_Ia0 =  stray_losses\n",
      "#E_b0  =  V - I_a0*R_a  ... solving for I_0\n",
      "p = [R_a, -V, Eb0_Ia0]\n",
      "ans = roots(p)\n",
      "I_a0 = ans[1] \t\t\t#first root is ignored math.since its too large\n",
      "I_L0  = I_sh+I_a0 \t\t\t#current drawn from supply\n",
      "E_b0  =  V - I_a0*R_a \n",
      "\n",
      "#From speed equation N (prop.) E_b\n",
      "N_0  =  N_1*(E_b0/E_b1)\n",
      "print 'No load speed and current are %.4f rpm and %.2f A respectively'%(N_0,I_L0)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Mechanical power developed on full load  =  70.812 kW\n",
        "No load speed and current are 1250.9121 rpm and 45.85 A respectively\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.16 page no : 53"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "V = 250.\n",
      "P = 4. \n",
      "R_a = 0.1 \n",
      "R_sh  = 124. \t\t\t#armature and shunt field resistance \n",
      "I_L0 = 4.\n",
      "N_0 = 1200.\n",
      "I_L_1 = 61.\n",
      "\n",
      "# Calculations\n",
      "I_sh = V/R_sh\n",
      "I_a0 = I_L0-I_sh\n",
      "V_brush =  2 \t\t\t#voltage loss due to brush\n",
      "E_b0 =  V - I_a0*R_a- V_brush\n",
      "\n",
      "I_a1 = I_L_1 - I_sh\n",
      "E_b1 = V - I_a1*R_a -V_brush\n",
      "\n",
      "phi1_by_phi0 = 1-(5./100)   \t\t\t#weakened by 5 %\n",
      "N_1  =  N_0 *(E_b1/E_b0) /phi1_by_phi0\n",
      "\n",
      "# Results\n",
      "print 'Full load speed is %.3f r.p.m'%(N_1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Full load speed is 1234.102 r.p.m\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.17 page no : 54"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "V = 250.\n",
      "R_a = 0.15 \n",
      "R_sh = 167.67 \t\t\t#armature and shunt field resistance\n",
      "N_0 = 1280. \t\t\t#speed at no load\n",
      "\n",
      "#full load\n",
      "I_L1  =  67.  \t\t\t#current drawn on full load\n",
      "I_sh  =  V / R_sh  \t\t\t#as shunt motor\n",
      "I_a1 =  I_L1- I_sh\n",
      "E_b1 =  V - I_a1*R_a\n",
      "\n",
      "#on no load\n",
      "I_L0 = 6.5\n",
      "I_a0  =  I_L0 - I_sh\n",
      "E_b0  =  V - I_a0*R_a\n",
      "\n",
      "# Calculations and Results\n",
      "#part(i) USING SPEED EQUATION\n",
      "#N (prop.) E_b/phi (prop.)E_b   \t\t\t#as phi is constant\n",
      "N_1  =  N_0 * (E_b1 / E_b0)\n",
      "print 'i)Full load speed  =  %.3f r.p.m'%(N_1)\n",
      "\n",
      "#part(ii)\n",
      "speed_regulation  =  100* ((N_0-N_1)/N_1)\n",
      "#N_1 is full load speed and N_0 = No load speed  \n",
      "print 'ii)Speed regulation  =  %.2f percent '%(speed_regulation )\n",
      "\n",
      "#part(iii)\n",
      "shaft_output_FL  =  E_b1*I_a1 - E_b0*I_a0  \t\t\t#full load power developed - stray losses\n",
      "hp_rating  =  shaft_output_FL /746\n",
      "print 'iii)HP rating of machine  =  %.2f h.p'%(hp_rating)\n",
      "\n",
      "#part(iv)\n",
      "power_input =  V*I_L1\n",
      "eta =  100*(shaft_output_FL/power_input)  \t\t\t#full load efficiency\n",
      "print 'iv)Full load efficiency  =  %.2f percent'%(eta)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "i)Full load speed  =  1233.396 r.p.m\n",
        "ii)Speed regulation  =  3.78 percent \n",
        "iii)HP rating of machine  =  19.42 h.p\n",
        "iv)Full load efficiency  =  86.48 percent\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.18 page no : 55"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "V = 200.\n",
      "R_a = 0.5\n",
      "R_se = 0.2\n",
      "R_x = 0.2 \t\t\t#armature and series field resistance; extra resistance\n",
      "I_a1 = 20.\n",
      "I_1 = I_a1 \n",
      "I_se1 = I_a1\n",
      "I_a2 = 20.\n",
      "I_2 = I_a2\n",
      "I_se2 =  I_2 *(R_x/(R_se+R_x))\n",
      "\n",
      "# Calculations\n",
      "E_b1  =  V -I_a1*R_a - I_a1*R_se\n",
      "E_b2  =  V -I_a2*R_a - I_se2*R_se\n",
      "\n",
      "phi2_by_phi1 = 70./100\n",
      "N_1 = 1000\n",
      "N_2 = N_1*(E_b2/E_b1)  /phi2_by_phi1        \t\t\t#N (prop.) E_b/phi\n",
      "\n",
      "# Results\n",
      "print 'Required speed is %.2f r.p.m'%(N_2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Required speed is 1443.93 r.p.m\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.19 page no : 57"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "V = 110.\n",
      "P = 4.\n",
      "R_a  =  0.1\n",
      "R = 0.01  \t\t\t#A resistance of 0.01 ohms\n",
      "R_se = R+R\n",
      "\n",
      "# Calculations\n",
      "#case(i)\n",
      "I_1 = 50.\n",
      "I_a1 = I_1\n",
      "N_1 = 700.\n",
      "E_b1  =  V -I_a1*(R_a + R_se)\n",
      "\n",
      "#T (prop) phi*I_a   from torque equation                                     (1)\n",
      "\n",
      "#phi_1 (prop.) I_a1                                                           (2)\n",
      "#case(ii) when I_a2 gets divided to half\n",
      "#phi_2 (prop.) I_a2/2                                                         (3)\n",
      "\n",
      "#combining (1)(2)(3) and T1 = T2\n",
      "I_a2  =  math.sqrt(2*I_a1**2)\n",
      "R_se_eqvt = (R*R)/(R+R)   \t\t\t#Equavalent of parallel combination\n",
      "E_b2  =  V - I_a2*R_a - I_a2* R_se_eqvt\n",
      "\n",
      "#using speed equation N (prop.) E_b / phi  and using (2) and (3)\n",
      "N_2  =  N_1 *( E_b2/E_b1) *(I_a1/(I_a2/2))\n",
      "\n",
      "# Results\n",
      "print 'Speed after reconnection  =  %.3f r.p.m'%(N_2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed after reconnection  =  976.389 r.p.m\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.20 page no : 58"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "P = 4.\n",
      "I_a1 =  50.\n",
      "N_1 = 2000.\n",
      "V = 230.\n",
      "\n",
      "\n",
      "# Calculations and Results\n",
      "#phi_1 is proportioanl to total ampere-turns produced by field coils\n",
      "#phi_1 (prop.) I_a1*P*n (prop.) 200*n                                         (1)\n",
      "\n",
      "#After reconnection ,phi_2 proportional to ampere turns divided as follows\n",
      "#phi_2 (prop.) [I_a2/2*2*n + I_a2/2*2*n]  (prop.) 2*n*I_a2                    (2)\n",
      "\n",
      "# Dividing (1) and (2) ,(phi_1/phi_2) = 100 / I_a2                             (3)\n",
      "\n",
      "#T (prop.) phi*I_a AND T (prop.) N**2                                          (4)(5)\n",
      "#therefore N**2 (prop.) phi*I_a                                                (6)\n",
      "\n",
      "#N (prop.) E_b/phi (prop.) 1/phi   ..\n",
      "#Because drops across windings can be neglected , E_b1 = E_b2\n",
      "#therefore N (prop.) 1/phi                                                    (7)\n",
      "\n",
      "#using (7) and (6) phi**3 (prop.) 1/I_a                                        (8)\n",
      "\n",
      "#combining (3) and (8)\n",
      "I_a2  =   (50.*100**3)**(1./4)    \t\t\t#new armature current\n",
      "print 'New armature current =  %.3f A'%(I_a2)\n",
      "#combining (6) and (7)   N**3 (prop.) I_a1\n",
      "N_2 = N_1 *(I_a2/I_a1)**(1./3)\n",
      "print 'New motor speed  = %.3f r.p.m'%(N_2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "New armature current =  84.090 A\n",
        "New motor speed  = 2378.414 r.p.m\n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      " Example 2.22 page no : 61"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "V = 200.\n",
      "I_a1 = 30.\n",
      "R_t = 1.5  \t\t\t#R_a + R_se\n",
      "E_b1 =  V - I_a1*R_t\n",
      "N2_by_N1 = (60./100)\n",
      "\n",
      "# Calculations\n",
      "#T (prop.) I_a**2  and T (prop.) N_3....therefore I_a**2 (prop.) N**3\n",
      "I_a2   =  I_a1*math.sqrt(N2_by_N1**3)\n",
      "\n",
      "#N (prop.) E_b/I_a\n",
      "N2_by_N1\n",
      "E_b2  =  E_b1 *(I_a2/I_a1)*N2_by_N1\n",
      "R_x =  (V- E_b2)/I_a2 - R_t        \t\t\t#because E_b2 =  V - I_a2*(R_x+R_t)\n",
      "\n",
      "# Results\n",
      "print 'Additional resistance to be added in series with motor circuit  =  %.3f ohms'%(R_x)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Additional resistance to be added in series with motor circuit  =  9.744 ohms\n"
       ]
      }
     ],
     "prompt_number": 25
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.23 page no : 63"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "from numpy import array,roots\n",
      "\n",
      "# Variables\n",
      "V = 250.\n",
      "R_a = 0.4 \n",
      "R_sh = 100. \t\t\t#armature and shunt field resistance\n",
      "I_sh1 = V / R_sh\n",
      "P_out_FL  =  10 * 735.5\n",
      "eta = 85./100 \t\t\t#efficiency\n",
      "P_in =  P_out_FL/eta\n",
      "I_L1 =  P_in /V\n",
      "I_a1 =  I_L1 - I_sh1\n",
      "\n",
      "# T (prop.) phi*I_a (prop.) I_sh*I_a    because phi (prop.) I_sh\n",
      "#Bu torque is constant.. \n",
      "Ia2_Ish2 =  I_a1*I_sh1\n",
      "E_b1 =  V - I_a1*R_a\n",
      "\n",
      "#N (prop.) E_b/I_sh\n",
      "#put E_b2 =  V - I_a2*R_a  and solving further for I_sh2 we get ,I_sh2**2 - 1.8824 I_sh2 +0.2417 = 0\n",
      "p = array([1, -1.8824, 0.2417])\n",
      "ans = roots(p) \n",
      "I_sh2 = ans[0]\n",
      "#root 1 was considered because its always easier to attain root(1) because less resistacne is needeed\n",
      "#R_x in series with field\n",
      "R_x  =  (V/I_sh2) -R_sh   \t\t\t#because I_sh2  =  V/(R_sh + R_x)\n",
      "print 'Extra resistance to be added   =  %.2f ohms'%(R_x)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Extra resistance to be added   =  43.37 ohms\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.24 page no : 64"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "R_t = 1. \t\t\t#R_t  =  R_se + R_a\n",
      "V_1 =  230.\n",
      "N_1 = 300.\n",
      "N_2 = 375.\n",
      "I_1 = 15.\n",
      "I_a1 = I_1\n",
      "\n",
      "# Calculations\n",
      "#T (prop.) I_a**2  and T (prop.) N_2....therefore I_a**2 (prop.) N**2\n",
      "I_a2 = I_a1 *(N_2/N_1)\n",
      "E_b1  =  V_1 - I_a1*(R_t)\n",
      "\n",
      "#N (prop.) E_b/I_a\n",
      "E_b2 =  E_b1*(I_a2/I_a1)*(N_2/N_1)\n",
      "V_2 = E_b2 + I_a2* (R_t)  \t\t\t#because E_b2  =  V_2 - I_a2*(R_a+R_se)\n",
      "\n",
      "# Results\n",
      "print 'Voltage supply needed  =  %.4f V'%(V_2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Voltage supply needed  =  354.6875 V\n"
       ]
      }
     ],
     "prompt_number": 27
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.25 page no : 66"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "I_L1 = 30.\n",
      "V = 230.\n",
      "R_sh = 230.\n",
      "R_a = 1.\n",
      "I_sh =  V / R_sh\n",
      "I_a1 =  I_L1 - I_sh\n",
      "E_b1  =  V - I_a1*R_a\n",
      "\n",
      "# Calculations\n",
      "#T (prop.) phi*I_a (prop.) I_a   as phi is constant\n",
      "#and torque is constant\n",
      "I_a2  =  I_a1\n",
      "N2_by_N1 =  1./2\n",
      "#N (prop.) E_b/phi (prop.) E_b\n",
      "E_b2 =  E_b1 *(N2_by_N1)\n",
      "R_x =  (V- E_b2)/I_a2 - R_a     \t\t\t#Because E_b2  =  V - I_a2*(R_a + R_x)\n",
      "\n",
      "# Results\n",
      "print 'resistance to be inserted in series  =  %.4f ohms '%(R_x)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "resistance to be inserted in series  =  3.4655 ohms \n"
       ]
      }
     ],
     "prompt_number": 28
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.26 page no : 67"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "# Variables\n",
      "T_1 = 40.  \t\t\t#initial torque\n",
      "#phi_1 is initial flux\n",
      "#phi_2 is new flux\n",
      "#T_2 is new torque\n",
      "#I_a1 is initial current\n",
      "#I_a2 is new current\n",
      "phi2_by_phi1  =  1- (30./100)  \t\t\t#decrease by 30 percent\n",
      "Ia2_by_Ia1 = 1+(15./100)       \t\t\t#increase by 15 percent\n",
      "\n",
      "# Calculations\n",
      "#T (prop.)phi*I_a\n",
      "T_2 = T_1*(phi2_by_phi1)*(Ia2_by_Ia1)\n",
      "\n",
      "# Results\n",
      "print 'New torque is %.1f N-m'%(T_2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "New torque is 32.2 N-m\n"
       ]
      }
     ],
     "prompt_number": 29
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.27 page no : 67"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "# Variables\n",
      "V = 230.\n",
      "N_1 = 1000.\n",
      "N_2 = 950.\n",
      "R_a = 0.5\n",
      "R_sh = 230. \t\t\t#armature and shunt field resistance\n",
      "I_L1 = 10.\n",
      "\n",
      "# Calculations\n",
      "I_sh  =  V/R_sh\n",
      "I_a1  =  I_L1 - I_sh\n",
      "\n",
      "#T (prop.) phi*I_a  (prop.) I_a with phi constant and T is constant due to full-load\n",
      "I_a2 = I_a1\n",
      "\n",
      "E_b1  =  V - I_a1*R_a\n",
      "E_b2 = E_b1*(N_2/N_1) \t\t\t#N (prop.) E_b /phi (prop.) E_b   as phi is constant\n",
      "\n",
      "R_x  =  (V-E_b2)/I_a2  -R_a      \n",
      "\n",
      "# Results\n",
      "print 'resistance to be inserted in series with armature  =  %.4f ohms'%(R_x)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "resistance to be inserted in series with armature  =  1.2528 ohms\n"
       ]
      }
     ],
     "prompt_number": 30
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.28 page no : 68"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "V = 250.\n",
      "N_0 = 1000.\n",
      "I_0 = 5.\n",
      "R_a = 0.2\n",
      "R_sh = 250. \t\t\t#armature and shunt field resistance\n",
      "I_L = 50. \t\t\t#on no load\n",
      "I_sh = V / R_sh\n",
      "I_a0  =  I_0 - I_sh\n",
      "I_a   =  I_L - I_sh\n",
      "E_b0  =  V- I_a0*R_a\n",
      "E_b1  =  V- I_a *R_a\n",
      "\n",
      "# Calculations\n",
      "phi1_by_phi0  = 1-(3./100) \t\t\t#weakens by 3 percent\n",
      "#N (prop.) E_b/phi\n",
      "N_1  =  N_0 *(E_b1/E_b0) /phi1_by_phi0\n",
      "\n",
      "# Results\n",
      "print 'Speed when loaded and drawing 50A current is %.3f r.p.m'%(N_1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed when loaded and drawing 50A current is 993.695 r.p.m\n"
       ]
      }
     ],
     "prompt_number": 31
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.29 page no : 69"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "V = 230.\n",
      "I_a0 = 3.3\n",
      "R_a = 0.3\n",
      "R_sh = 160. \t\t\t#armature and shunt field resistance \n",
      "I_L1 = 40.\n",
      "N_0 = 1000.\n",
      "E_b0  =  V - I_a0*R_a\n",
      "I_sh = V/ R_sh\n",
      "I_a1  =  I_L1 - I_sh\n",
      "E_b1  =  V - I_a1*R_a\n",
      "phi1_by_phi0 =  1- (4./100) \t\t\t#weakening by 4 percent \n",
      "\n",
      "# Calculations and Results\n",
      "N_1  =  N_0 *(E_b1/E_b0)/(phi1_by_phi0)  \t\t\t#because N (prop.) E_b/phi\n",
      "print 'Full load speed is %.4f rpm'%(N_1)\n",
      "T_0  =  E_b0*I_a0/(2*math.pi*N_0/60)\n",
      "T_1  =  T_0*(I_a1/I_a0)*phi1_by_phi0   \t\t\t# because T (prop.) phi*I_a\n",
      "print 'Full load developed torque is %.4f N-m'%(T_1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Full load speed is 993.5485 rpm\n",
        "Full load developed torque is 80.9585 N-m\n"
       ]
      }
     ],
     "prompt_number": 32
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.30 page no : 70"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "V = 220.\n",
      "I_L = 52.\n",
      "N_1 = 750.\n",
      "N_2 = 600.\n",
      "R_a = 0.2\n",
      "R_sh  =  110. \t\t\t#armature and shunt field resistance\n",
      "\n",
      "# Calculations and Results\n",
      "I_sh = V/ R_sh\n",
      "I_a1 =  I_L - I_sh\n",
      "I_a2 = I_a1\t\t\t#T (prop.) I_a  and T is constant\n",
      "E_b1  =  V - I_a1*R_a\n",
      "\n",
      "#N (prop.) E_b/phi (prop.) E_b\n",
      "E_b2  =  E_b1*(N_2/N_1)\n",
      "R_x   =  (V- E_b2)/I_a2 -R_a  \t\t\t#Because E_b2  =  V - I_a2*(R_a+R_x)\n",
      "print 'resistance to be connected in series  =  %.2f ohms'%(R_x)\n",
      "\n",
      "#After R_x gets connected in series with armature and 110 ohms in series with field winding\n",
      "N_1 = 600.\n",
      "I_sh2 = V /(R_sh+110)\n",
      "I_a1 = 50.\n",
      "I_sh1 = 2.\n",
      "I_sh2 = 1.\n",
      "#T (prop.) I_a*I_sh and T doesn't vary\n",
      "I_a2  =  I_a1*(I_sh1/I_sh2)\n",
      "E_b1  =  V - I_a1*(R_a+R_x)\n",
      "E_b2  =  V - I_a2*(R_a+R_x)\n",
      "N_2  =  N_1*(E_b2/E_b1)*(I_sh1/I_sh2) \t\t\t#Because N (prop.) E_b/I_sh\n",
      "print 'New speed =  %.3f rpm'%(N_2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "resistance to be connected in series  =  0.84 ohms\n",
        "New speed =  828.571 rpm\n"
       ]
      }
     ],
     "prompt_number": 33
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.31 page no : 72"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "V = 230.\n",
      "R_a = 0.15\n",
      "R_sh = 250. \t\t\t#armature and shunt field resistance\n",
      "I_a1 = 50.\n",
      "I_a2 =  80.\n",
      "N_1 = 800.\n",
      "N_2 = 1000.\n",
      "I_sh1 =  V / R_sh\n",
      "\n",
      "# Calculations\n",
      "E_b1  =  V - I_a1*R_a\n",
      "E_b2  =  V - I_a2*R_a\n",
      "\n",
      "I_sh2 = I_sh1*(E_b2/E_b1)*(N_1/N_2) \t\t\t#Because N (prop.) E_b/ I_sh\n",
      "R_x =  (V/I_sh2 ) - R_sh    \t\t\t#because I_sh2  =  V /(R_x+ R_sh)\n",
      "\n",
      "# Results\n",
      "print 'resistance to be added is R_x = %.0f ohms'%(R_x)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "resistance to be added is R_x = 69 ohms\n"
       ]
      }
     ],
     "prompt_number": 34
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.32 page no : 74"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "V = 230.\n",
      "R_a = 0.5\n",
      "N_1 = 800.\n",
      "N_2 = 600.\n",
      "I_a2  = 20. \n",
      "I_a1 = I_a2\n",
      "E_b1  =  V - I_a1*R_a\n",
      "\n",
      "# Calculations\n",
      "#N (prop.) E_b/phi (prop.) E_b         as phi is constant\n",
      "E_b2 = E_b1 *(N_2/N_1)\n",
      "#additional resistance required\n",
      "R_x  =  (V -E_b2)/I_a2  - R_a   \t\t\t#because E_b2  =  V - I_a2*(R_a+R_x)\n",
      "\n",
      "# Results\n",
      "print 'Additional resistance required  =  %.2f ohms '%(R_x)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Additional resistance required  =  2.75 ohms \n"
       ]
      }
     ],
     "prompt_number": 35
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.33 page no : 74"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "V = 220.\n",
      "R_a = 0.5\n",
      "R_x = 5. \t\t\t#armature resistacne and extra resistance\n",
      "I_1 = 15.\n",
      "I_se1 = I_1\n",
      "I_se2 = I_se1 \n",
      "I_2 = I_se2\n",
      "N_1 = 800.\n",
      "\n",
      "# Calculations\n",
      "E_b1  =  V - I_1*R_a\n",
      "E_b2  =  V - I_2*(R_a+R_x)\n",
      "\n",
      "N_2 =  N_1*(E_b2/E_b1)*(I_se1/I_se2) \t\t\t#because N (prop.) E_b/I_se\n",
      "\n",
      "# Results\n",
      "print 'New speed of rotor  =  %.3f r.p.m'%(N_2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "New speed of rotor  =  517.647 r.p.m\n"
       ]
      }
     ],
     "prompt_number": 36
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.34 page no : 75"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "V = 250.\n",
      "I_a1 = 20.\n",
      "R_a = 0.5\n",
      "N_1 = 1000.\n",
      "N_2 = 500.\n",
      "\n",
      "# Calculations and Results\n",
      "#T (prop.) I_a and T_1 = T_2\n",
      "I_a2 = I_a1\n",
      "E_b1  =  V - I_a1*R_a\n",
      "\n",
      "#N (prop.) E_b\n",
      "E_b2 =  E_b1 *(N_2/N_1)\n",
      "R_x =  (V-E_b2)/I_a2 - R_a   \t\t\t#because E_b2  =  V - I_a2*(R_a+R_x)\n",
      "print 'Additional resistance  =  %.0f ohms'%(R_x)\n",
      "T3_by_T2 = 0.5   \t\t\t#torque is halved\n",
      "I_a3 =  I_a2 *(T3_by_T2)   \t\t\t#new armature current\n",
      "E_b3  =  V - I_a3*(R_x + R_a)\n",
      "N_3 = E_b3*N_2 / E_b2 \t\t\t#N (prop.) E_b\n",
      "print 'New speed  =  %.3f rpm'%(N_3)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Additional resistance  =  6 ohms\n",
        "New speed  =  770.833 rpm\n"
       ]
      }
     ],
     "prompt_number": 37
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.35 page no : 76"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "P_out =  100*735.5\n",
      "V = 500.\n",
      "P = 4.\n",
      "A = 2.\t\t\t# due to wave winding\n",
      "Z = 492. \t\t\t#no of conductors\n",
      "phi = 50.*10**-3 \t\t\t#flux per pole\n",
      "eta = 92./100 \t\t\t#efficiency\n",
      "P_in =  P_out/eta\n",
      "R_a = 0.1 \n",
      "R_sh = 250. \t\t\t#amature and shunt field resistance\n",
      "\n",
      "# Calculations\n",
      "I_L = P_in/V\n",
      "I_sh  =  V/ R_sh\n",
      "I_a  =  I_L - I_sh\n",
      "E_b  =  V - I_a*R_a\n",
      "N = E_b*60*A/(phi*P*Z)  \t\t\t#because E_b =   phi*P*N*Z/(60*A)\n",
      "\n",
      "T_sh =  P_out/(2*math.pi*N/60) \t\t\t#Useful torque\n",
      "\n",
      "# Results\n",
      "print 'i)Speed at full load  =  %.4f rpm'%(N)\n",
      "print 'ii)Useful torque  =  %.2f N-m'%(T_sh)\n",
      "print 'Answer mismatches due to improper approximation'\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "i)Speed at full load  =  590.5011 rpm\n",
        "ii)Useful torque  =  1189.41 N-m\n",
        "Answer mismatches due to improper approximation\n"
       ]
      }
     ],
     "prompt_number": 38
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.36 page no : 77"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from numpy import roots\n",
      "import math \n",
      "\n",
      "# Variables\n",
      "N_1 = 1000.\n",
      "I_1 = 50.\n",
      "I_a1 = I_1\n",
      "V = 250.\n",
      "R_x = 4.4\n",
      "R_t = 0.6   \t\t\t#R_t  =  R_a+R_se\n",
      "E_b1 = V - I_a1*(R_t)\n",
      "\n",
      "# Calculations\n",
      "#T (prop.)I_a**2   T (prop.) N**2  .... hence N (prop.) I_a\n",
      "#N (prop.) E_b /I_a \n",
      "#combining both  E_b (prop.) I_a**2\n",
      "#using E_b2  =  V - I_a2*(R_a + R_se + R_x) and solving for I_a2 we get 0.088 I_a2**2 +5 I_a2 -250 = 0\n",
      "p = [0.088 ,5, -250] \n",
      "ans = roots(p)\n",
      "I_a2 = ans[1] \t\t\t#root(1) is ignored as it is -ve\n",
      "E_b2  =  V - I_a2*(R_t + R_x) \n",
      "N_2 = N_1*(E_b2/E_b1)*(I_a1/I_a2)\n",
      "\n",
      "# Results\n",
      "print 'Motor speed  =  %.2f r.p.m'%(N_2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Motor speed  =  639.79 r.p.m\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.37 page no : 78"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from numpy import roots\n",
      "import math \n",
      "\n",
      "# Variables\n",
      "V = 250.\n",
      "I_a1 = 20.\n",
      "R_sh =  250.\n",
      "R_a = 0.5 \t\t\t#shunt field and armature resistance\n",
      "I_sh1 =  V / R_sh\n",
      "E_b1  =  V - I_a1*R_a\n",
      "\n",
      "#T (prop.) phi*I_a (prop.) I_sh*I_a\n",
      "#math.since T_1  =  T_2\n",
      "I_sh2_I_a2  =  I_sh1*I_a1  \n",
      "I_sh2_I_a2  =  I_sh1*I_a1  \t\t\t# = 20\n",
      "\n",
      "# Calculations\n",
      "#N (prop.) E_b/I_sh\n",
      "#E_b1  =  V - I_a1*R_a\n",
      "#Solving further for I_a2 we get I_a2**2 -500 I_a2 + 12800\n",
      "p = [1, -500, 12800]\n",
      "ans = roots(p)\n",
      "I_a2 = ans[1] \t\t\t#higher root is neglected\n",
      "I_sh2 =  I_sh2_I_a2 / I_a2\n",
      "R_x =  (V / I_sh2) - R_sh \t\t\t#resistance to be inserted in shunt field\n",
      "\n",
      "# Results\n",
      "print 'resistance to be inserted  =  %.4f ohms '%(R_x)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "resistance to be inserted  =  88.3129 ohms \n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.38 page no : 79"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "\n",
      "# Variables\n",
      "V = 250.\n",
      "N_1 = 1000.\n",
      "I_L1 = 25.\n",
      "R_a = 0.2\n",
      "R_sh = 250. \t\t\t#armature and shunt field resistance\n",
      "V_brush =  1. \t\t\t#voltage drop due to brushes\n",
      "\n",
      "# Calculations and Results\n",
      "I_sh1  =  V/R_sh\n",
      "I_a1 =  I_L1 - I_sh1\n",
      "E_b1 =  V- I_a1*R_a - 2 *V_brush\n",
      "\n",
      "#when loaded\n",
      "I_L2 = 50.\n",
      "I_sh2 = I_sh1   \t\t\t#as flux weakensby armature reaction shunt field current remains same \n",
      "I_a2 =  I_L2 - I_sh2\n",
      "E_b2 =  V- I_a2*R_a - 2 *V_brush\n",
      "\n",
      "phi2_by_phi1 =  1- (3./100)  \t\t\t#weakens by 3 percent\n",
      "N_2 =  N_1*(E_b2/E_b1)/ phi2_by_phi1   \t\t\t#N (prop.) E_b/phi\n",
      "print 'New speed  =  %.3f rpm'%(N_2)\n",
      "T_1 =  E_b1*I_a1/(2*math.pi*N_1/60)\n",
      "T_2 =  E_b2*I_a2/(2*math.pi*N_2/60)\n",
      "print 'Torque before field weakening  =  %.4f N-m'%(T_1)\n",
      "print 'Torque after  field weakening  =  %.4f N-m'%(T_2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "New speed  =  1009.733 rpm\n",
        "Torque before field weakening  =  55.7373 N-m\n",
        "Torque after  field weakening  =  110.3831 N-m\n"
       ]
      }
     ],
     "prompt_number": 41
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.39 page no : 80"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "\n",
      "# Variables\n",
      "V = 220.\n",
      "R_a = 0.5\n",
      "R_x = 1. \t\t\t#armature resistance and extra resistance\n",
      "N_FL = 500. \t\t\t#full load speed in r.p.m\n",
      "I_a_FL = 30.\n",
      "\n",
      "# Calculations and Results\n",
      "#part(i)   Full load \n",
      "E_b_FL =  V- I_a_FL * R_a\n",
      "#T (prop.) I_a... T is constant\n",
      "I_a_dash_FL  =  I_a_FL \n",
      "E_b_dash_FL  =   V- I_a_dash_FL * (R_a+R_x)\n",
      "#N (prop.) E_b/phi   (prop.) E_b\n",
      "N_dash_FL  =  N_FL*(E_b_dash_FL/E_b_FL)\n",
      "print 'i)Speed at full load torque  = %.4f r.p.m'%(N_dash_FL)\n",
      "\n",
      "#part(ii)\n",
      "T2_by_T1  =  2\n",
      "I_a_dash_FL   =   I_a_FL  *(T2_by_T1)\n",
      "E_b_dash_FL  =   V- I_a_dash_FL * (R_a+R_x)\n",
      "N_dash_FL  =  N_FL*(E_b_dash_FL/E_b_FL)\n",
      "print 'ii)Speed at double full load torque  = %.3f r.p.m'%(N_dash_FL)\n",
      "\n",
      "#part(iii) ...stalling\n",
      "E_b = 0 \t\t\t#as speed is zero in case of stalling torque\n",
      "I_a_stall = (V-E_b)/(R_a+R_x)\n",
      "T_FL  =  E_b_FL * I_a_FL/(2*math.pi*N_FL/60)\n",
      "T_stall  =  T_FL *(I_a_stall/ I_a_FL)\n",
      "print 'iii)Stalling torque  =  %.3f Nm'%(T_stall)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "i)Speed at full load torque  = 426.8293 r.p.m\n",
        "ii)Speed at double full load torque  = 317.073 r.p.m\n",
        "iii)Stalling torque  =  574.231 Nm\n"
       ]
      }
     ],
     "prompt_number": 42
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.40 page no : 81"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "V = 230.\n",
      "I_a1 = 30.\n",
      "R_a = 0.4\n",
      "R_x = 1.1\t\t\t#armature resistance and extra resistance\n",
      "N_1 = 500.\n",
      "\n",
      "\n",
      "# Calculations and Results\n",
      "#part(i)\n",
      "E_b1 =  V - I_a1*R_a\n",
      "I_a2  =  I_a1 \t\t\t#I_a is constant as T , phi are constant\n",
      "E_b2 =  V - I_a2*(R_a+R_x)\n",
      "N_2  =  N_1 *(E_b2/E_b1) \t\t\t#Because N (prop.) E_b/phi (prop.) E_b\n",
      "print 'i)Speed at full load torque  =  %.3f r.p.m'%(N_2)\n",
      "\n",
      "#part(ii)\n",
      "T2_by_T1 = 1.5\n",
      "I_a2 =  I_a1 * T2_by_T1\n",
      "E_b2 =  V - I_a2*(R_a+R_x)\n",
      "N_2  =  N_1 *(E_b2/E_b1) \t\t\t#Because N (prop.) E_b/phi (prop.) E_b\n",
      "print 'ii)Speed at 1.5 times full load torque  =  %.3f r.p.m'%(N_2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "i)Speed at full load torque  =  424.312 r.p.m\n",
        "ii)Speed at 1.5 times full load torque  =  372.706 r.p.m\n"
       ]
      }
     ],
     "prompt_number": 43
    }
   ],
   "metadata": {}
  }
 ]
}