{
 "metadata": {
  "name": "",
  "signature": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter01 - Poly phase ac machines"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.1 Page 24"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "# Given data\n",
      "Zinner=0.01+0.5*1J #Impedence at standstill of inner cage in ohm\n",
      "Zouter=0.05+0.1*1J #Impedence at standstill of outer cage in ohm\n",
      "\n",
      "#Calculations\n",
      "#Part (a) : at starting\n",
      "R1=Zinner.real #in ohm\n",
      "R2=Zouter.real #in ohm\n",
      "X1=Zinner.imag #in ohm\n",
      "X2=Zouter.imag #in ohm\n",
      "#Formula : Ts=3/ws*V_dash**2*R2/(R2**2+X2**2)\n",
      "TsoBYTsi=(R2/(R2**2+X2**2))/(R1/(R1**2+X1**2))\n",
      "print \"Part(a) Ratio of Torque : \" ,round(TsoBYTsi)\n",
      "#Part(b) : slip =5%\n",
      "S=5/100 #slip\n",
      "#Formula : T=3/ws*V_dash**2*(R2/S)**2/((R2/S)+X2**2)\n",
      "ToBYTi=((R2/S)/((R2/S)**2+X2**2))/((R1/S)/((R1/S)**2+X1**2))\n",
      "print \"Part(b) Ratio of Torque : \" ,round(ToBYTi,3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Part(a) Ratio of Torque :  100.0\n",
        "Part(b) Ratio of Torque :  1.436\n"
       ]
      }
     ],
     "prompt_number": 99
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.1 Page: 41 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "# Given data\n",
      "P=4 #No. of poles\n",
      "f=50 #in Hz\n",
      "N=1410 #in rpm\n",
      "\n",
      "#Calculations\n",
      "Ns=120*f/P #in r\n",
      "print \"Synchronous speed = %0.f rpm\" %Ns\n",
      "S=(Ns-N)/Ns #Full load slip\n",
      "S=S*100 #in %\n",
      "print \"Full load slip = %0.f %%  \"%S "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Synchronous speed = 1500 rpm\n",
        "Full load slip = 6 %  \n"
       ]
      }
     ],
     "prompt_number": 100
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.2 Page 42"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=2 #No. of poles\n",
      "f=50 #in Hz\n",
      "S=2 #in %#Calculations\n",
      "S=S/100 #unitless\n",
      "Ns=120*f/P #in rpm\n",
      "N=Ns*(1-S)\n",
      "print \"Speed of motor = %0.f rpm \" %N"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed of motor = 2940 rpm \n"
       ]
      }
     ],
     "prompt_number": 101
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.3 Page 42"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=4 #No. of poles\n",
      "f=50 #in Hz\n",
      "N=1470 #in rpm\n",
      "\n",
      "#Calculations\n",
      "Ns=120*f/P #in rpm\n",
      "S=(Ns-N)/Ns #Slip\n",
      "fr=S*f #induced emf frequency in Hz\n",
      "print \"Induced emf frequency = %0.2f Hz\" %fr"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Induced emf frequency = 1.00 Hz\n"
       ]
      }
     ],
     "prompt_number": 102
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4 Page 42"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math as mh\n",
      "# Given data\n",
      "P=4 #No. of poles\n",
      "f=50 #in Hz\n",
      "K=1/2 #rotor to stator turns\n",
      "N=1455 #in rpm\n",
      "E1_line=415 #in volt#Calculations\n",
      "Ns=120*f/P #in rpm\n",
      "S=(Ns-N)/Ns #Slip\n",
      "fr=S*f #induced emf frequency in Hz\n",
      "print \"(i) Frequency of rotor emf in running condition = %0.2f Hz\" %fr\n",
      "N2BYN1=K #rotor to stator turns\n",
      "N1BYN2=1/K #stator to rotor turns\n",
      "E1ph=E1_line/mh.sqrt(3) #\n",
      "#Formula : E2ph/E1ph=K\n",
      "E2ph=E1ph*K #in volt\n",
      "print \"(ii) Rotor induced emf at standstill = %0.2f V\"%E2ph\n",
      "E2r=S*E2ph #in volt\n",
      "print \"(iii) Rotor induced emf at running condition = %0.3f V\" %E2r"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) Frequency of rotor emf in running condition = 1.50 Hz\n",
        "(ii) Rotor induced emf at standstill = 119.80 V\n",
        "(iii) Rotor induced emf at running condition = 3.594 V\n"
       ]
      }
     ],
     "prompt_number": 103
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.5 Page 43"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math as mh\n",
      "# Given data\n",
      "P=4 #No. of poles\n",
      "f=50 #in Hz\n",
      "R2=0.2 #in ohm\n",
      "X2=1 #in ohm\n",
      "N=1440 #in rpm\n",
      "E2_line=120 #in volt#Calculations\n",
      "E2ph=E2_line/mh.sqrt(3) #\n",
      "cosfi_2=R2/mh.sqrt(R2**2+X2**2) #lagging power factor\n",
      "I2=E2ph/mh.sqrt(R2**2+X2**2) #in Ampere/phase\n",
      "print \"(i) Rotor power factor = %0.3f lagging\" %cosfi_2\n",
      "print \"(i) Rotor Current = %0.2f Ampere per phase\" %I2\n",
      "Ns=120*f/P #in rpm\n",
      "S=(Ns-N)/Ns #Slip\n",
      "cosfi_2r=R2/mh.sqrt(R2**2+(S*X2)**2) #lagging power factor\n",
      "I2r=S*E2ph/mh.sqrt(R2**2+(S*X2)**2) #in Ampere\n",
      "print \"(ii) Rotor power factor = %0.4f lagging\" %cosfi_2r\n",
      "print \"(ii) Rotor Current = %0.3f Ampere\" %I2r"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) Rotor power factor = 0.196 lagging\n",
        "(i) Rotor Current = 67.94 Ampere per phase\n",
        "(ii) Rotor power factor = 0.9806 lagging\n",
        "(ii) Rotor Current = 13.587 Ampere\n"
       ]
      }
     ],
     "prompt_number": 104
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.6 Page 44"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math as mh\n",
      "# Given data\n",
      "P=4 #No. of poles\n",
      "f=50 #in Hz\n",
      "R2=0.1 #in ohm\n",
      "X2=1 #in ohm\n",
      "N=1440 #in rpm\n",
      "E1_line=400 #in volt\n",
      "Kdash=2 #stator turns by rotor turns\n",
      "\n",
      "#Calculations\n",
      "K=1/Kdash #rotor turns by stator turns\n",
      "Ns=120*f/P #in rpm\n",
      "E1ph=E1_line/mh.sqrt(3) #\n",
      "#Formula : E2ph/E1ph=K\n",
      "E2ph=E1ph*K #in volt\n",
      "S=(Ns-N)/Ns #Slip\n",
      "ns=Ns/60 #synchronous speed in rps\n",
      "T=3/(2*mh.pi*ns)*(S*E2ph**2*R2)/(R2**2+(S*X2)**2) #in N-m\n",
      "print \"Torque devloped on full load = %0.2f N-m \"%T "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Torque devloped on full load = 87.81 N-m \n"
       ]
      }
     ],
     "prompt_number": 105
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.7 Page 45"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt, pi\n",
      "# Given data\n",
      "P=4 #No. of poles\n",
      "f=50 #in Hz\n",
      "Kdash=4 #stator turns by rotor turn\n",
      "R2=0.01 #in ohm\n",
      "X2=0.1 #in ohm\n",
      "E1_line=400 #in volt\n",
      "\n",
      "#Calculations\n",
      "K=1/Kdash #rotor turns by stator turns\n",
      "Ns=120*f/P #in rpm\n",
      "E1ph=E1_line/sqrt(3) #\n",
      "#Formula : E2ph/E1ph=K\n",
      "E2ph=E1ph*K #in volt\n",
      "#(i) at start S=1\n",
      "ns=Ns/60 #in rps\n",
      "K=3/2/pi/ns \n",
      "Tst=K*E2ph**2*R2/(R2**2+X2**2) #in N-m\n",
      "print \"(i) Starting Torque = %0.2f N-m\" %Tst\n",
      "#part (ii) \n",
      "Sm=R2/X2 #slip for max torque\n",
      "print \"(ii) Slip at which max torque devloped = %0.2f %% \"%(Sm*100) \n",
      "#Part (iii)\n",
      "N=Ns*(1-Sm) #in rpm\n",
      "print \"(iii) Speed at which max torque occur = %0.2f rpm\" %N\n",
      "#Part (iv)\n",
      "Tm=K*E2ph**2/2/X2 #in N-m\n",
      "print \"(iv) Maximum  torque = %0.2f N-m\" %Tm\n",
      "#Part (v)\n",
      "Sf=4 #in %\n",
      "Sf=Sf/100 #slip\n",
      "Tfl=K*Sf*E2ph**2*R2/(R2**2+(Sf*X2)**2) #in N-m\n",
      "print \"(v) Full load Torque devloped = %0.2f N-m  \"%Tfl "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) Starting Torque = 63.03 N-m\n",
        "(ii) Slip at which max torque devloped = 10.00 % \n",
        "(iii) Speed at which max torque occur = 1350.00 rpm\n",
        "(iv) Maximum  torque = 318.31 N-m\n",
        "(v) Full load Torque devloped = 219.52 N-m  \n"
       ]
      }
     ],
     "prompt_number": 106
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.8 Page 46"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=24 #No. of poles\n",
      "f=50 #in Hz\n",
      "R2=0.016 #in ohm\n",
      "X2=0.265 #in ohm\n",
      "N=247 #in rpm\n",
      "\n",
      "#Calculations\n",
      "Ns=120*f/P #in rpm\n",
      "Sf=(Ns-N)/Ns #full load slip\n",
      "Sm=R2/X2 #max slip\n",
      "Tfl_BY_Tm=2*Sm*Sf/(Sm**2+Sf**2) #unitless\n",
      "print \"Ratio of full load torque to max torque : \" ,round(Tfl_BY_Tm,4)\n",
      "Tst_BY_Tm=2*Sm/(1+Sm**2) #unitless\n",
      "print \"Ratio of starting torque to max torque : \" ,round(Tst_BY_Tm,4)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Ratio of full load torque to max torque :  0.3824\n",
        "Ratio of starting torque to max torque :  0.1203\n"
       ]
      }
     ],
     "prompt_number": 107
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.9 Page 47"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "R2=0.04 #in ohm\n",
      "X2=0.2 #in ohm\n",
      "\n",
      "#Calculations\n",
      "R2dash=X2 #in ohm (for Tm=Tst)\n",
      "#formula : R2dash=R2+rex\n",
      "Rex=R2dash-R2 #in ohm/phase\n",
      "print \"(i) External resistance required = %0.2f ohm/phase\"%Rex \n",
      "from sympy import symbols, solve\n",
      "k, E2, R2dash = symbols('k, E2, R2dash')\n",
      "# For Tst = 1/2*Tm\n",
      "Tm = k*E2**2/2/X2\n",
      "Tst = k*E2**2*R2/(R2**2+X2**2)\n",
      "#R2dash = R2+Rex\n",
      "##Putting R2 dash in place of R2\n",
      "Tst = k*E2**2*R2dash/(R2dash**2+X2**2)\n",
      "#Equating Tst = 1/2*Tm gives\n",
      "expr = R2dash**2-4*X2*R2dash+X2**2\n",
      "R2dash = solve(expr, R2dash)\n",
      "R2dash = R2dash[0] #ohm  as R2 can't >X2\n",
      "Rex = R2dash-R2\n",
      "print \"(ii) External resistance required = %0.4f ohm/phase\" %Rex"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) External resistance required = 0.16 ohm/phase\n",
        "(ii) External resistance required = 0.0136 ohm/phase"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n"
       ]
      }
     ],
     "prompt_number": 108
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.10 Page 48"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "f=50 #in Hz\n",
      "P=8 #no. of poles\n",
      "Tsh=190 #in N-m\n",
      "fr=1.5 #in Hz\n",
      "MechLoss=700 #in watts\n",
      "\n",
      "#Calculations\n",
      "S=fr/f #Slip\n",
      "Ns=120*f/P #in rpm\n",
      "N=Ns*(1-S) #in rpm\n",
      "Pout=Tsh*2*pi*N/60 #in watts\n",
      "Pm=Pout+MechLoss #in watts\n",
      "#formula-:  P2:Pc:Pm=1:S:1-S\n",
      "Pc=Pm*S/(1-S) #in watts\n",
      "print \"Rotor Copper loss = %0.3f W\" %Pc"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Rotor Copper loss = 469.326 W\n"
       ]
      }
     ],
     "prompt_number": 109
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.11 Page 49"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "f=50 #in Hz\n",
      "P=4 #no. of poles\n",
      "Pin=50 #in kW\n",
      "N=1440 #in rpm\n",
      "StatorLoss=1000 #in watts\n",
      "FrictionalLoss=650 #in watts\n",
      "\n",
      "#Calculations\n",
      "Ns=120*f/P #in rpm\n",
      "S=(Ns-N)/Ns #Slip\n",
      "\n",
      "N=Ns*(1-S) #in rpm\n",
      "P2=Pin-StatorLoss/1000 #in KW\n",
      "#formula-:  P2:Pc:Pm=1:S:1-S\n",
      "Pc=S*P2 #in KW\n",
      "Pm=P2-Pc #in KW\n",
      "Pout=Pm-FrictionalLoss/1000 #in KW\n",
      "Eff=Pout/Pin*100 #in %\n",
      "print \"Full load efficiency = %0.2f %%\" %Eff"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Full load efficiency = 92.78 %\n"
       ]
      }
     ],
     "prompt_number": 110
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.12 Page 50"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "f=50 #in Hz\n",
      "phase=3 #no. of phase\n",
      "P=4 #no. of poles\n",
      "Tsh=300 #in N-m\n",
      "Tlost=50 #in N-m\n",
      "fr=120 #in cycles/min\n",
      "fr=fr/60 #in Hz\n",
      "I2r=60 #in Ampere/phase\n",
      "\n",
      "#Calculations\n",
      "S=fr/f #slip\n",
      "print \"(i) Slip = %0.2f %%\" %(S*100)\n",
      "Ns=120*f/P #in rpm\n",
      "N=Ns*(1-S) #in rpm\n",
      "Pout=Tsh*2*pi*N/60 #watts\n",
      "print \"(ii) Net output Power = %0.3f kW\" %(Pout/1000)\n",
      "FricLoss=Tlost*2*pi*N/60 #in watts\n",
      "Pm=Pout+FricLoss #in watts\n",
      "#formula-:  P2:Pc:Pm=1:S:1-S\n",
      "Pc=S*Pm/(1-S) #copper loss in Watts\n",
      "PcPERphase=Pc/phase #Copper loss per phase in watts\n",
      "print \"(iii) Rotor copper loss per phase = %0.4f W\"%PcPERphase \n",
      "P2=Pc/S #in watts\n",
      "Eff=Pm/P2*100 #in %\n",
      "print \"(iv) Rotor efficiency = %0.2f %% \"%Eff \n",
      "#Formula : CuLossPerPhase=I2r**2*R2 #in watts\n",
      "R2=PcPERphase/I2r**2 #in ohm/phase\n",
      "print \"(v) Rotor resistance per phase = %0.4f W/phase \"%R2 "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) Slip = 4.00 %\n",
        "(ii) Net output Power = 45.239 kW\n",
        "(iii) Rotor copper loss per phase = 733.0383 W\n",
        "(iv) Rotor efficiency = 96.00 % \n",
        "(v) Rotor resistance per phase = 0.2036 W/phase \n"
       ]
      }
     ],
     "prompt_number": 111
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.13 Page 51"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "Pout=25 #in KW\n",
      "f=50 #in Hz\n",
      "phase=3 #no. of phase\n",
      "P=4 #no. of poles\n",
      "N=1410 #in rpm\n",
      "MechLoss=850 #in watts\n",
      "StatLossBYCuLoss=1.17 \n",
      "I2r=65 #in Ampere\n",
      "\n",
      "#Calculations\n",
      "Ns=120*f/P #in rpm\n",
      "S=(Ns-N)/Ns #slip\n",
      "Pm=Pout*1000+MechLoss #in watts\n",
      "print \"Gross mechanical power devloped = %0.2f W\" %Pm\n",
      "#formula-:  P2:Pc:Pm=1:S:1-S\n",
      "Pc=S*Pm/(1-S) #copper loss in Watts\n",
      "print \"Rotor Copper Losses = %0.2f W\"%Pc\n",
      "R2=Pc/phase/I2r**2 #in ohm/phase\n",
      "print \"Rotor resistance per phase = %0.2f ohm\" %R2\n",
      "StatorLoss=1.7*Pc #in watts\n",
      "P2=Pc/S #in Watts\n",
      "Pin=P2+StatorLoss #in watts\n",
      "Eff=Pout*1000/Pin*100 #in %\n",
      "print \"Full laod Efficiency = %0.2f %%\" %Eff"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Gross mechanical power devloped = 25850.00 W\n",
        "Rotor Copper Losses = 1650.00 W\n",
        "Rotor resistance per phase = 0.13 ohm\n",
        "Full laod Efficiency = 82.49 %\n"
       ]
      }
     ],
     "prompt_number": 112
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.14 Page 52"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "Pout=24 #in KW\n",
      "P=8 #no. of poles\n",
      "N=720 #in rpm\n",
      "VL=415 #in volt\n",
      "IL=57 #in Ampere\n",
      "f=50 #in Hz\n",
      "phase=3 #no. of phase\n",
      "cosfi=0.707 #power factor\n",
      "MechLoss=1000 #in watts\n",
      "Rs=0.1 #in ohm/phase\n",
      "\n",
      "#Calculations\n",
      "Ns=120*f/P #in rpm\n",
      "S=(Ns-N)/Ns #slip\n",
      "Pm=Pout*1000+MechLoss #in watts\n",
      "#formula-:  P2:Pc:Pm=1:S:1-S\n",
      "#Pc=S*Pm/(1-S) #copper loss in Watts\n",
      "Tsh=Pout*10**3/(2*pi*N/60) #in N-m\n",
      "print \"Shaft Torque = %0.3f N-m\" %Tsh\n",
      "T=Pm/((2*pi*N/60)) #in N-m\n",
      "print \"Gross torque devloped = %0.3f N-m\"%T\n",
      "Pc=S*Pm/(1-S) #copper loss in Watts\n",
      "print \"Rotor Cu losses = %0.2f W\" %Pc\n",
      "P2=Pc/S #in watts\n",
      "Pin=sqrt(3)*VL*IL*cosfi #in watts\n",
      "Is=IL #stator current per phase in Ampere\n",
      "StatorCuLoss=3*Is**2*Rs #in watts\n",
      "print \"Stator Copper losses = %0.2f W\" %StatorCuLoss\n",
      "StatorLosses=Pin-P2 #in watts\n",
      "StatorIronLoss=StatorLosses-StatorCuLoss #in watts\n",
      "print \"Stator Iron losses = %0.2f W\" %StatorIronLoss\n",
      "Eff=Pout*10**3/Pin*100 #in %\n",
      "print \"Efficiency = %0.2f %%\" %Eff"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Shaft Torque = 318.310 N-m\n",
        "Gross torque devloped = 331.573 N-m\n",
        "Rotor Cu losses = 1041.67 W\n",
        "Stator Copper losses = 974.70 W\n",
        "Stator Iron losses = 1950.60 W\n",
        "Efficiency = 82.85 %\n"
       ]
      }
     ],
     "prompt_number": 113
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.15 Page 54"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import cmath\n",
      "from numpy import array, sqrt, pi\n",
      "from math import degrees, cos\n",
      "# Given data\n",
      "Poles=12 #no. of poles\n",
      "V1=420 #in volt\n",
      "f=50 #in Hz\n",
      "r1=2.95 #in watts\n",
      "x1=6.82 #in watts\n",
      "r2dash=2.08 #in watts\n",
      "x2dash=4.11 #in ohm/phase\n",
      "ImLine=6.7 #in Ampere\n",
      "TcoreLoss=269 #in watts\n",
      "S=3 #slip in %\n",
      "\n",
      "#Calculations\n",
      "S=S/100 #slip\n",
      "Im=ImLine/sqrt(3) #in Ampere\n",
      "Im_bar=Im*cmath.exp(1J*(-pi/2))*(r1+1J*x1) #in Ampere\n",
      "\n",
      "\n",
      "from sympy import symbols, solve\n",
      "E1 = symbols('E1')\n",
      "V1 = E1+Im_bar\n",
      "#V1=(E1+real(Im_bar))+imag(Im_bar) \n",
      "#Equating magnitude of both sides gives a polynomial for E1\n",
      "V1=420 # Volt\n",
      "poly = (E1+Im_bar.real)**2+Im_bar.imag**2-V1**2\n",
      "E1 = solve(poly, E1)\n",
      "E1 = E1[1] # V # #discarding -ve value\n",
      "Xo=E1/Im #in ohm\n",
      "\n",
      "#Zeq=Xo*exp(1J*(pi/2))*(r2dash/S)/(1J*Xo+1J*x2dash+r2dash/S) \n",
      "Zeq = complex(0,Xo)*complex(r2dash/S,x2dash)/(complex(0,Xo)+complex(r2dash/S,x2dash))\n",
      "Zin=r1+1J*x1+Zeq #in ohm\n",
      "I1=V1/Zin #in Ampere\n",
      "print \"Input current : Magnitude =\",round(abs(I1),3),\" & phase =\",round(degrees(cmath.phase(I1)),2) ,\"degree\"\n",
      "# Note : In the textbook +ve sign of phase is shown by mistake.\n",
      "cosfi=cos(round(degrees(cmath.phase(I1)),2)*pi/180) #lagging power factor\n",
      "print \"Power factor =\",round(cosfi,4),\"lagging\" \n",
      "I2r_dash=I1*complex(0,Xo)/complex(r2dash,(Xo+x2dash)) #in Ampere\n",
      "print \"Rotor current : Magnitude =\",round(abs(I2r_dash),3),\" & phase =\",round(degrees(cmath.phase(I2r_dash)),2) ,\"degree\"\n",
      "Ns=120*f/Poles #in rpm\n",
      "T=9.55*3*I2r_dash.real**2*r2dash/S/Ns #in N-m\n",
      "print \"Torque developed =\",round(T,3),\"N-m\" \n",
      "Zth=complex(r1,x1)*complex(0,Xo)/(complex(r1,x1)+complex(0,Xo)) #in Ohm\n",
      "Rth=Zth.real #in ohm\n",
      "Xth=Zth.imag #in ohm\n",
      "Vth=V1*complex(0,Xo)/complex(r1,(Xth+Xo)) #in Volt\n",
      "Ws=(2*pi*Ns/60) #in rad/sec\n",
      "Tm=(3/Ws)*0.5*(Vth.real)**2/(Rth+sqrt(Rth**2+(Xth+x2dash)**2)) #in N-m\n",
      "print \"Maximum torque devloped = %0.2f N-m \"%(Tm) \n",
      "Sm=r2dash/sqrt(Rth**2+(Xth+x2dash)**2) #slip\n",
      "Nm=Ns*(1-Sm) #\n",
      "print \"Speed at maximum torque = %0.1f rpm\" %Nm \n",
      "#Answer for rotor equivalent Current and Torque developed is wrong in the book."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Input current : Magnitude = 6.732  & phase = -40.04 degree\n",
        "Power factor = 0.7656 lagging\n",
        "Rotor current : Magnitude = 6.469  & phase = -38.91 degree\n",
        "Torque developed = 100.678 N-m\n",
        "Maximum torque devloped = 331.11 N-m \n",
        "Speed at maximum torque = 404.4 rpm\n"
       ]
      }
     ],
     "prompt_number": 114
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.16 Page 57"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import acos, atan\n",
      "from cmath import exp\n",
      "# Given data\n",
      "V=440 #in volt\n",
      "P=8 #no. of poles\n",
      "Pout=40 #in KW\n",
      "f=50 #in Hz\n",
      "phase=3 #no. of phase\n",
      "R1=0.1 #in ohm\n",
      "X1=0.4 #in ohm\n",
      "R2dash=0.15 #Equivalent rotor resistance in ohm\n",
      "X2dash=0.44 #Equivalent rotor reactance in ohm\n",
      "I0=20*exp(1J*-acos(0.09)) #in Ampere\n",
      "N=727.5 #in rpm\n",
      "MechLoss=1000 #in watts\n",
      "CoreLoss=1250 #in watts\n",
      "\n",
      "#Calculations\n",
      "Ns=120*f/P #in rpm\n",
      "S=(Ns-N)/Ns #slip\n",
      "RLdash=R2dash*(1-S)/S\n",
      "V1=V/sqrt(3) #in volt\n",
      "R1e=R1+R2dash #in ohm\n",
      "X1e=X1+X2dash #in ohm\n",
      "I2rdash=V1/(R1e+RLdash+1J*X1e) #in Ampere\n",
      "I1bar=I0+I2rdash #in Ampere\n",
      "InputCurrent=abs(I1bar) #in Ampere\n",
      "InputPF=cos(atan((I1bar.imag)/(I1bar.real))) #\n",
      "print \"(i) Input Current = %0.3f Ampere & PF = %0.4f lagging\" %(InputCurrent,InputPF)\n",
      "T=3*abs(I2rdash)**2*R2dash/S/(2*pi*Ns/60) #in N-m\n",
      "print \"(ii) Torque Developed = %0.4f N-m\"%T\n",
      "P2=3*abs(I2rdash)**2*R2dash/S #in Watts\n",
      "#Formula : P2:Pc:Pm=1:S:1-S\n",
      "Pm=(1-S)*P2 #in Watts\n",
      "TotPout=Pm-MechLoss #in watts\n",
      "print \"(iii) Output power = %0.2f Watts\" %TotPout\n",
      "TotCuLoss=3*abs(I2rdash)**2*R1e #in watts\n",
      "Eff=TotPout/(TotPout+TotCuLoss+CoreLoss+MechLoss)*100 #in %\n",
      "print \"(iv) Efficiency = %0.2f %%\" %Eff"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) Input Current = 57.518 Ampere & PF = 0.8744 lagging\n",
        "(ii) Torque Developed = 461.3394 N-m\n",
        "(iii) Output power = 34146.51 Watts\n",
        "(iv) Efficiency = 89.37 %\n"
       ]
      }
     ],
     "prompt_number": 115
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.17 Page 59"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "Z1=0.07+1J*0.4 #in ohm\n",
      "Z2dash=0.08+1J*0.2 #in ohm\n",
      "V1_line=200 #in volt\n",
      "\n",
      "#Calculations\n",
      "R1=Z1.real #in ohm\n",
      "X1=Z1.imag #in ohm\n",
      "R2dash=Z2dash.real #in ohm\n",
      "X2dash=Z2dash.imag #in ohm\n",
      "R1e=R1+R2dash #in ohm\n",
      "X1e=X1+X2dash #in ohm\n",
      "Z1e=R1e+1J*X1e #in ohm\n",
      "Z1e_mag=abs(Z1e) #magnitude of Z1e in ohm\n",
      "V1PerPhase=V1_line/sqrt(3) #in volt\n",
      "Pout_max=3*V1PerPhase**2/2/(R1e+Z1e) #\n",
      "S=R2dash/(R2dash+Z1e_mag) #\n",
      "print \"Slip = %0.2f %% \"%(S*100)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Slip = 11.45 % \n"
       ]
      }
     ],
     "prompt_number": 116
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.18 Page 59"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=4 #in poles\n",
      "f=50 #in Hz\n",
      "Pout=30 #in HP\n",
      "VL=400 #in volt\n",
      "Eta=0.8 #Efficiency\n",
      "cosfi=0.75 #lagging power factor\n",
      "\n",
      "#Calculations\n",
      "Pout=Pout*735.5 #in Watts\n",
      "Pin=Pout/Eta #in Watts\n",
      "#Formula : Pin=sqrt(3)*VL*IL*cosfi\n",
      "IL=Pin/sqrt(3)/VL/cosfi #in Ampere\n",
      "print \"Current by the mains = %0.2f A\" %IL"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Current by the mains = 53.08 A\n"
       ]
      }
     ],
     "prompt_number": 117
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.19 Page 60"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=4 #in poles\n",
      "Pout=37 #in HP\n",
      "f=50 #in Hz\n",
      "N=1425 #in rpm\n",
      "MechLoss=3 #in HP\n",
      "StatorLoss=2500 #in watts\n",
      "VL=500 #in volt\n",
      "cosfi=0.9 #power factor\n",
      "\n",
      "#Calculations\n",
      "Ns=120*f/P #in rpm\n",
      "S=(Ns-N)/Ns #slip\n",
      "print \"(i) Slip is :  \" ,S\n",
      "Pout=Pout*735.5 #in Watts\n",
      "MechLoss=MechLoss*735.5 #in Watts\n",
      "Pin=Pout+MechLoss #in Watts\n",
      "#Formula : P2:Pc:Pin=1:5:1-S\n",
      "Pc=(S/(1-S))*Pin #in watts\n",
      "print \"(ii) Rotor Cu Loss = %0.2f W\" %Pc\n",
      "P2=Pc/S #in Watts\n",
      "Pin=P2+StatorLoss #in watts\n",
      "print \"(iii) Total power input = %0.2f W\" %Pin\n",
      "Eta=Pout/Pin*100 #in %\n",
      "print \"(iv) Efficiency = %0.2f %% \"%Eta \n",
      "fr=S*f #in Hz\n",
      "fr=fr*60 #in cycles/min\n",
      "print \"(v) No. of cycles per minute : \" ,fr\n",
      "#Part (ii) & (iii) answer is wrong in the book."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) Slip is :   0.05\n",
        "(ii) Rotor Cu Loss = 1548.42 W\n",
        "(iii) Total power input = 33468.42 W\n",
        "(iv) Efficiency = 81.31 % \n",
        "(v) No. of cycles per minute :  150.0\n"
       ]
      }
     ],
     "prompt_number": 118
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.20 Page 61"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "E2line=60 #in Volt\n",
      "R2=0.6 #in ohm\n",
      "X2=4 #in ohm\n",
      "Rx=5 #in ohm\n",
      "Xx=2 #in ohm\n",
      "S=4 #in %\n",
      "\n",
      "#Calculations\n",
      "E2ph=E2line/sqrt(3) #in volt\n",
      "ZT=R2+1J*X2+Rx+1J*Xx #\n",
      "I2=E2ph/abs(ZT) #in Ampere\n",
      "print \"(i) Rotor Current per phase = %0.4f A\" %I2\n",
      "S=S/100 #slip\n",
      "Z2r=R2+1J*S*X2 #in ohm\n",
      "I2r=S*E2ph/abs(Z2r) #in Ampere\n",
      "print \"(ii) Rotor Current per phase = %0.4f Ampere \"%I2r "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) Rotor Current per phase = 4.2207 A\n",
        "(ii) Rotor Current per phase = 2.2314 Ampere \n"
       ]
      }
     ],
     "prompt_number": 119
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.21 Page 62"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=4 #no. of poles\n",
      "f=50 #in Hz\n",
      "P2=3000 #in watts\n",
      "\n",
      "#Calculations\n",
      "Ns=120*f/P #in rpm\n",
      "T=P2/(2*pi*Ns/60) #in N-m\n",
      "print \"Torque Devloped = %0.3f N-m \"%T \n",
      "T=T*(2*pi*Ns/60) #in syn. Watt\n",
      "print \"Torque Devloped = %0.f syn. Watt \"%T "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Torque Devloped = 19.099 N-m \n",
        "Torque Devloped = 3000 syn. Watt \n"
       ]
      }
     ],
     "prompt_number": 120
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.22 Page 62"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "E1Line=1000 #in volt\n",
      "R2=0.01 #in ohm\n",
      "X2=0.2 #in ohm\n",
      "I2st=200 #in Ampere\n",
      "ratio=3.6 #ratio of stator to rotor turns\n",
      "\n",
      "#Calculations\n",
      "K=1/ratio #ratio of rotor to stator turns\n",
      "E1ph=E1Line/sqrt(3) #in Volt\n",
      "E2ph=K*E1ph #in volt\n",
      "#Let R2dash=R2+Rx\n",
      "#Formula : I2st=E2ph/sqrt(R2dash**2+X2**2) \n",
      "R2dash=sqrt((E2ph/I2st)**2-X2**2)\n",
      "Rx=R2dash-R2 #in ohm\n",
      "print \"External resistance required per phase = %0.4f ohm \"%Rx "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "External resistance required per phase = 0.7665 ohm \n"
       ]
      }
     ],
     "prompt_number": 121
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.23 Page 63"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "VL=400 #in volt\n",
      "E1Line=VL #in volt\n",
      "P=4 #no. of poles\n",
      "S=5 #in %\n",
      "f=50 #in Hz\n",
      "R2=0.15 #in ohm\n",
      "X2=1 #in ohm\n",
      "ratio=2 #ratio of stator to rotor turns\n",
      "\n",
      "#Calculations\n",
      "S=S/100 #slip\n",
      "E1ph=E1Line/sqrt(3) #in Volt\n",
      "K=1/ratio #ratio of rotor to stator turns\n",
      "E2ph=K*E1ph #in volt\n",
      "Ns=120*f/P #in rpm\n",
      "ns=Ns/60 #in rps\n",
      "T=(3/2/pi/ns)*S*E2ph**2*R2/(R2**2+(S*X2)**2) #in N-m\n",
      "print \"(i) Total Torque devloped = %0.2f N-m \"%T \n",
      "Tm=(3/2/pi/ns)*E2ph**2/2/X2 #in N-m\n",
      "print \"(ii) Maximum Torque = %0.2f N-m\"%Tm \n",
      "Sm=R2/X2 #maximum slip\n",
      "N=Ns*(1-Sm) #in rpm\n",
      "print \"(iii) Speed at maximum torque = %0.2f rpm \"%N "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) Total Torque devloped = 76.39 N-m \n",
        "(ii) Maximum Torque = 127.32 N-m\n",
        "(iii) Speed at maximum torque = 1275.00 rpm \n"
       ]
      }
     ],
     "prompt_number": 122
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.24 Page 64"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import cos, atan\n",
      "# Given data\n",
      "VL=400 #in volt\n",
      "f=50 #in Hz\n",
      "P=6 #no. of poles\n",
      "Z1=0.3+1J*0.4 #in ohm\n",
      "Z2dash=0.2+1j*0.4 #in ohm\n",
      "X0=20 #Magnetic reactance in ohm\n",
      "R0=100 #resistance for core loss in ohm\n",
      "S=4 #in %\n",
      "StatorLoss=2 #in KW\n",
      "MechLoss=2 #in KW\n",
      "#Calculations\n",
      "R1=Z1.real #in ohm\n",
      "R2dash=Z2dash.real #in ohm\n",
      "X1=Z1.imag #in ohm\n",
      "X2dash=Z2dash.imag #in ohm\n",
      "S=S/100 #slip\n",
      "V1=VL/sqrt(3) #in volt\n",
      "Ns=120*f/P #in rpm\n",
      "Ri=R2dash*(1-S)/S #in ohm\n",
      "R1e=R1+R2dash #in ohm\n",
      "X1e=X1+X2dash #in ohm\n",
      "I2rdash=V1/(R1e+Ri+1J*X1e) #in Ampere\n",
      "Ic=V1/R0 #in Ampere\n",
      "Im=V1/(1J*X0) #in Ampere\n",
      "I0=(Ic+Im) #in Ampere\n",
      "CoreLoss=Ic**2*R0 #Core loss per phase in Watts\n",
      "I1=I0+I2rdash #in Ampere\n",
      "Istator=abs(I1) #in Ampere\n",
      "cosfi=cos(atan(I1.imag/I1.real)*pi/180) #lagging power factor\n",
      "\n",
      "Pc=3*abs(I2rdash)**2*R2dash #in Watts\n",
      "#Here P2:P0:Pm=1:S:1-S\n",
      "Pm=Pc*(1-S)/S #in watts\n",
      "Pout=Pm-MechLoss*1000 #in watts\n",
      "StatorCuLoss=3*abs(I1)**2*R1 #in watts\n",
      "TotLoss=CoreLoss*3+StatorCuLoss+Pc+MechLoss*1000 #in watts\n",
      "Eff=Pout/(Pout+TotLoss)*100 #in %\n",
      "N=Ns*(1-S) #in rpm\n",
      "print \"(a) Motor Speed = %0.2f rpm \"%N\n",
      "print \"(b) Stator current = %0.2f Ampere \"%Istator \n",
      "print \"(c) Power factor lagging : \" ,round(cosfi,5)\n",
      "print \"(d) Motor Output = %0.2f W\" %Pout\n",
      "print \"(e) Efficiency = %0.2f %% \"%Eff \n",
      "#Answer of Pout & PF is wrong in the book."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Motor Speed = 960.00 rpm \n",
        "(b) Stator current = 48.38 Ampere \n",
        "(c) Power factor lagging :  0.99998\n",
        "(d) Motor Output = 24731.64 W\n",
        "(e) Efficiency = 78.38 % \n"
       ]
      }
     ],
     "prompt_number": 123
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.25 Page 66"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "V=440 #in volt\n",
      "f=50 #in Hz\n",
      "P=4 #no. of poles\n",
      "X1=5.2 #in ohm\n",
      "R2dash=1.2 #in ohm\n",
      "X2dash=4.5 #in ohm\n",
      "\n",
      "#Calculations\n",
      "#Rth=R1 #in ohm\n",
      "#Xth=X1 #in ohm\n",
      "#Formula : R2dash/Sm=sqrt(X1**2+X2dash**2)\n",
      "Sm=R2dash/(X1+X2dash) #Maximum Slip\n",
      "I1=V/sqrt(3)/sqrt((R2dash/Sm)**2+(X1+X2dash)**2) #in Ampere\n",
      "I2dash=I1 #in Ampere(Neglecting I0)\n",
      "Ns=120*f/P #in rpm\n",
      "Tmax=3*I2dash**2*R2dash/Sm/2/pi/Ns*60 #in N-m\n",
      "print \"Maximum Torque = %0.2f N-m \"%Tmax \n",
      "print \"Maximum Slip = %0.2f %% \"%(Sm*100) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum Torque = 63.53 N-m \n",
        "Maximum Slip = 12.37 % \n"
       ]
      }
     ],
     "prompt_number": 124
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.26 Page 67"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "from sympy import symbols, solve\n",
      "R2dash = symbols('R2dash')\n",
      "# Given data\n",
      "f=50 #in Hz\n",
      "P=4 #no. of poles\n",
      "X2=0.1 #in ohm\n",
      "R2=0.02 #in ohm\n",
      "#Tst=2/3*Tmax\n",
      "TstByTm=2/3 #ratio\n",
      "#Calculations\n",
      "#Tm proportional to E2**2/(2*X2)\n",
      "#formula : TstByTm=(E2**2*R2dash/(R2dash**2+X2**2))/(E2**2/(2*X2))\n",
      "expr = (R2dash**2)*TstByTm-2*X2*R2dash+TstByTm*X2**2\n",
      "R2dash=solve(expr, R2dash) #\n",
      "R2dash=R2dash[0] #discarding higher value bcoc R2dash < X2\n",
      "Rex=R2dash-R2 #in ohm\n",
      "print \"Extra resistance required = %0.3f ohm \"%Rex "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Extra resistance required = 0.018 ohm \n"
       ]
      }
     ],
     "prompt_number": 125
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.27 Page 68"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "VL=3300 #in volt\n",
      "f=50 #in Hz\n",
      "P=10 #no. of poles\n",
      "X2=0.25 #in ohm\n",
      "R2=0.015 #in ohm\n",
      "Sfl=2.5 #Slip in %\n",
      "\n",
      "#Calculations\n",
      "Ns=120*f/P #in rpm\n",
      "N=Ns*(1-Sfl/100) #in rpm\n",
      "print \"(1.) The speed of motor, N = %0.2f rpm \"% N \n",
      "Sm=R2/X2 #Max Slip\n",
      "Nm=Ns*(1-Sm) #Max speed in rpm\n",
      "print \"(2.) Speed of motor, Ns = %0.2f rpm\"%Nm \n",
      "TmByTfl=Sm*R2/(R2**2+(Sm*X2)**2)*(R2**2+(Sfl/100*X2)**2)/(Sfl/100)/R2 #ratio\n",
      "print \"(3.) Ratio of max torque to full load torque : \" ,round(TmByTfl,4)\n",
      "#Answer of 1st part is wrong in the book."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(1.) The speed of motor, N = 585.00 rpm \n",
        "(2.) Speed of motor, Ns = 564.00 rpm\n",
        "(3.) Ratio of max torque to full load torque :  1.4083\n"
       ]
      }
     ],
     "prompt_number": 126
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.28 Page 69"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sin, acos, degrees\n",
      "from cmath import phase\n",
      "# Given data\n",
      "\n",
      "V0=400 #in volt\n",
      "f=50 #in Hz\n",
      "P=10 #no. of poles\n",
      "R1=1.75 #in ohm\n",
      "X1=5.5 #in ohm\n",
      "R2dash=2.25 #in ohm\n",
      "X2dash=6.6 #in ohm\n",
      "I0=3.8 #in Ampere\n",
      "W0=310 #in watts\n",
      "S=4 #in %\n",
      "\n",
      "#Calculations\n",
      "S=S/100 #slip in ratio\n",
      "#Formula : W0=sqrt(3)*V0*I0*cos_fi0\n",
      "cos_fi0=W0/sqrt(3)/V0/I0 #power factor\n",
      "sin_fi0=sin(acos(cos_fi0)*pi/180) \n",
      "Ic=I0*cos_fi0 #in Ampere\n",
      "Im=I0*sin_fi0 #in Ampere\n",
      "Vph=V0/sqrt(3) #in Volt\n",
      "R0=Vph/Ic #in ohm\n",
      "X0=Vph/Im #in ohm\n",
      "Ns=120*f/P #in rpm\n",
      "RLdash=R2dash*(1-S)/S #in ohm\n",
      "R1e=R1+R2dash #in ohm\n",
      "X1e=X1+X2dash #in ohm\n",
      "I2rdash=Vph/(R1e+RLdash+1J*X1e) #in Ampere\n",
      "print \"Rotor Current : Magnitude =\",round(abs(I2rdash),3),\"A & Phase =\",round(degrees(phase(I2rdash)),2),\"degree\"\n",
      "I0_bar=Ic-1J*Im #in Ampere\n",
      "I1_bar=I0_bar+I2rdash #Supply current in Ampere\n",
      "print \"Supply Current : Magnitude =\",round(abs(I1_bar),3),\"A & Phase =\",round(degrees(phase(I1_bar)),2),\"degree\"\n",
      "cosfi=cos(pi/180*atan((I1_bar.imag)/(I1_bar.real))) #Lagging power factor\n",
      "print \"Power factor = %0.4f lagging  \"%cosfi\n",
      "Pc=3*abs(I2rdash)**2*R2dash #in watts\n",
      "#Formula : P2:Pc:Pm=1:S:1-S\n",
      "Pm=Pc*(1-S)/S ##in watts\n",
      "print \"Mechanical power devloped = %0.2f N-m \"%Pm \n",
      "N=Ns*(1-S) #in rpm\n",
      "w=2*pi*N/60 #in rad/sec\n",
      "T=Pm/w #in N-m\n",
      "print \"Gross load torque = %0.3f N-m  \"%T \n",
      "# Supply current and power factor ans is wrong in te textbook."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Rotor Current : Magnitude = 3.898 A & Phase = -11.78 degree\n",
        "Supply Current : Magnitude = 4.356 A & Phase = -11.82 degree\n",
        "Power factor = 1.0000 lagging  \n",
        "Mechanical power devloped = 2461.25 N-m \n",
        "Gross load torque = 40.804 N-m  \n"
       ]
      }
     ],
     "prompt_number": 127
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.29 Page 70\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "PA=12 #no. of poles\n",
      "Ns=500 #in rpm\n",
      "N=1440 #in rpm\n",
      "\n",
      "#Calculations\n",
      "#Formula : Ns=120*f/PA\n",
      "f=Ns/120*PA #in Hz\n",
      "PM=4 #assumed for motor\n",
      "Ns=120*f/PM #in rpm(For motor)\n",
      "S=(Ns-N)/Ns*100 #slip in %\n",
      "print \"Slip = %0.2f %% \"%S "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Slip = 4.00 % \n"
       ]
      }
     ],
     "prompt_number": 128
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.30 Page 71"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "R2=0.04 #in ohm\n",
      "X2=0.2 #in ohm\n",
      "TstByTm=50 #in %\n",
      "\n",
      "#Calculations\n",
      "Sm=1 #slip for max Torque\n",
      "R2dash=Sm*X2 #in ohm\n",
      "Rx=R2dash-R2 #in ohm\n",
      "print \"(i) External resistance required for max Torque = %0.2f ohm\"%Rx \n",
      "TstByTm=TstByTm/100 #in ratio\n",
      "#Formula : Tst proportional to E2**2*R2dash/(R2dash**2+X2**2)\n",
      "#Formula : Tm Proportional to E2**2/2/X2\n",
      "from sympy import symbols, solve\n",
      "R2dash = symbols('R2dash')\n",
      "expr = R2dash**2+X2**2-2*X2*R2dash/TstByTm#Polynomial for R2dash\n",
      "R2dash=solve(expr, R2dash) #\n",
      "R2dash=R2dash[0] #discarding higher value bcoc R2dash < X2\n",
      "Rx=R2dash-R2 #in ohm\n",
      "print \"(ii) Extra resistance required for 50%% max Torque at start = %0.4f ohm\"%Rx "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) External resistance required for max Torque = 0.16 ohm\n",
        "(ii) Extra resistance required for 50% max Torque at start = 0.0136 ohm"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n"
       ]
      }
     ],
     "prompt_number": 129
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.31 Page 72"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "f=50 #in Hz\n",
      "P=8 #no. of poles\n",
      "Sf=40 #in %\n",
      "R2=0.001 #in ohm/phase\n",
      "X2=0.005 #in ohm/phase\n",
      "\n",
      "#Calculations\n",
      "Sf=Sf/100 #slip\n",
      "#Formula : T proportional to S*R2/(R2**2+(S*X2)**2)\n",
      "Sm=R2/X2 #slip for max Torque\n",
      "TmByTfl=Sm*R2/(R2**2+(Sm*X2)**2)*(R2**2+(Sf*X2)**2)/Sf/R2 #in ratio\n",
      "print \"Ratio of max torque to full load torque :  \" ,TmByTfl\n",
      "Ns=120*f/P #in rpm\n",
      "N=Ns*(1-Sm) #in rpm\n",
      "print \"Speed for maximum torque = %0.2f rpm \"%N "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Ratio of max torque to full load torque :   1.25\n",
        "Speed for maximum torque = 600.00 rpm \n"
       ]
      }
     ],
     "prompt_number": 130
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.32 Page 73"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "f=50 #in Hz\n",
      "P=4 #no. of poles\n",
      "VL=400 #in volt\n",
      "E2=100 #in volt\n",
      "R2=50 #in milli ohm\n",
      "X2=0.5 #in ohm\n",
      "\n",
      "#Calculations\n",
      "R2=R2*10**-3 #in ohm\n",
      "Sm=R2/X2 #Maximum Slip\n",
      "ns=(120*f/P)/60 #in rpS\n",
      "Tmax=3/2/pi/ns*Sm*E2**2*R2/(R2**2+(Sm*X2)**2) #in N-m\n",
      "print \"Maximum Torque = %0.2f N-m  \"%Tmax \n",
      "print \"Slip at which Tmax occur : \" ,Sm"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum Torque = 190.99 N-m  \n",
        "Slip at which Tmax occur :  0.1\n"
       ]
      }
     ],
     "prompt_number": 131
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.33 Page 73"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given data\n",
      "#Tst=100% of Tfl #in %\n",
      "#Tm=100% of Tfl #in %\n",
      "TstByTfl=100/100 #ratio\n",
      "TmByTfl=200/100 #ratio\n",
      "\n",
      "#Calculations\n",
      "#Formula : T proportional to S*E2**2*R2/(R2**2+(S*X2)**2)\n",
      "#Formula : TstByTm=2*Sm/(Sm**2+1)\n",
      "TstByTm=TstByTfl/TmByTfl #Calculating TstByTm\n",
      "\n",
      "\n",
      "from sympy import symbols, solve, N\n",
      "Sm, Sfl = symbols('sm, Sfl')\n",
      "expr = Sm**2-4*Sm+1#Polynomial for R2dash\n",
      "Sm=solve(expr, Sm) #\n",
      "Sm=Sm[0] #Discarding value > 1\n",
      "print \"Slip at which max Torque occurs = %0.2f %%\"%(Sm*100) \n",
      "#Formula : 1/TstByTm=(Sm**2+Sfl**2)/(2*Sm*Sfl)\n",
      "Expr = Sm**2+Sfl**2-2*(2*Sm*Sfl)\n",
      "Sfl=solve(Expr,Sfl) \n",
      "Sfl=Sfl[0] #Discarding value >= 1\n",
      "print \"Full load slip = \",N(Sfl*100,4) ,\"%\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Slip at which max Torque occurs = 26.79 %\n",
        "Full load slip = "
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " 7.180 %\n"
       ]
      }
     ],
     "prompt_number": 132
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.34 Page 74"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=8 #no. of Poles\n",
      "f=50 #in Hz\n",
      "Tm=150 #in N-m\n",
      "N=650 #in rpm\n",
      "R2=0.6 #in ohm\n",
      "S=4 #in %\n",
      "\n",
      "#Calculations\n",
      "S=S/100 #Slip\n",
      "Ns=120*f/P #in rpm\n",
      "Sm=(Ns-N)/Ns #Maximum Slip\n",
      "#Formula : T proportional to S*E2**2*R2/(R2**2+(S*X2)**2)\n",
      "X2=R2/Sm #in ohm\n",
      "T=Tm*S*(R2**2+(Sm*X2)**2)/Sm/(R2**2+(S*X2)**2) #In N-m\n",
      "print \"Torque at 4%% slip = %0.4f N-m  \"%T "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Torque at 4% slip = 82.5688 N-m  \n"
       ]
      }
     ],
     "prompt_number": 133
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.35 Page 75"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import atan, cos\n",
      "# Given data\n",
      "V=400 #in volts\n",
      "P=4 #no. of Poles\n",
      "f=50 #in Hz\n",
      "r1=0.15 #in ohm\n",
      "x1=0.44 #in ohm\n",
      "r2dash=0.12 #in ohm\n",
      "x2dash=0.44 #in ohm\n",
      "xm=30 #in ohm\n",
      "S=4 #in %\n",
      "\n",
      "#Calculations\n",
      "S=S/100 #Slip\n",
      "RLdash=r2dash*(1-S)/S #in ohm\n",
      "V1=V/sqrt(3) #in volt\n",
      "I2rdash=V1/(r1+r2dash+RLdash+1J*(x1+x2dash)) #in Ampere\n",
      "I0=V1/(1J*xm) #in Ampere\n",
      "I1=I0+I2rdash #in Ampere\n",
      "print \"Stator Current in Ampere : \" \n",
      "print \"Magnitude is %0.3f A\"%(abs(I1)),\" & angle = %0.2f degree\"%degrees((atan((I1.imag)/(I1.real))) )\n",
      "cosfi=cos(atan((I1.imag)/(I1.real))) #lagging power factor\n",
      "print \"Power factor = %0.4f lagging \"%cosfi "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Stator Current in Ampere : \n",
        "Magnitude is 73.059 A  & angle = -21.43 degree\n",
        "Power factor = 0.9308 lagging \n"
       ]
      }
     ],
     "prompt_number": 134
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.36 Page 76"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "VL=440 #in volts\n",
      "P=4 #no. of Poles\n",
      "f=50 #in Hz\n",
      "#Zleak=0.3+%i*5.5+0.25/S #in ohm/phase\n",
      "K=2.5 #Stator to rotor voltage ratio\n",
      "T=150 #in N-m\n",
      "N=1250 #in rpm\n",
      "R1 = 0.1 # ohm\n",
      "X1e = 1.83 # ohm\n",
      "\n",
      "\n",
      "#Calculations\n",
      "Ns=120*f/P #in rpm\n",
      "S=(Ns-N)/Ns #slip\n",
      "Zleakage=1/3*(0.3+1J*5.5+0.25/S) #in ohm/phase\n",
      "V1=VL/sqrt(3) #in volt\n",
      "\n",
      "from sympy import symbols, solve\n",
      "R2x = symbols('R2x')\n",
      "#expr = R2x**2*T*S*2*pi*ns/S**2+R2x*T*S*(2*pi*ns*0.2/S+T*S*2*pi*ns*0.01+T*S*2*pi*ns*1.83**2-3*(V1**2)*R2x) #equating\n",
      "#R2x**2*T*S*2*pi*ns/S**2+R2x*T*S*2*pi*ns*0.2/S+T*S*2*pi*ns*0.01+T*S*2*pi*ns*1.83**2-3*(V1**2)*R2x=0 #equating\n",
      "Idash_2r_sqr = V1**2/((R1*R2x/S)**2+X1e**2)\n",
      "expr = 35.856*R2x**2-48*R2x+3.3589\n",
      "R2x = solve(expr, R2x)\n",
      "R2x = R2x[1] # discarding lower value\n",
      "ns=Ns/60 #in rps\n",
      "#P=[T*S*2*pi*ns/S**2 T*S*2*pi*ns*0.2/S-3*(V1**2) T*S*2*pi*ns*0.01+T*S*2*pi*ns*1.83**2] #polynomial for value of R2xdash\n",
      "Rx_stator=R2x-0.083 #in ohm\n",
      "print \"External resistance referred to stator = %0.4f ohm \"%Rx_stator \n",
      "Rx_rotor=Rx_stator/K**2 #in ohm/phase\n",
      "print \"External resistance rotor side = %0.3f ohm/phase \"%Rx_rotor "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "External resistance referred to stator = 1.1816 ohm \n",
        "External resistance rotor side = 0.189 ohm/phase \n"
       ]
      }
     ],
     "prompt_number": 135
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.37 Page 77"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given data\n",
      "Nnl=1485 #in rpm\n",
      "Nfl=1350 #in rpm\n",
      "f=50 #in Hz\n",
      "\n",
      "#Calculations\n",
      "Ns=1500 #nearest syn speed to Nfl in rpm(Assumed)\n",
      "#Formula : Ns=120*f/P\n",
      "P=120*f/Ns #no. of poles\n",
      "print \"Part (i)\" \n",
      "print \"No. of poles : \" ,P\n",
      "Snl=(Ns-Nnl)/Ns #slip\n",
      "print \"Part (ii)\" \n",
      "print \"No load Slip = %0.2f %%\"%(Snl*100) \n",
      "Sfl=(Ns-Nfl)/Ns #slip\n",
      "print \"No load Slip = %0.2f %% \"%(Sfl*100) \n",
      "fr_nl=f*Snl #in Hz\n",
      "fr_fl=f*Sfl #in Hz\n",
      "print \"Part (iii)\" \n",
      "print \"No load frequency = %0.2f Hz  \"%fr_nl \n",
      "print \"Full load frequency = %0.2f Hz \"%fr_fl \n",
      "#Part (iv)\n",
      "print \"On No Load : \" \n",
      "N1=120*fr_nl/P #speed of rotor field with respect to rotor conductor in rpm\n",
      "print \"Speed of rotor field with respect to rotor conductor = %0.2f rpm  \"%N1 \n",
      "Rf_wrtS=1500 #in rpm\n",
      "Rf_wrtSF=0 #in rpm\n",
      "print \"Rotor field with respect to stator = %0.2f rpm\"%Rf_wrtS \n",
      "print \"Rotor field with respect to stator field = %0.2f rpm \"%Rf_wrtSF \n",
      "print \"On Full Load : \" \n",
      "N2=120*fr_fl/P #speed of rotor field with respect to rotor conductor in rpm\n",
      "print \"Speed of rotor field with respect to rotor conductor = %0.2f rpm \"%N2 \n",
      "Rf_wrtS=1500 #in rpm\n",
      "Rf_wrtSF=0 #in rpm\n",
      "print \"Rotor field with respect to stator = %0.2f rpm \"% Rf_wrtS \n",
      "print \"Rotor field with respect to stator field = %0.2f rpm  \"%Rf_wrtSF \n",
      "#Answer of no load slip is wrong in the book."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Part (i)\n",
        "No. of poles :  4.0\n",
        "Part (ii)\n",
        "No load Slip = 1.00 %\n",
        "No load Slip = 10.00 % \n",
        "Part (iii)\n",
        "No load frequency = 0.50 Hz  \n",
        "Full load frequency = 5.00 Hz \n",
        "On No Load : \n",
        "Speed of rotor field with respect to rotor conductor = 15.00 rpm  \n",
        "Rotor field with respect to stator = 1500.00 rpm\n",
        "Rotor field with respect to stator field = 0.00 rpm \n",
        "On Full Load : \n",
        "Speed of rotor field with respect to rotor conductor = 150.00 rpm \n",
        "Rotor field with respect to stator = 1500.00 rpm \n",
        "Rotor field with respect to stator field = 0.00 rpm  \n"
       ]
      }
     ],
     "prompt_number": 136
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.38 Page 78"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "VL=3.3 #in KV\n",
      "P=20 #no of poles\n",
      "f=50 #in Hz\n",
      "R2=0.025 #in ohm/phase\n",
      "X2=0.28 #in ohm/phase\n",
      "N=294 #Full load speed in rpm\n",
      "\n",
      "#Calculations\n",
      "Sm=R2/X2 #Max Slip\n",
      "print \"Slip at max torque = %0.2f %%\" %(Sm*100)\n",
      "Ns=120*f/P #in rpm\n",
      "Sfl=(Ns-N)/Ns #Full load slip\n",
      "#Formula : T proportional to S*E2**2*R2/(R2**2+(S*X2)**2)\n",
      "TmByTfl=Sm/(R2**2+(Sm*X2)**2)*((R2**2+(Sfl*X2)**2))/Sfl #ratio\n",
      "print \"Ratio of max to full load torqiue : \" ,round(TmByTfl,3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Slip at max torque = 8.93 %\n",
        "Ratio of max to full load torqiue :  2.344\n"
       ]
      }
     ],
     "prompt_number": 137
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.39 Page 79"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given data\n",
      "Pin=50 #in KW\n",
      "StatorLoss=800 #in watts\n",
      "f=50 #in Hz\n",
      "fr=90 #cycles/min\n",
      "\n",
      "#Calculations\n",
      "fr=fr/60 #in Hz\n",
      "S=fr/f #slip\n",
      "P2=Pin*1000-StatorLoss #watts\n",
      "#Formula : P2:Pc:Pm=1:S:1-S\n",
      "Pm=P2*(1-S) #in watts\n",
      "print \"Total Mechanical power devloped = %.f W\" %Pm"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Total Mechanical power devloped = 47724 W\n"
       ]
      }
     ],
     "prompt_number": 138
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.40 Page 79"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=4 #no. of poles\n",
      "VL=200 #in volt\n",
      "f=50 #in Hz\n",
      "R2=0.1 #in ohm/phase\n",
      "X2=0.9 #in ohm/phase\n",
      "S=4 #in %\n",
      "K=0.67 #rotor to stator turns  \n",
      "\n",
      "#Calculations\n",
      "S=S/100 #slip\n",
      "E1ph=VL/sqrt(3) #in volt\n",
      "E2ph=K*E1ph #in volt\n",
      "Ns=120*f/P #in rpm\n",
      "ns=Ns/60 #in rps\n",
      "T=3/2/pi/ns*S*E2ph**2*R2/(R2**2+(S*X2)**2) #in N-m\n",
      "print \"Total torque at 4%% slip = %0.4f N-m  \"%T\n",
      "Tm=3/2/pi/ns*E2ph**2/2/X2 #in N-m\n",
      "print \"Maximum torque developed = %0.4f N-m  \"%Tm\n",
      "Sm=R2/X2 #Max Slip\n",
      "Nm=Ns*(1-Sm) #in rpm\n",
      "print \"Speed at max Torque = %0.3f rpm \"%Nm \n",
      "Pmax=Tm*2*pi*Nm/60 #in watts\n",
      "print \"Maximum mechanical power = %0.4f W\" %Pmax"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Total torque at 4% slip = 40.4786 N-m  \n",
        "Maximum torque developed = 63.5064 N-m  \n",
        "Speed at max Torque = 1333.333 rpm \n",
        "Maximum mechanical power = 8867.1605 W\n"
       ]
      }
     ],
     "prompt_number": 139
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.41 Page 80"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=6 #no. of poles\n",
      "f=50 #in Hz\n",
      "Tsh=150 #in N-m\n",
      "fr=1.5 #in Hz\n",
      "Tlost=10 #in N-m\n",
      "\n",
      "#Calculations\n",
      "S=fr/f #slip\n",
      "Ns=120*f/P #in rpm\n",
      "N=Ns*(1-S) #in rpm\n",
      "RotationalLoss=Tlost*2*pi*N/60 #in watts\n",
      "Pout=Tsh*2*pi*N/60 #in watts\n",
      "Pm=Pout+RotationalLoss #in watts\n",
      "#Formula : P2:Pc:Pm=1:S:1-S\n",
      "Pc=Pm*S/(1-S) #in watts\n",
      "print \"Rotor Copper Loss = %0.4f W\" %Pc\n",
      "P2=Pc/S #in watts\n",
      "print \"Input to the rotor = %0.2f W\" %P2\n",
      "StatorLoss=700 #in watts(assumed)\n",
      "Pin=P2+StatorLoss #in watts]\n",
      "Eff=Pout/Pin*100 #in %\n",
      "print \"Efficiency = %0.2f %%\" %Eff"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Rotor Copper Loss = 502.6548 W\n",
        "Input to the rotor = 16755.16 W\n",
        "Efficiency = 87.29 %\n"
       ]
      }
     ],
     "prompt_number": 140
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.42 Page 81"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "Sfl=5 #in %\n",
      "IscByIfl=6 #ratio\n",
      "\n",
      "#Calculations\n",
      "Sfl=Sfl/100 #slip\n",
      "TstByTfl=1 #as Tfl=Tst\n",
      "#Let X= tapping on transformer\n",
      "X=sqrt(TstByTfl/(IscByIfl**2)/Sfl) #Tapping on transformer\n",
      "print \"Tapping on auto transformer : \" ,round(X,4)\n",
      "IstByIfl=X**2*IscByIfl #supply starting current to full load current \n",
      "print \"The supply starting current is\",round(IstByIfl,2),\"times of full load current.\" "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Tapping on auto transformer :  0.7454\n",
        "The supply starting current is 3.33 times of full load current.\n"
       ]
      }
     ],
     "prompt_number": 141
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.43 Page 81"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "TmByTfl=2.5 #ratio\n",
      "R2=0.4 #in ohm/phase\n",
      "X2=4 #in ohm/phase\n",
      "\n",
      "#Calculations\n",
      "#Formula : Tm=K*E2**2/2/X2 and Tst=K*E2**2*R2/(R2**2+X2**2)\n",
      "#E2=E2/sqrt(3) #for star delta starter\n",
      "TstByTfl=(TmByTfl*2*X2)*R2/(R2**2+X2**2)/3 #calculated from above equations\n",
      "print \"ratio of starting torque to full load torque is : \" ,round(TstByTfl,3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "ratio of starting torque to full load torque is :  0.165\n"
       ]
      }
     ],
     "prompt_number": 142
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.44 Page 82"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "Zouter=0.05+1J*0.10 #in ohm\n",
      "Zinner=0.01+1J*0.60 #in ohm\n",
      "S=3 #in %\n",
      "\n",
      "#Calculations\n",
      "R2o=(Zouter.real) #in ohm\n",
      "R2i=(Zinner.real) #in ohm\n",
      "X2o=(Zouter.imag) #in ohm\n",
      "X2i=(Zinner.imag) #in ohm\n",
      "S=S/100 #slip\n",
      "#Formula : T=3/2/pi/ns*(S*E2**2*R2/(R2**2+(S*X2)**2))\n",
      "S=1 #at starting\n",
      "TouterByTinner=R2o/R2i*(R2i**2+X2i**2)/(R2o**2+X2o**2) #\n",
      "print \"(i) Ratio of torque due to two cages at starting : \" ,round(TouterByTinner)\n",
      "S=3/100 #Slip at running\n",
      "TouterByTinner=R2o/R2i*(R2i**2+(S*X2i)**2)/(R2o**2+(S*X2o)**2) #\n",
      "print \"(ii) Ratio of torque due to two cages when running at 3% slip : \",round(TouterByTinner,5)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) Ratio of torque due to two cages at starting :  144.0\n",
        "(ii) Ratio of torque due to two cages when running at 3% slip :  0.84496\n"
       ]
      }
     ],
     "prompt_number": 143
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.45 Page 83"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "Zi=0.6+1J*7 #in ohm\n",
      "Zo=3.5+1J*1.5 #in ohm\n",
      "Sfl=6 #in %\n",
      "\n",
      "#Calculations\n",
      "#At starting S=1\n",
      "Ro=(Zo.real) #in ohm\n",
      "Ri=(Zi.real) #in ohm\n",
      "Xo=(Zo.imag) #in ohm\n",
      "Xi=(Zi.imag) #in ohm\n",
      "Zeq1=Zi*Zo/(Zi+Zo) #equivalent impedence in ohm\n",
      "Req1=(Zeq1.real) #in ohm\n",
      "#I2=V/Zeq\n",
      "#Tst=I2**2*R2 #in N-m\n",
      "\n",
      "#During full load\n",
      "S=Sfl/100 #slip \n",
      "Zi=Ri/S+1J*Xi #in ohm\n",
      "Zo=Ro/S+1J*Xo #in ohm\n",
      "Zeq2=Zi*Zo/(Zi+Zo) #equivalent impedence in ohm\n",
      "Req2=(Zeq2.real) #in ohm\n",
      "#I2=V/Zeq\n",
      "#Tfl=I2**2*R2 #in N-m\n",
      "TstByTfl=(1/abs(Zeq1)**2)/(1/abs(Zeq2)**2)*Req1/Req2 #ratio\n",
      "print \"Starting torque is\",round(TstByTfl*100,0),\"% of full load torque.\" \n",
      "#Answer in the book is not accurate."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Starting torque is 301.0 % of full load torque.\n"
       ]
      }
     ],
     "prompt_number": 144
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.46 Page 85"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=4 #no. of poles\n",
      "f=50 #in Hz\n",
      "R2=0.2 #in ohm per phase\n",
      "X2=1 #in ohm per phase\n",
      "Sf=4 #full load slip in %\n",
      "N2=1260 #reduced speed in rpm\n",
      "\n",
      "#Calculations\n",
      "Sf=Sf/100 #full load slip\n",
      "Ns=120*f/P #in rpm\n",
      "S2=(Ns-N2)/Ns #new value of slip\n",
      "#Let new resistance is R2dash\n",
      "#Formula : T proportional to S*E2**2*R2/(R2**2+(S*X2)**2)\n",
      "#T1=T2 as load is same\n",
      "from sympy import symbols, solve\n",
      "R2dash = symbols('R2dash')\n",
      "expr = (R2dash**2)*Sf*(E2**2)*R2-R2dash*(R2**2+(Sf*X2)**2)*(S2*E2**2)+Sf*(E2**2)*R2*(S2*X2)**2\n",
      "#P=[Sf*R2 -[R2**2+(Sf*X2)**2]*(S2) Sf*R2*(S2*X2)**2] #polynomial for R2dash\n",
      "R2dash=solve(expr,R2dash) \n",
      "R2dash=R2dash[1] #discarding smaller value as R2dash cant be < R2\n",
      "Rex=R2dash-R2\n",
      "print \"Extra resistance required = %0.2f ohm per phase \"%Rex "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Extra resistance required = 0.60 ohm per phase \n"
       ]
      }
     ],
     "prompt_number": 145
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.47 Page 85"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given data\n",
      "P=4 #no. of poles\n",
      "V2=415 #in volt\n",
      "f=50 #in Hz\n",
      "E2ByE1=1.75 #stator to rotor turn ratio\n",
      "Z2=0.1+1J*0.9 #in ohm\n",
      "I2=60 #in Ampere at startX2=1 #in ohm per phase\n",
      "Sf=4 #full load slip in %\n",
      "N2=1260 #reduced speed in rpm\n",
      "\n",
      "#Calculations\n",
      "R2=(Z2.real) #in ohm\n",
      "X2=(Z2.imag) #in ohm\n",
      "E1ph=V2/sqrt(3) #in volt\n",
      "E2ph=E1ph/E2ByE1 #in Volt\n",
      "#Formula : I2=E2ph/sqrt(R2dash**2+X2**2)\n",
      "R2dash=sqrt((E2ph/I2)**2-X2**2) #in ohm\n",
      "Rex=R2dash-R2 #in ohm per phase\n",
      "print \"Extra resiatance required = %0.3f ohm\"%Rex "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Extra resiatance required = 1.997 ohm\n"
       ]
      }
     ],
     "prompt_number": 146
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.48 Page 86"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=16 #no. of poles\n",
      "PM=4 #no. of poles of modulating function\n",
      "n=1 #assumed\n",
      "r=4 #assumed\n",
      "f=50 #in Hz\n",
      "\n",
      "#Calculations\n",
      "check=n/r==1/3*(1-PM/P) \n",
      "if check :\n",
      "    print \"Equation is satisfied with -ve sign.\" \n",
      "    P2=P+PM \n",
      "\n",
      "check=n/r==1/3*(1+PM/P) \n",
      "if check :\n",
      "    print \"Equation is satisfied with +ve sign.\"\n",
      "    P2=P-PM \n",
      "\n",
      "Ns1=120*f/P #in rpm\n",
      "Ns2=120*f/P2 #in rpm\n",
      "print \"Two speeds = %0.2f rpm & %0.2f rpm\"%(Ns1,Ns2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Equation is satisfied with -ve sign.\n",
        "Two speeds = 375.00 rpm & 300.00 rpm\n"
       ]
      }
     ],
     "prompt_number": 147
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.49 Page 87"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given data\n",
      "PA=4 #no. of poles\n",
      "PB=6 #no. of poles\n",
      "f=50 #in Hz\n",
      "\n",
      "#Calculations\n",
      "Ns=120*f/PA #in rpm, A running alone\n",
      "print \"(1.) If A running alone, Speed = %0.2f rpm\" %Ns\n",
      "Ns=120*f/PB #in rpm, B running alone\n",
      "print \"(2.) If B running alone, Speed = %0.2f rpm\" %Ns\n",
      "Ns=120*f/(PA+PB) #in rpm, Cumulative cascade\n",
      "print \"(3.) For Cumulative cascade, Speed = %0.2f rpm\"%Ns\n",
      "Ns=120*f/(PA-PB) #in rpm, Differential cascade\n",
      "print \"(4.) Differential cascade, Speed = %0.2f rpm\"%Ns"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(1.) If A running alone, Speed = 1500.00 rpm\n",
        "(2.) If B running alone, Speed = 1000.00 rpm\n",
        "(3.) For Cumulative cascade, Speed = 600.00 rpm\n",
        "(4.) Differential cascade, Speed = -3000.00 rpm\n"
       ]
      }
     ],
     "prompt_number": 148
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.50 Page 87"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given data\n",
      "PA=4 #no. of poles\n",
      "PB=6 #no. of poles\n",
      "f=50 #in Hz\n",
      "fr2=1 #in Hz\n",
      "\n",
      "#Calculations\n",
      "Nsc=120*f/(PA+PB) #synchronous speed of set in rpm\n",
      "S=1 #Slip\n",
      "N=Nsc-(S/f)*Nsc #combined speed of set in rpm\n",
      "print \"Combibned speed of set = %0.2f rpm\"%N \n",
      "NSA=120*f/PA #in rpm\n",
      "SA=(NSA-N)/NSA #slip \n",
      "print \"Slip of machine A = %0.2f %% \"%(SA*100) \n",
      "fr1=SA*f #in Hz\n",
      "NSB=120*fr1/PB #in rpm\n",
      "SB=(NSB-N)/NSB #slip\n",
      "print \"Slip of machine B = %0.1f %%\"%(SB*100) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Combibned speed of set = 588.00 rpm\n",
        "Slip of machine A = 60.80 % \n",
        "Slip of machine B = 3.3 %\n"
       ]
      }
     ],
     "prompt_number": 149
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.51 Page 88"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=4 #no. of poles\n",
      "f=50 #in Hz\n",
      "R2=0.25 #in ohm per phase\n",
      "X2=2 #in ohm per phase\n",
      "N1=1455 #ion rpm\n",
      "N2=N1*83/100 #in rpm\n",
      " \n",
      "#Calculations\n",
      "Ns=120*f/P #synchronous speed in rpm\n",
      "S1=(Ns-N1)/Ns #Slip\n",
      "S2=(Ns-N2)/Ns #Slip at reduced speed\n",
      "#Formula : T proportional to S*E2**2*R2/(R2**2+(S*X2)**2)\n",
      "T1ByT2=1 #as T1=T2 & For T2: R2dash Rex+R2\n",
      "from sympy import symbols, solve\n",
      "R2dash = symbols('R2dash')\n",
      "expr = R2dash**2-1.7067*R2dash+0.1519\n",
      "R2dash=solve(expr, R2dash) #in ohjm per phase\n",
      "R2dash=R2dash[1] #neglecting lower value\n",
      "Rex=R2dash-R2 #in ohm per phase\n",
      "print \"External resistance required = %0.4f ohm per phase \"%Rex "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "External resistance required = 1.3625 ohm per phase \n"
       ]
      }
     ],
     "prompt_number": 150
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.52 Page 89"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=6 #no. of poles\n",
      "f=50 #in Hz\n",
      "Sf=3 #in %\n",
      "R2=0.2 #in ohm per phase\n",
      " \n",
      "#Calculations\n",
      "Sf=Sf/100 #Slip \n",
      "Ns=120*f/P #in rpm\n",
      "N1=Ns*(1-Sf) #in rpm\n",
      "N2=N1*90/100 #in rpm\n",
      "S2=(Ns-N2)/Ns #new slip\n",
      "#Formula : T=K*S*E2**2*R2/R2**2 #S*X2 is neglected\n",
      "#Sf/R2=S2/(R2+r)   if Tfl=T20\n",
      "r=(S2*R2)/Sf-R2 #Extra resistance required in ohm\n",
      "print \"Extra resistance necessery in series = %0.2f ohm \"%r "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Extra resistance necessery in series = 0.65 ohm \n"
       ]
      }
     ],
     "prompt_number": 151
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.53 Page 90"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "IscByIfl=5 #ratio\n",
      "Sf=5 #in %\n",
      "K=50 #tapping in %\n",
      " \n",
      "#Calculations\n",
      "Sf=Sf/100 #Slip \n",
      "#(i) Start delta \n",
      "TstByTfl=1/3*IscByIfl**2*Sf #ratio\n",
      "print \"(i) Starting torque is\",round(TstByTfl*100,2),\"% of full load torque.\" \n",
      "#(ii) Auto Transformer having 50% tapping\n",
      "K=K/100 #tapping\n",
      "TstByTfl=K**2*IscByIfl**2*Sf #ratio\n",
      "print \"(ii) Starting torque is\",(TstByTfl*100),\"% of full load torque.\" "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) Starting torque is 41.67 % of full load torque.\n",
        "(ii) Starting torque is 31.25 % of full load torque.\n"
       ]
      }
     ],
     "prompt_number": 152
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.54 Page 90"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=6 #no. of poles\n",
      "f=50 #in Hz\n",
      "Ifl=60 #in Ampere\n",
      "N=940 #speed in rpm\n",
      "Tfl=150 #in N-m\n",
      "Isc=300 #in Ampere\n",
      " \n",
      "#Calculations\n",
      "Ns=120*f/P #in rpm\n",
      "Sf=(Ns-N)/Ns #Slip full load\n",
      "#Formula : Tst/Tfl=(Isc/Ifl)**2*Sf\n",
      "Tst=(Isc/Ifl)**2*Sf*Tfl #in N-m\n",
      "print \"Starting Torque = %0.2f N-m  \"%Tst \n",
      "#For Start delta \n",
      "Tst=1/3*(Isc/Ifl)**2*Sf*Tfl #in N-m\n",
      "print \"Starting Torque for star delta starter = %0.2f N-m \"%Tst \n",
      "Isc=sqrt(3*Tst/Tfl/Sf)*Ifl #in Ampere\n",
      "print \"Starting current for star delta starter = %0.2f Ampere \"%Isc "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Starting Torque = 225.00 N-m  \n",
        "Starting Torque for star delta starter = 75.00 N-m \n",
        "Starting current for star delta starter = 300.00 Ampere \n"
       ]
      }
     ],
     "prompt_number": 153
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.55 Page 91"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given data\n",
      "TmByTfl=2.2 #ratio\n",
      "R2=0.5 #in ohm per phase\n",
      "X2=5 #in ohm per phase\n",
      "K=70 #tapping in %\n",
      " \n",
      "#Calculations\n",
      "#Formula :Tst proportional to E2**2*R2/(R2**2+X2**2) \n",
      "#Formula :Tm proportional to E2**2/(2*X2) \n",
      "#Formula :Tfl proportional to 1/4.4*E2**2/X2\n",
      "TstByTfl=R2/(R2**2+X2**2)*TmByTfl*2*X2 #ratio for direct on line\n",
      "print \"Ratio of starting torque to full load torque for direct on line starter : \" ,round(TstByTfl,4)\n",
      "TstByTfl=(1/sqrt(3))**2*R2/(R2**2+X2**2)*TmByTfl*2*X2 #ratio for star delta starting\n",
      "print \"Ratio of starting torque to full load torque for star delta starter : \" ,round(TstByTfl,4)\n",
      "TstByTfl=(K/100)**2*R2/(R2**2+X2**2)*TmByTfl*2*X2 #ratio for auto transformer starting\n",
      "print \"Ratio of starting torque to full load torque for auto transformer starter : \" ,round(TstByTfl,4)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Ratio of starting torque to full load torque for direct on line starter :  0.4356\n",
        "Ratio of starting torque to full load torque for star delta starter :  0.1452\n",
        "Ratio of starting torque to full load torque for auto transformer starter :  0.2135\n"
       ]
      }
     ],
     "prompt_number": 154
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.56 Page 92"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "TmByTfl=3 #ratio\n",
      "Sm=0.1 #slip at max Torque\n",
      " \n",
      "#Calculations\n",
      "TstByTfl_dol=2*Sm/(1+Sm**2)*TmByTfl #ratio for D.O.L starter\n",
      "print \"Ratio of starting torque to full load torque for D.O.L starter : \" ,round(TstByTfl_dol,3)\n",
      "\n",
      "TstByTfl=1/3*TstByTfl_dol #ratio for star delta starting\n",
      "print \"Ratio of starting torque to full load torque for star delta starter : \" ,round(TstByTfl,3)\n",
      "#Anser of first part is not given in the book."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Ratio of starting torque to full load torque for D.O.L starter :  0.594\n",
        "Ratio of starting torque to full load torque for star delta starter :  0.198\n"
       ]
      }
     ],
     "prompt_number": 155
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.57 Page 92"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "VL=400 #in volt\n",
      "Ist=1200 #in Ampere\n",
      "Eff=0.85 #Efficiency\n",
      "cosfi=0.8 #power factor\n",
      "IstByIrated=5 #ratio\n",
      " \n",
      "#Calculations\n",
      "I2_rated=Ist/IstByIrated #in Ampere\n",
      "KWrating=sqrt(3)*VL*I2_rated*cosfi*Eff #in KW\n",
      "#To have star delta styarter tapping Xo=1/sqrt(3)\n",
      "#Ist=X0**2*IstByIrated*IL\n",
      "X0=1/sqrt(3) #tapping\n",
      "IL=Ist/X0**2/IstByIrated #in Ampere\n",
      "KWmax=sqrt(3)*VL*IL*cosfi*Eff/1000 #in KW\n",
      "print \"Maximum KW rating with star delta starter : \" ,round(KWmax,3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum KW rating with star delta starter :  339.205\n"
       ]
      }
     ],
     "prompt_number": 156
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.58 Page 93"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given data\n",
      "IscByIfl=3*180/100 #ratio\n",
      "TstByTfl=0.35 #ratio\n",
      "X=80/100 #tapping\n",
      " \n",
      "#Calculations\n",
      "#Formula : TstByTfl=1/3*(IscByIfl**2)*Sfl\n",
      "Sfl=TstByTfl/IscByIfl**2*3 #slip at full load\n",
      "IstByIsc=X**2 #ratio\n",
      "IstByIfl=IstByIsc*IscByIfl #ratio\n",
      "print \"Starting current is\",round(IstByIfl,1),\"imes of full load current.\" \n",
      "TstByTfl=X**2*IscByIfl**2*Sfl #ratio\n",
      "print \"Starting torque is\",round(TstByTfl*100,2),\"% of full load torque.\" "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Starting current is 3.5 imes of full load current.\n",
        "Starting torque is 67.2 % of full load torque.\n"
       ]
      }
     ],
     "prompt_number": 157
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.59 Page 93"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from numpy import real\n",
      "# Given data\n",
      "Zouter=0.05+1J*0.11 #in ohm\n",
      "Zinner=0.015+1J*0.5 #in ohm\n",
      " \n",
      "#Calculations\n",
      "R2odash=(Zouter.real) #in ohm\n",
      "X2odash=(Zouter.imag) #in ohm\n",
      "R2idash=real(Zinner.real) #in ohm\n",
      "X2idash=(Zinner.imag) #in ohm\n",
      "TouterByTinner=R2odash/(R2odash**2+X2odash**2)*(R2idash**2+X2idash**2)/R2idash #ratio\n",
      "print \"Ratio of Torque due to two windinga : \" ,round(TouterByTinner,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Ratio of Torque due to two windinga :  57.13\n"
       ]
      }
     ],
     "prompt_number": 158
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.60 Page 194"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "PA=4 #no. of poles\n",
      "PB=4 #no. of poles\n",
      "f=50 #in Hz\n",
      "V=440 #in volt\n",
      "\n",
      "#calculations\n",
      "#Independently with A\n",
      "Ns=120*f/PA #in rpm\n",
      "print \"Independently with A, Synchrpnous speed Ns = %0.2f rpm \" %Ns\n",
      "#Independently with B\n",
      "Ns=120*f/PB #in rpm\n",
      "print \"Independently with B, Synchrpnous speed Ns = %0.2f rpm\"%Ns\n",
      "#Running as cumulative cascaded\n",
      "Ns=120*f/(PA+PB) #in rpm\n",
      "print \"Running as cumulative cascaded, Synchrpnous speed Ns = %0.2f rpm\"%Ns\n",
      "#Running as differentially cascaded\n",
      "print \"Running as differentially cascaded, Synchrpnous speed Ns is undefined.\" "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Independently with A, Synchrpnous speed Ns = 1500.00 rpm \n",
        "Independently with B, Synchrpnous speed Ns = 1500.00 rpm\n",
        "Running as cumulative cascaded, Synchrpnous speed Ns = 750.00 rpm\n",
        "Running as differentially cascaded, Synchrpnous speed Ns is undefined.\n"
       ]
      }
     ],
     "prompt_number": 159
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.61 Page 94"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "IscByIfl=3*180/100 #ratio\n",
      "TstByTfl=35/100 #ratio\n",
      "X=75 #tapping in %\n",
      "\n",
      "#calculations\n",
      "X=X/100 #tapping\n",
      "\n",
      "#Star delta starting\n",
      "#Formula : TstByTfl=1/3*IscByIfl*Sfl\n",
      "Sfl=TstByTfl*3/IscByIfl**2 #slip at full load\n",
      "\n",
      "#Auto transformer  starting\n",
      "IstByIsc=X**2 #ratio\n",
      "IstByIfl=X**2*IscByIfl #ratio\n",
      "print \"Starting current is\",(IstByIfl*100),\"% of fulll load current.\" \n",
      "TstByTfl=X**2*IscByIfl**2*Sfl #ratio\n",
      "print \"Starting torque is\",(TstByTfl*100),\"% of fulll load torque.\" \n",
      "#Answer of starting current in terms of full load curremt is not given in the book."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Starting current is 303.75 % of fulll load current.\n",
        "Starting torque is 59.0625 % of fulll load torque.\n"
       ]
      }
     ],
     "prompt_number": 160
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.62 page 95"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "VL=400 #in volt\n",
      "f=50 #in Hz\n",
      "I=100 #i Ampere\n",
      "\n",
      "#calculations\n",
      "#D.O.L starter\n",
      "IL=I*sqrt(3) #in Ampere\n",
      "print \"(i) The line current for direct on line starting = %0.3f Ampere \"%IL \n",
      "#In star delta starter\n",
      "Vph=VL/sqrt(3) #in Volt\n",
      "Iph=I/sqrt(3) #in Ampere\n",
      "print \"(ii) Starting phase current for star delta starting = %0.3f A\" %Iph\n",
      "print \"(ii) Starting line current for star delta starting = %0.3f A\" %Iph\n",
      "#Auto transformer starter\n",
      "K=70/100 #tapping of auto transformer\n",
      "Vph=VL/sqrt(3) #in Volt\n",
      "Vline=K*VL #in volt\n",
      "Ist_phase=Vline*I/VL #in Ampere\n",
      "print \"(iii) Starting phase current of motor = %0.2f A\" %Ist_phase\n",
      "Ist_line=Ist_phase*sqrt(3) #in Ampere\n",
      "print \"(iii) Starting line current of motor = %0.2f A\" %Ist_line\n",
      "IsupplyLine=K*Ist_line #in Ampere\n",
      "print \"(iii) Supply line current of motor = %0.2f A\" %IsupplyLine"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) The line current for direct on line starting = 173.205 Ampere \n",
        "(ii) Starting phase current for star delta starting = 57.735 A\n",
        "(ii) Starting line current for star delta starting = 57.735 A\n",
        "(iii) Starting phase current of motor = 70.00 A\n",
        "(iii) Starting line current of motor = 121.24 A\n",
        "(iii) Supply line current of motor = 84.87 A\n"
       ]
      }
     ],
     "prompt_number": 161
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.63 Page 97"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=12 #no. of poles\n",
      "Ns=500 #in rpm\n",
      "Nr=1440 #in rpm\n",
      "\n",
      "#calculations\n",
      "f1=P*Ns/120 #in Hz\n",
      "Nsm=1500 #in rpm (Assumed closed synchronous speed)\n",
      "S=(Nsm-Nr)/Nsm #slip\n",
      "print \"Slip of the motor = %0.2f %%\"%(S*100) \n",
      "Pm=120*f1/Nsm #no. of poles of the motor\n",
      "print \"No. of poles of the motor : \" ,Pm"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Slip of the motor = 4.00 %\n",
        "No. of poles of the motor :  4.0\n"
       ]
      }
     ],
     "prompt_number": 162
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.64 Page 97"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=4 #no. of poles\n",
      "f1=50 #in Hz\n",
      "f2=1.5 #in Hz\n",
      "\n",
      "#calculations\n",
      "S=f2/f1 #slip\n",
      "print \"Slip = %0.2f %% \"%(S*100) \n",
      "Ns=120*f1/P #in rpm\n",
      "N=(1-S)*Ns #in rpm\n",
      "print \"Running speed of motor = %0.2f rpm\"%N "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Slip = 3.00 % \n",
        "Running speed of motor = 1455.00 rpm\n"
       ]
      }
     ],
     "prompt_number": 163
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      " Example  1.65 Page 97"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=6 #no. of poles\n",
      "f1=50 #in Hz\n",
      "S0=1 #in %\n",
      "Sfl=3 #in %\n",
      "\n",
      "#calculations\n",
      "S0=S0/100 #slip\n",
      "Sfl=Sfl/100 #slip\n",
      "Ns=120*f1/P #in rpm\n",
      "print \"(a) Synchronous speed = %0.2f rpm \"%Ns \n",
      "N0=(1-S0)*Ns #in rpm\n",
      "print \"(b) No Load speed = %0.2f rpm \"%N0 \n",
      "Nfl=(1-Sfl)*Ns #in rpm\n",
      "print \"(c) Full load speed = %0.2f rpm \"%Ns \n",
      "f2_st=f1*S0 #in Hz\n",
      "print \"(d) Frequeny of rotor current at standstill = %0.2f Hz \"%f2_st \n",
      "f2_fl=f1*Sfl #in Hz\n",
      "print \"(e) Frequeny of rotor current at full load = %0.2f Hz\"%f2_fl \n",
      "#Answer of part (c) & part(d) is wrong. Calcultion mistake & slip is not divided by 100."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Synchronous speed = 1000.00 rpm \n",
        "(b) No Load speed = 990.00 rpm \n",
        "(c) Full load speed = 1000.00 rpm \n",
        "(d) Frequeny of rotor current at standstill = 0.50 Hz \n",
        "(e) Frequeny of rotor current at full load = 1.50 Hz\n"
       ]
      }
     ],
     "prompt_number": 164
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.66 Page 98"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=4 #no. of poles\n",
      "f1=50 #in Hz\n",
      "S=4 #in %\n",
      "R2=1 #in ohm/phase\n",
      "X2=4 #in ohm/phase\n",
      "\n",
      "#calculations\n",
      "Ns=120*f1/P #in rpm\n",
      "S=S/100 #slip\n",
      "#part (a)\n",
      "N=(1-S)*Ns #in rpm\n",
      "print \"(a) Speed of the motor = %0.2f rpm \"%N \n",
      "#part (b)\n",
      "f2=S*f1 #in Hz\n",
      "print \"(b) Frequency of rotor emf = %0.2f Hz \"%f2 \n",
      "#part (i)\n",
      "Z2=R2+1J*X2 #in ohm\n",
      "cosfi=cos(atan((Z2.imag)/(Z2.real))) #power factor\n",
      "print \"(i) Power factor at standstill = %0.4f lag \"%cosfi \n",
      "#part (ii)\n",
      "N=1400 #speed in rpm (given for this part)\n",
      "S1=(Ns-N)/Ns #slip\n",
      "Z2s1=R2+1J*S1*X2 #in ohm\n",
      "cosfi=cos(atan((Z2s1.imag)/(Z2s1.real))) #power factor at 1400 rpm speed\n",
      "print \"(ii) Power factor at 1400 rpm = %0.4f lag \"%cosfi "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Speed of the motor = 1440.00 rpm \n",
        "(b) Frequency of rotor emf = 2.00 Hz \n",
        "(i) Power factor at standstill = 0.2425 lag \n",
        "(ii) Power factor at 1400 rpm = 0.9662 lag \n"
       ]
      }
     ],
     "prompt_number": 165
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.67 Page 99"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from numpy import real, imag\n",
      "# Given data\n",
      "E=60 #in volt\n",
      "Zrotor=0.8+1J*6 #rotor impedence in ohm/phase\n",
      "Zstator=4+1J*3 #stator impedence in ohm/phase\n",
      "S=5 #in %\n",
      "\n",
      "#calculations\n",
      "E2=E/sqrt(3) #emf induced/phase in volt\n",
      "Ztotal=Zstator+Zrotor #in ohm/phase\n",
      "#Part (a)\n",
      "I2=E2/Ztotal #in Ampere\n",
      "print \"Part(a) Magnitude is\",round(abs(I2),3),\"& angle = %0.2f degree\"%degrees(atan((I2.imag)/(I2.real)))\n",
      "#Part (b)\n",
      "S=S/100 #slip\n",
      "R2=real(Zrotor) #in ohm/phase\n",
      "X2=imag(Zrotor) #in ohm/phase\n",
      "I2s=S*E2/(R2+S*1J*X2) #in ampere\n",
      "print \"Part(b) Magnitude is\",round(abs(I2s),2),\"& angle = %0.2f degree \"%degrees(atan((I2s.imag)/(I2s.real)))\n",
      "#Answer of part (b) is wrong in the book."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Part(a) Magnitude is 3.396 & angle = -61.93 degree\n",
        "Part(b) Magnitude is 2.03 & angle = -20.56 degree \n"
       ]
      }
     ],
     "prompt_number": 166
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.68 Page 99"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "Pis=60 #in KW\n",
      "phase=3 #no. of phase\n",
      "S=3 #in %\n",
      "StatorLaser=1 #in KW\n",
      "\n",
      "#calculations\n",
      "S=S/100 #slip \n",
      "StatorOutput=Pis-StatorLaser #in KW\n",
      "RotorInput=StatorOutput #in KW\n",
      "RotorCuLoss=S*RotorInput #in KW\n",
      "RotorCuLoss_phase=S*RotorInput/phase #in KW/phase\n",
      "print \"Rotor Copper loss per phase = %0.2f kW \"%RotorCuLoss_phase \n",
      "MechPower=RotorInput-RotorCuLoss #in KW\n",
      "print \"Total mechanical power devloped = %0.2f kW\"%MechPower"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Rotor Copper loss per phase = 0.59 kW \n",
        "Total mechanical power devloped = 57.23 kW\n"
       ]
      }
     ],
     "prompt_number": 167
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.69 Page 100"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=6 #no. of poles\n",
      "f1=50 #in Hz\n",
      "f2=1.5 #in Hz\n",
      "Zo=150 #useful Torque in N-m\n",
      "FrictionLoss=10 #in N-m\n",
      "Psc=700 #stator loss in watt\n",
      "\n",
      "#calculations\n",
      "Ns=120*f1/P #in rpm\n",
      "S=f2/f1 #slip\n",
      "Nr=(1-S)*Ns #in rpm\n",
      "wr=2*pi*Nr/60 #in rad/sec\n",
      "Po=Zo*wr #in watts\n",
      "Pmd=(Zo+FrictionLoss)*wr #in watts\n",
      "#Part (a)\n",
      "Prc=S/(1-S)*Pmd #in watts\n",
      "print \"(a) Rotor Copper Loss = %0.4f kW \"%(Prc/1000)\n",
      "#Part (b)\n",
      "Pi=Pmd+Prc+Psc #in watts\n",
      "print \"(b) Input to the motor = %0.4f kW\"%(Pi/1000)\n",
      "#Part (c)\n",
      "Eff=Po/Pi #Effiiency\n",
      "print \"(d) Efficiency = %0.2f %%\"%(Eff*100)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Rotor Copper Loss = 0.5027 kW \n",
        "(b) Input to the motor = 17.4552 kW\n",
        "(d) Efficiency = 87.29 %\n"
       ]
      }
     ],
     "prompt_number": 168
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.70 Page 100"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "V=440 #in Volt\n",
      "f=50 #in Hz\n",
      "phase=3 #no. of phase\n",
      "P=6 #no. of poles\n",
      "Pin=80 #rotor input in KW\n",
      "f1=50 #in Hz\n",
      "f2=100 #in rotation/min\n",
      "I=65 #rotor current in Ampere\n",
      "\n",
      "#calculations\n",
      "f2=f2/60 #in Hz\n",
      "S=f2/f1 #slip\n",
      "print \"Slip = %0.3f p.u\" %S\n",
      "Ns=120*f/P #in rpm\n",
      "Nr=Ns*(1-S) #in rpm\n",
      "print \"Rotor speed = %0.2f rpm \"%Nr \n",
      "RotorCuLoss=S*Pin*1000 #in Watts\n",
      "Pmd=Pin*1000-RotorCuLoss #Mechanical powre developed /in watts\n",
      "Pmd=Pmd/746 #in HP\n",
      "print \"Mechanical power developed = %0.2f HP \"%Pmd \n",
      "RotorCuLoss_phase=RotorCuLoss/phase #in watts/phase\n",
      "print \"Rotor Coopper Loss per phase = %0.f W\" %RotorCuLoss_phase\n",
      "R2=RotorCuLoss_phase/I**2 #in ohm\n",
      "print \"Rotor resistance per phase = %0.4f ohm\"%R2 "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Slip = 0.033 p.u\n",
        "Rotor speed = 966.67 rpm \n",
        "Mechanical power developed = 103.66 HP \n",
        "Rotor Coopper Loss per phase = 889 W\n",
        "Rotor resistance per phase = 0.2104 ohm\n"
       ]
      }
     ],
     "prompt_number": 169
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.71 Page 101"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "f1=50 #in Hz\n",
      "phase=3 #no. of phase\n",
      "P=6 #no. of poles\n",
      "Nr=960 #in rpm\n",
      "GearCuLoss=250 #in watt\n",
      "Power=25 #in HP\n",
      "MechLoss=1000 #in watts\n",
      "I2=35 #in Ampere\n",
      "\n",
      "#calculations\n",
      "Ns=f1*120/P #in rpm\n",
      "S=(Ns-Nr)/Ns #slip\n",
      "#Formula : RotorCuLoss=S/(1-S)*MechDevPower\n",
      "#3*I2**2*R2+GearCuLoss=S/(1-S)*(Power*746+MechLoss)\n",
      "R2=(S/(1-S)*(Power*746+MechLoss)-GearCuLoss)/3/I2**2 #in ohm\n",
      "print \"Resistance per phase = %0.5f ohm \"%R2 "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Resistance per phase = 0.15476 ohm \n"
       ]
      }
     ],
     "prompt_number": 170
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.72 Page 101"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "V=500 #in Volt\n",
      "f1=50 #in Hz\n",
      "phase=3 #no. of phase\n",
      "P=6 #no. of poles\n",
      "Nr=995 #in rpm\n",
      "Pm=20 #mech power in KW\n",
      "StatorLoss=1500 #in watts\n",
      "pf=0.87 #power facator\n",
      "\n",
      "#calculations\n",
      "Ns=f1*120/P #in rpm\n",
      "S=(Ns-Nr)/Ns #slip\n",
      "print \"(a) Slip is : \" ,S,'pu'\n",
      "Prc=S/(1-S)*Pm*1000 #in watts\n",
      "print \"(b) Rotor I**2*R Loss = %0.2f Watts\"%Prc \n",
      "RotorInput=Prc/S #in watts\n",
      "TotalInput=RotorInput+StatorLoss #in watts\n",
      "print \"(c) Total input = %0.2f kW \"%(TotalInput/1000) \n",
      "LineCurrent=TotalInput/sqrt(3)/V/pf #in Ampere\n",
      "print \"(d) Line current = %0.1f A\" %LineCurrent\n",
      "fr=S*f1 #in Hz\n",
      "print \"(e) Rotor frequency = %0.2f HZ \"%fr "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Slip is :  0.005 pu\n",
        "(b) Rotor I**2*R Loss = 100.50 Watts\n",
        "(c) Total input = 21.60 kW \n",
        "(d) Line current = 28.7 A\n",
        "(e) Rotor frequency = 0.25 HZ \n"
       ]
      }
     ],
     "prompt_number": 171
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.73 Page 102"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "StatorLoss=2 #in KW\n",
      "StatorInput=90 #stator input in KW\n",
      "S=4 #in %\n",
      "\n",
      "#calculations\n",
      "S=S/100 #slip\n",
      "StatorOutput=StatorInput-StatorLoss #in KW\n",
      "Pri=StatorOutput #rotor input in KW\n",
      "Pcr=S*Pri #in KW\n",
      "print \"Rotor Copper Loss = %0.2f kW \"%Pcr \n",
      "Pm=Pri-Pcr #in KW\n",
      "print \"Rotor mechanical power developed = %0.2f kW\"%Pm "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Rotor Copper Loss = 3.52 kW \n",
        "Rotor mechanical power developed = 84.48 kW\n"
       ]
      }
     ],
     "prompt_number": 172
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.74 Page 102"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "emf=60 #in volt\n",
      "R2=0.6 #in ohm\n",
      "X2=4 #in ohm\n",
      "Rrh=5 #in ohm\n",
      "Xrh=2 #in ohm\n",
      "S=4 #in %\n",
      "\n",
      "#calculations\n",
      "S=S/100 #slip\n",
      "E2=emf/sqrt(3) #in volt\n",
      "Rt=R2+Rrh #in ohm\n",
      "Xt=X2+Xrh #in ohm\n",
      "I2=E2/sqrt(Rt**2+Xt**2) #in Ampere\n",
      "print \"(a) Current per phase in rotor = %0.2f A\" %I2\n",
      "E2s=S*E2 #in volt\n",
      "Z2s=sqrt(R2**2+(S*X2)**2) #in ohm\n",
      "I2s=E2s/Z2s #in Ampere\n",
      "print \"(b) Current per phase in rotor = %0.3f A\" %I2s"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Current per phase in rotor = 4.22 A\n",
        "(b) Current per phase in rotor = 2.231 A\n"
       ]
      }
     ],
     "prompt_number": 173
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.75 Page 103"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "R2=0.05 #in ohm\n",
      "X2=0.1 #in ohm\n",
      "\n",
      "#calculations\n",
      "R2dash=X2 #for max Torque\n",
      "r=R2dash-R2 #in ohm\n",
      "print \"External resistance per phase required = %0.2f ohm \"%r "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "External resistance per phase required = 0.05 ohm \n"
       ]
      }
     ],
     "prompt_number": 174
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.76 Page 103"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=6 #no. of poles\n",
      "f=50 #in Hz\n",
      "Sfl=4 #in %\n",
      "Z2=0.01+1J*0.05 #in ohm\n",
      "\n",
      "#calculations\n",
      "S=Sfl/100 #slip\n",
      "R2=real(Z2) #in ohm\n",
      "X2=imag(Z2) #in ohm\n",
      "Sm=R2/X2 #slip at max speed\n",
      "Ns=120*f/P #in rpm\n",
      "Nm=(1-Sm)*Ns #in rpm\n",
      "TmaxByTfl=(S**2+Sm**2)/2/S/Sm #ratio\n",
      "print \"Maximum Torque is\",(TmaxByTfl),\"times of full load torque.\" "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum Torque is 2.6 times of full load torque.\n"
       ]
      }
     ],
     "prompt_number": 175
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.77 Page 103"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=6 #no. of poles\n",
      "f=50 #in Hz\n",
      "Tmax=30 #in N-m\n",
      "Nm=960 #in rpm\n",
      "S=5 #in %\n",
      "R2=0.6 #in ohm\n",
      "\n",
      "#calculations\n",
      "S=S/100 #slip\n",
      "Ns=120*f/P #in rpm\n",
      "Sm=(Ns-Nm)/Ns #slip at max speed\n",
      "X2=R2/Sm #in ohm\n",
      "Tau_s=2*S*Sm/(S**2+Sm**2)*Tmax #in N-m\n",
      "print \"Torque exerted by the motor = %0.2f N-m \"%Tau_s "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Torque exerted by the motor = 29.27 N-m \n"
       ]
      }
     ],
     "prompt_number": 176
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.78 Page 104"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=4 #no. of poles\n",
      "f=50 #in Hz\n",
      "Tmax=110 #in N-m\n",
      "Nm=1360 #in rpm\n",
      "R2=0.25 #in ohm\n",
      "TstByTmax=1/2 #ratio\n",
      "\n",
      "#calculations\n",
      "Ns=120*f/P #in rpm\n",
      "Sm=(Ns-Nm)/Ns #slip at max speed\n",
      "X2=R2/Sm #in ohm\n",
      "#Formula : Tmax=K*E2**2/2/X2 and Tst=K*E2**2*(R2+r)/((R2+r)**2+X2**2)\n",
      "from sympy import symbols, solve\n",
      "RT = symbols('RT')\n",
      "expr = TstByTmax*RT**2+TstByTmax*X2**2-RT*2*X2\n",
      "\n",
      "RT=solve(expr, RT)[0] #in ohm\n",
      "r=RT-R2 #in ohm\n",
      "r=r #leaving higher value as Tmax goes with S>1 for this value\n",
      "print \"Resistance required in series = %0.3f ohm  \"%r"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Resistance required in series = 0.468 ohm  \n"
       ]
      }
     ],
     "prompt_number": 177
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.79 Page 105"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=16 #no. of poles\n",
      "f=50 #in Hz\n",
      "Z2=0.02+1J*0.15 #in ohm\n",
      "Nr=360 #in rpm\n",
      "\n",
      "#calculations\n",
      "Ns=120*f/P #in rpm\n",
      "Sfl=(Ns-Nr)/Ns #slip at full load\n",
      "R2=real(Z2) #in ohm\n",
      "X2=imag(Z2) #in ohm\n",
      "Sm=R2/X2 #slip at max torque\n",
      "Nm=(1-Sm)*Ns #in rpm\n",
      "print \"(a) Speed at which max Torque occurs = %0.2f rpm \"%Nm \n",
      "TmaxByTfl=(Sfl**2+Sm**2)/2/Sfl/Sm #ratio\n",
      "print \"(b) Ratio of maximum to full load torque : \" ,round(TmaxByTfl,4)\n",
      "R2dash=X2 #for max Torque\n",
      "r=R2dash-R2 #in ohm\n",
      "print \"(c) External resistance per phase required = %0.2f ohm \"%r "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Speed at which max Torque occurs = 325.00 rpm \n",
        "(b) Ratio of maximum to full load torque :  1.8167\n",
        "(c) External resistance per phase required = 0.13 ohm \n"
       ]
      }
     ],
     "prompt_number": 178
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.80 Page 106"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=6 #no. of poles\n",
      "f=50 #in Hz\n",
      "N=940 #in rpm\n",
      "Output=7 #in KW\n",
      "Nm=800 #in rpm\n",
      "TotalLaser=840 #in watts\n",
      "\n",
      "#calculations\n",
      "Ns=120*f/P #in rpm \n",
      "S=(Ns-N)/Ns #slip\n",
      "Sm=(Ns-Nm)/Ns #slip at max Torque\n",
      "Pmd=Output*1000+TotalLaser #in watts\n",
      "#Formula : Pmd=2*pi*N*Td/60\n",
      "Tdfl=Pmd/2/pi/N*60 #in N-m\n",
      "Tst=Tdfl*(S**2+Sm**2)/S/(1+Sm**2) #in N-m\n",
      "print \"Starting tiorque = %0.2f N-m \"%Tst"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Starting tiorque = 55.65 N-m \n"
       ]
      }
     ],
     "prompt_number": 179
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.81 Page 107"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=4 #no. of poles\n",
      "f=50 #in Hz\n",
      "VL=200 #in volt\n",
      "R2=0.1 #in ohm\n",
      "X2=0.9 #in ohm\n",
      "Te2ByTe1=0.67 #ratio of rotor to stator turns\n",
      "S=4 #in %\n",
      "\n",
      "#calculations\n",
      "S=S/100 #slip\n",
      "Ns=120*f/P #in rpm\n",
      "E1=VL/sqrt(3) #in volt\n",
      "E2=E1*Te2ByTe1 #in volt\n",
      "Td=3*S*E2**2*R2/2/pi/(Ns/60)/(R2**2+(S*X2)**2) #in N-m\n",
      "print \"(a) Total torque at 4%% slip = %0.2f N-m\"%Td \n",
      "Tmax=3*E2**2/2/pi/(Ns/60)/(2*X2) #in N-m\n",
      "print \"(b) Total torque at 4%% slip = %0.2f N-m \"%Tmax \n",
      "Sm=R2/X2 #slip at max torque\n",
      "Nm=(1-Sm)*Ns #speed at Tmax in rpm\n",
      "print \"(c) Speed at maximum torque = %0.2f rpm \"%Nm \n",
      "Pmd_max=2*pi*Nm/60*Tmax #in N-m\n",
      "print \"(d) Maximum mechanical power = %0.2f N-m \"%Pmd_max "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Total torque at 4% slip = 40.48 N-m\n",
        "(b) Total torque at 4% slip = 63.51 N-m \n",
        "(c) Speed at maximum torque = 1333.33 rpm \n",
        "(d) Maximum mechanical power = 8867.16 N-m \n"
       ]
      }
     ],
     "prompt_number": 180
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.82 Page 107"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt\n",
      "# Given data\n",
      "TstByTfl=1 #ratio\n",
      "TmaxByTfl=2 #ratio\n",
      "\n",
      "#calculations\n",
      "TstByTmax=TstByTfl/TmaxByTfl #ratio\n",
      "#Formula : TstByTmax=2*Sm/(1+Sm**2)\n",
      "\n",
      "from sympy import symbols, solve \n",
      "Sm, S = symbols('Sm, S')\n",
      "expr = TstByTmax*Sm**2-2*Sm+TstByTmax\n",
      "Sm=solve(expr, Sm) #slip at max torque\n",
      "Sm=Sm[0] #neglecting the higher value\n",
      "print \"(a) Slip at which max torque occurs : %0.3f\" %Sm\n",
      "#Formula : TflByTmax=2*S*Sm/(S**2+Sm**2) \n",
      "expr = S**2-TmaxByTfl*2*S*Sm+Sm**2\n",
      "S=solve(expr,S) #slip at max torque\n",
      "S=S[0] #neglecting the higher value\n",
      "print \"(b) Full load slip : %0.4f\" %S\n",
      "#I2stByI2fl**2=(Sm**2+S**2)/S**2/(1+Sm**2)\n",
      "I2stByI2fl=sqrt((Sm**2+S**2)/S**2/(1+Sm**2)) #ratio\n",
      "print \"(c) Rotor current at starting at full load current : %0.4f\"%I2stByI2fl "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Slip at which max torque occurs : 0.268\n",
        "(b) Full load slip : 0.0718"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "(c) Rotor current at starting at full load current : 3.7321\n"
       ]
      }
     ],
     "prompt_number": 181
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.83 Page 109"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "Zst=25 #in N-m\n",
      "\n",
      "#calculations\n",
      "#K=2*Zst*R2\n",
      "KbyR2=2*Zst #calculation\n",
      "#(a) Tst=K*2*R2/((2*R2)**2+R2**2)\n",
      "Tst=KbyR2*2/(2**2+1) #in N-m\n",
      "print \"(a) Starting torque = %0.2f N-m \"%Tst \n",
      "#(b) Tst=K/2*R2/((R2/2)**2+R2**2)\n",
      "Tst=KbyR2/2/((1/2)**2+1) #in N-m\n",
      "print \"(b) Starting torque = %0.2f N-m \"%Tst "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Starting torque = 20.00 N-m \n",
        "(b) Starting torque = 20.00 N-m \n"
       ]
      }
     ],
     "prompt_number": 182
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example  1.84 Page 109"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "P=4 #no. of poles\n",
      "f=50 #in Hz\n",
      "R2=0.4 #in ohm\n",
      "X2=4 #in ohm\n",
      "\n",
      "#calculations\n",
      "Ns=120*f/P #in rpm\n",
      "Sm=R2/X2 #slip at max Torque\n",
      "Nm=Ns*(1-Sm) #in rpm\n",
      "print \"Speed at Max Torque = %0.2f rpm \"%Nm \n",
      "TmaxByTst=(1+Sm**2)/2/Sm #ratio\n",
      "print \"Ratio of max Torque to starting Torque : \" ,TmaxByTst\n",
      "#After adding additional resistance\n",
      "from sympy import symbols, solve\n",
      "r = symbols('r')\n",
      "TstByTm=1/2 #given ratio\n",
      "expr = TstByTm-2*X2*(R2+r)/((R2+r)**2+X2**2) #ratio\n",
      "r=solve(expr, r) #in ohm\n",
      "r=r[0] #leaving higher value\n",
      "print \"Required resistance value = %0.2f ohm \"%r \n",
      "#Answer of resistance is wrong in the book."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed at Max Torque = 1350.00 rpm \n",
        "Ratio of max Torque to starting Torque :  5.05\n",
        "Required resistance value = 0.67 ohm "
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n"
       ]
      }
     ],
     "prompt_number": 183
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.85 Page 110"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given data\n",
      "VL=440 #in volt\n",
      "f=50 #in Hz\n",
      "X2byR2=3 #ratio\n",
      "TmByTfl=4 #ratio\n",
      "\n",
      "#Calculations\n",
      "Sm=1/X2byR2 #Maximum slip\n",
      "#Formula : TmByTfl=(Sm**2+S**2)/(2*S*Sm)\n",
      "from sympy import symbols, solve, N\n",
      "S = symbols('S')\n",
      "expr = 9*S**2-24*S+1\n",
      "S=solve(expr, S)\n",
      "S=N(S[0],3)\n",
      "print \"(i) Full load slip : \" ,S\n",
      "TstByTfl=(Sm**2+S**2)/(S*(1+Sm**2)) #ratio\n",
      "print \"(ii) Ratio of starting torque to full load torque : \" ,round(TstByTfl,4)\n",
      "V1=VL/sqrt(3) #in volt\n",
      "#Tst=Tfl : K*V11**2R2/(R2**2+X2**2)=R*V1*S*R2/(R2**2+(S*X2)**2)\n",
      "V11=sqrt(S*V1**2*(1+X2byR2**2)/(1+(S*X2byR2)**2)) #in volt\n",
      "Linevoltage=V11*sqrt(3) #in volt\n",
      "print \"(c) Line Voltage  = %0.2f Volt\" %Linevoltage\n",
      "#Note : Answer of line voltage is wrong in the book due to calculation mistake."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) Full load slip :  0.0423\n",
        "(ii) Ratio of starting torque to full load torque :  2.4002\n",
        "(c) Line Voltage  = 284.01 Volt\n"
       ]
      }
     ],
     "prompt_number": 184
    }
   ],
   "metadata": {}
  }
 ]
}