{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 7: DC Machines"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 7.1, Page number: 371"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "from math import *\n",
      "\n",
      "#Variable declaration:\n",
      "Vt=[128, 124]                           #Terminal voltage(V)\n",
      "Ea=125                                  #Generated emf(V)\n",
      "Ra=0.02                                 #Armature resistance(ohm)\n",
      "n=3000                                  #rpm\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "#For 128 V\n",
      "Ia1=(Vt[0]-Ea)/Ra\n",
      "Pin1=Vt[0]*Ia1\n",
      "Pe1=Ea*Ia1\n",
      "wm=3000*2*pi/60\n",
      "Tmech1=Ea*Ia1/wm\n",
      "\n",
      "#for 124 V\n",
      "Ia2=(-Vt[1]+Ea)/Ra\n",
      "Pin2=Vt[1]*Ia2\n",
      "Pe2=Ea*Ia2\n",
      "Tmech2=Ea*Ia2/wm\n",
      "\n",
      "\n",
      "\n",
      "#Results:\n",
      "print \"(a) Armature current:\",Ia1,\"A\",\"\\n    Terminal power:\",Pin1/10**3,\"kW\"\n",
      "print \"    Electromagnetic power:\",round(Pe1/10**3,2),\"kW\"\n",
      "print \"    Torque:\",round(Tmech1,1),\"Nm\"\n",
      "\n",
      "print \"(b) Armature current:\",Ia2,\"A\",\"\\n    Terminal power:\",Pin2/10**3,\"kW\"\n",
      "print \"    Electromagnetic power:\",round(Pe2/10**3,2),\"kW\",\n",
      "print \"\\n    Torque:\",round(Tmech2,1),\"Nm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Armature current: 150.0 A \n",
        "    Terminal power: 19.2 kW\n",
        "    Electromagnetic power: 18.75 kW\n",
        "    Torque: 59.7 Nm\n",
        "(b) Armature current: 50.0 A \n",
        "    Terminal power: 6.2 kW\n",
        "    Electromagnetic power: 6.25 kW \n",
        "    Torque: 19.9 Nm\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 7.2, Page number: 372"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "\n",
      "#Variable declaration:\n",
      "Vt=123                                      #terminal voltage(V)\n",
      "Pt=21.9                                     #Terminal power(kW)\n",
      "Ra=0.02                                     #ohm\n",
      "Eao=125                                     #generated voltage(V) at 3000rpm\n",
      "no=3000                                     #rpm\n",
      "\n",
      "\n",
      "#calculations:\n",
      "Ia=Pt*10**3/Vt\n",
      "Ea=Vt-Ia*Ra\n",
      "n=(Ea/Eao)*no\n",
      "\n",
      "#Results:\n",
      "print \"Speed of motor:\",round(n,0),\"rpm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed of motor: 2867.0 rpm\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 7.3, Page number: 376"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "\n",
      "#Variable declaration:\n",
      "Il=400                                  #Armature current(A)\n",
      "If=4.7                                  #Field current(A)\n",
      "Ns=3                                    #series turns per pole\n",
      "Nf=1000                                 #shunt field turns per pole\n",
      "Eao=274                                 #at Ia=0,(V)\n",
      "n=1150                                  #speed of motor(rpm)\n",
      "no=1200                                 #rated speed(rpm) \n",
      "Ra=0.025                                #armature resistance(ohm)\n",
      "Rs=0.005                                #series field resistance(ohm)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "Is=Il+If\n",
      "GM=If+(Ns/Nf)*Is                        #for graphical analysis\n",
      "Ea=(n/no)*Eao\n",
      "Vt=Ea-Is*(Ra+Rs)\n",
      "\n",
      "#Results:\n",
      "print \"Terminal voltage at rated terminal current:\",round(Vt,0),\"V\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Terminal voltage at rated terminal current: 250.0 V\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 7.4, Page number: 377"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "\n",
      "#Variable declaration:\n",
      "Il=400                                  #Armature current(A)\n",
      "If=4.7                                  #Field current(A)\n",
      "Ns=3                                    #series turns per pole\n",
      "Nf=1000                                 #shunt field turns per pole\n",
      "Eao=261                                 #at Ia=400 A,(V)\n",
      "n=1150                                  #speed of motor(rpm)\n",
      "no=1200                                 #rated speed(rpm) \n",
      "Ra=0.025                                #armature resistance(ohm)\n",
      "Rs=0.005                                #series field resistance(ohm)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "Ea=(n/no)*Eao\n",
      "Vt=Ea-(Il+If)*(Ra+Rs)\n",
      "\n",
      "#Results:\n",
      "print \"Terminal voltage:\", round(Vt,0), \"V\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Terminal voltage: 238.0 V\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 7.5, Page number: 378"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "\n",
      "#Variable declaration:\n",
      "Il=400                                  #Armature current(A)\n",
      "If=4.7                                  #Field current(A)\n",
      "Ns=3                                    #series turns per pole\n",
      "Nf=1000                                 #shunt field turns per pole\n",
      "Eao=269                                 #at Ia=400 A,(V)\n",
      "n=1150                                  #speed of motor(rpm)\n",
      "no=1200                                 #rated speed(rpm) \n",
      "Ra=0.025                                #armature resistance(ohm)\n",
      "Rs=0.007                                #series field resistance(ohm)\n",
      "\n",
      "#Calculations:\n",
      "Is=Il+If\n",
      "GM=If+(Ns/Nf)*Is                        #for graphical analysis\n",
      "Ea=(n/no)*Eao\n",
      "Vt=Ea-Is*(Ra+Rs)\n",
      "\n",
      "#Results:\n",
      "print \"Terminal voltage at rated terminal current:\",round(Vt,0),\"V\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Terminal voltage at rated terminal current: 245.0 V\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 7.6, Page number: 381"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "from sympy import *\n",
      "\n",
      "\n",
      "#Variable declaration:\n",
      "Ns=4                            #Series field turns\n",
      "Nf=1000                         #Shunt field turns\n",
      "Vt=250                          #Full load voltage(V)\n",
      "#for part (a):\n",
      "Ia=400                          #Armature current(A)\n",
      "Ra=0.025                        #Armature resistance(ohm)\n",
      "\n",
      "#for part (b):\n",
      "Rs=0.005                        #Added sries resistance(ohm)\n",
      "Vo=250                          #No load voltage(V)\n",
      "If=5                            #field current at full load(A)\n",
      "\n",
      "\n",
      "#Calculations & Results:\n",
      "\n",
      "#for part (a)\n",
      "V1=Ia*Ra\n",
      "\n",
      "#for part (b):\n",
      "Ia1=Ia+If\n",
      "Rs,Rd=symbols('Rs Rd')            #Rd= diverter resistance(ohm)\n",
      "Rp=Rs*Rd/(Rs+Rd)                  #                      -------(i)\n",
      "Is=Ia1*(Rd/(Rs+Rd))\n",
      "Inet=If+(Ns/Nf)*Is\n",
      "Ea=Vt+Ia*(Ra+Rp)                  #                      -------(ii)\n",
      "\n",
      "#from equation (ii)\n",
      "Rp=Rs(Inet-5.0)/1.62              \n",
      "R_d=0.0082                       #R_d=Rd(say), using (i)\n",
      "print \"(a) The operating terminal voltage = 205 V\", Inet\n",
      "print \"(b) Rd =\", R_d,\"ohm\"\n",
      "print \"\\tHence, by this process, resistance across the series field\" \n",
      "print \"\\t(referred to as a series-field diverter) can be adjusted \"\n",
      "print \"\\tto produce the desired performance. \""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) The operating terminal voltage = 205 V 1.62*Rd/(Rd + Rs) + 5\n",
        "(b) Rd = 0.0082 ohm\n",
        "\tHence, by this process, resistance across the series field\n",
        "\t(referred to as a series-field diverter) can be adjusted \n",
        "\tto produce the desired performance. \n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 7.7, Page number: 383"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "      \n",
      "#Variable declaration:\n",
      "Ia=400                              #Armature current(A)\n",
      "n1=1200                             #rpm\n",
      "n2=1100                             #rpm\n",
      "Ra=0.025                            #armature resistance(ohm)     \n",
      "Eo=250                              #no load armature voltage(V)\n",
      "del_n=1.5                           #fractional winding added\n",
      "N=1000                              #Total windings\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "#for part(a):\n",
      "#point corresponding on the no load saturation curve is :\n",
      "Eao=Eo*(n1/n2)\n",
      "#using Eao value in curve, value of If is found to be:\n",
      "If=5.90                             #Field current(A)\n",
      "Ea=Eo-Ia*Ra\n",
      "#From Fig. 7.14\n",
      "Ea1=261\n",
      "n=n1*(Ea/Ea1)\n",
      "Pe=Ea*Ia\n",
      "Pl=2000                             #No load Rotational loss(W)\n",
      "Po=(Pe-Pl)/(1+0.01)\n",
      "\n",
      "#for part (b):\n",
      "If1=If+del_n/N\n",
      "#From Fig. 7.14 the corresponding value of Ea at 1200 r/min would be 271 V.\n",
      "Ea2=271                             #volts\n",
      "n22=n1*(Ea/Ea2)\n",
      "\n",
      "\n",
      "#Results:\n",
      "print \"Part(a):\"\n",
      "print \"Required speed =\",round(n),\"r/min\"\n",
      "print \"Output power =\", round((Po/746),1),\"hp\"\n",
      "print \"\\nPart (b):\"\n",
      "print \"Required speed =\",round(n22),\"r/min\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Part(a):\n",
        "Required speed = 1103.0 r/min\n",
        "Output power = 124.8 hp\n",
        "\n",
        "Part (b):\n",
        "Required speed = 1063.0 r/min\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 7.9, Page number: 389"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "from math import *\n",
      "\n",
      "#Variable declaration:\n",
      "V1=50                               #terminal voltage(V)\n",
      "Ia=1.25                             #Armature current(A)\n",
      "Ra=1.03                             #Armature resistance(ohm)\n",
      "n1=2100                             #speed at 50V(rpm)\n",
      "V2=48                               #terminal voltage at 1700 rpm (V)\n",
      "n2=1700                             #speed at 48 V(rpm)\n",
      "\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "#for (a):\n",
      "Ea1=V1-Ia*Ra\n",
      "wm1=n1*2*pi/60\n",
      "Km=round(Ea1/wm1,2)\n",
      "\n",
      "#for part(b):\n",
      "Prot=Ea1*Ia\n",
      "\n",
      "#for part(c:)\n",
      "wm2=n2*2*pi/60\n",
      "Ea2=Km*wm2\n",
      "Ia2=(V2-Ea2)/Ra\n",
      "Pmech=Ea2*Ia2\n",
      "Pshaft=Pmech-Prot\n",
      "\n",
      "#Results:\n",
      "print \"(a) Torque constant:\",round(Km,2),\"V/(rad/s)\"\n",
      "print \"(b) No-load rotational losses of the motor:\",round(Prot,0),\"W\"\n",
      "print \"(c) The power output of the motor:\",round(Pshaft,2),\"W\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Torque constant: 0.22 V/(rad/s)\n",
        "(b) No-load rotational losses of the motor: 61.0 W\n",
        "(c) The power output of the motor: 275.05 W\n"
       ]
      }
     ],
     "prompt_number": 3
    }
   ],
   "metadata": {}
  }
 ]
}