{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 05 : Basic concepts in rotating machines"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.1, Page No 148"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "# To calculate harmanic factor for stator\n",
      "\n",
      "S=36.0     #no of slots\n",
      "q=3.0      #no of phases\n",
      "p=4.0      #no of poles\n",
      "m=S/(q*p)     #slots/pole/phase\n",
      "g=180*p/S     #gamma elec\n",
      "\n",
      "#Calculations\n",
      "def bfctr(n):\n",
      "    k=math.sin(math.radians(m*n*g/2))/(m*math.sin(math.radians(n*g/2))) \n",
      "    return k\n",
      "\n",
      "K_b=bfctr(1) \n",
      "print(K_b,'K_b(fundamental)') \n",
      "\n",
      "K_b=bfctr(3.0) \n",
      "\n",
      "#Results\n",
      "print(K_b,'K_b(third harmonic)') \n",
      "\n",
      "K_b=bfctr(5.0) \n",
      "print(K_b,'K_b(fifth harmonic)') "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(0.9597950805239389, 'K_b(fundamental)')\n",
        "(0.6666666666666667, 'K_b(third harmonic)')\n",
        "(0.21756788155537973, 'K_b(fifth harmonic)')\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.2, Page No 149"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "# to find the frequency and phase and line voltages\n",
      "\n",
      "n=375.0         #speed in rpm\n",
      "p=16.0         #no of poles\n",
      "f=n*p/120.0 \n",
      "print(f,'freq(Hz)') \n",
      "S=144.0         #no of slots\n",
      "c=10.0         #no of conductors/slot\n",
      "\n",
      "#Calculations\n",
      "t=S*c/2         #no of turns\n",
      "ph=3 \n",
      "N_ph=t/ph     #no of turns/ph\n",
      "g=180*p/S     #slots angle\n",
      "m=S/(p*ph)     #slots/pole/phase\n",
      "K_b=math.sin(math.radians(m*g/2.0))/(m*math.sin(math.radians(g/2)))     #breadth factor\n",
      "phi=0.04     #flux per pole\n",
      "E_p=4.44*K_b*f*N_ph*phi \n",
      "\n",
      "#Results\n",
      "print(E_p,'phase voltage(V)') \n",
      "E_l=math.sqrt(3)*E_p \n",
      "print(E_l,'line voltage(V)') \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(50.0, 'freq(Hz)')\n",
        "(2045.5152756126188, 'phase voltage(V)')\n",
        "(3542.936385019311, 'line voltage(V)')\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.3, Page No 149"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "# to find the phase and line voltages\n",
      "\n",
      "f=50     #freq\n",
      "n=600     #speed in rpm\n",
      "p=120*f/n \n",
      "ph=3 \n",
      "m=4         #slots/pole/ph\n",
      "S=p*ph*m     #slots\n",
      "t=12         #turns per coil\n",
      "\n",
      "#Calculations\n",
      "N_ph=S*t/ph \n",
      "g=180*p/S \n",
      "K_b=math.sin(math.radians(m*g/2.0))/(m*math.sin(math.radians(g/2)))     #breadth factor\n",
      "cp=10         #coil pitch\n",
      "pp=S/cp         #pole pitch\n",
      "theta_sp=(pp-cp)*g     #short pitch angle\n",
      "K_p=math.cos(math.radians(theta_sp/2))\n",
      "phi=.035  \n",
      "E_p=4.44*K_b*K_p*f*N_ph*phi\n",
      "\n",
      "#Results\n",
      "print(E_p,'phase voltage(V)') \n",
      "E_l=math.sqrt(3)*E_p \n",
      "print(E_l,'line voltage(V)')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(3695.060690685099, 'phase voltage(V)')\n",
        "(6400.032853317139, 'line voltage(V)')\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.4 Page No 150"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "# to calculate flux/pole\n",
      "\n",
      "S=42 \n",
      "p=2 \n",
      "ph=3 \n",
      "m=S/(p*ph)     #slots/pole/phase\n",
      "g=180*p/S     #slots angle\n",
      "\n",
      "#Calculations\n",
      "K_b=math.sin(math.radians(m*g/2.0))/(m*math.sin(math.radians(g/2)))   #breadth factor\n",
      "cp=17 \n",
      "pp=S/p \n",
      "theta_sp=(pp-cp)*g     #short pitch angle\n",
      "K_p=math.cos(math.radians(theta_sp/2)) \n",
      "N_ph=S*2/(ph*p*2)         #2 parallel paths\n",
      "E_p=2300/math.sqrt(3) \n",
      "phi=E_p/(4.44*K_b*K_p*f*N_ph) \n",
      "\n",
      "#Results\n",
      "print(phi,'flux/pole(Wb)') \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(0.9245870891715325, 'flux/pole(Wb)')\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.5, Page No 151"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "# to calculate  useful flux/pole and ares of pole shoe\n",
      "\n",
      "p=1500*1000.0     #power\n",
      "v=600.0 \n",
      "I_a=p/v \n",
      "cu=25*1000     #copper losses\n",
      "\n",
      "#Calculations\n",
      "R_a=cu/I_a**2 \n",
      "E_a=v+I_a*R_a \n",
      "n=200 \n",
      "Z=2500 \n",
      "p=16 \n",
      "A=16 \n",
      "phi=E_a*60*A/(p*n*Z) \n",
      "print(phi,'flux/pole(Wb)') \n",
      "fd=0.85     #flux density\n",
      "a=phi/fd \n",
      "\n",
      "#Results\n",
      "print(a,'area of pole shoe(m*m)') "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(0.0732, 'flux/pole(Wb)')\n",
        "(0.08611764705882353, 'area of pole shoe(m*m)')\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.6, Page No 152"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "# To calculate em power developed,mech power fed, torque provided by primemover\n",
      "\n",
      "phi=32*10**-3     #flux/pole\n",
      "n=1600         #speed in rpm\n",
      "Z=728         #no of conductors\n",
      "p=4 \n",
      "A=4 \n",
      "\n",
      "#Calculations\n",
      "E_a=phi*n*Z*(p/A)/60 \n",
      "I_a=100 \n",
      "P_e=E_a*I_a \n",
      "print(P_e,'electromagnetic power(W)') \n",
      "P_m=P_e \n",
      "print(P_m,'mechanical power(W) fed') \n",
      "w_m=2*math.pi*n/60 \n",
      "T=P_m/w_m \n",
      "\n",
      "#Results\n",
      "print(T,'primemover torque(Nm)') \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(62122.66666666667, 'electromagnetic power(W)')\n",
        "(62122.66666666667, 'mechanical power(W) fed')\n",
        "(370.7673554268794, 'primemover torque(Nm)')\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.9 Page No 163"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "# To determine peak value of fundamental mmf\n",
      " \n",
      "f=50.0 \n",
      "n_s=300.0 \n",
      "p=120*f/n_s \n",
      "P=400*1000.0     #power\n",
      "V=3300.0 \n",
      "\n",
      "#Calculations\n",
      "I_L=P/(math.sqrt(3)*V) \n",
      "I_P=I_L \n",
      "I_m=math.sqrt(2)*I_P     #max value of phase current\n",
      "S=180.0 \n",
      "g=180*p/S \n",
      "ph=3 \n",
      "m=S/(p*ph)     #slots/pole/phase\n",
      "K_b=math.sin(math.radians(m*g/2.0))/(m*math.sin(math.radians(g/2)))    #breadth factor\n",
      "c=8         #conductors/1 coil side\n",
      "N_ph=S*c/(ph*2)       #turns/phase\n",
      "F_m=(4/math.pi)*K_b*(N_ph/p)*I_m \n",
      "F_peak=(3.0/2)*F_m \n",
      "\n",
      "#Results\n",
      "print(F_peak,'peak mmf(AT/pole)') \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(2177.0157210889715, 'peak mmf(AT/pole)')\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.10, Page No 164"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "# (a)to calculate field current and flux/pole(b)to calculate open ckt ph and line voltages\n",
      "# (c)to caculate field current\n",
      "\n",
      "B_peak=1.65 \n",
      "g=.008 \n",
      "u_o=4*math.pi*10**-7 \n",
      "P=4 \n",
      "K_b=.957 \n",
      "N_field=364.0/2 \n",
      "\n",
      "#Calculations\n",
      "I_f=B_peak*math.pi*g*P/((4*u_o)*(K_b*N_field)) \n",
      "print(I_f,'field current(A)') \n",
      "l=1.02     #rotor length\n",
      "r=.41/2     #rotor radius\n",
      "phi=(4/P)*B_peak*l*r \n",
      "print(phi,'flux/pole(Wb)') \n",
      "N_ph=3*11*P/2 \n",
      "ga=60/3     #slot angle\n",
      "m=3 \n",
      "f=50 \n",
      "K_b=math.sin(math.radians(m*g/2.0))/(m*math.sin(math.radians(g/2)))     #breadth factor\n",
      "E_ph=math.sqrt(2)*math.pi*K_b*f*N_ph*phi \n",
      "print(E_ph,'E_ph(V)') \n",
      "E_line=math.sqrt(3)*E_ph\n",
      "\n",
      "#Results\n",
      "print(E_line,'E_line(V)') \n",
      "I_fnew=.75*I_f \n",
      "print(I_fnew,'I_f(new)(A)') "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(189.46570670708599, 'field current(A)')\n",
        "(0.34501499999999996, 'flux/pole(Wb)')\n",
        "(5058.442114926427, 'E_ph(V)')\n",
        "(8761.478750198738, 'E_line(V)')\n",
        "(142.0992800303145, 'I_f(new)(A)')\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.11 Page No 165"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "# to find fundamental mmf wave,speed and its peak value\n",
      "\n",
      "p=4.0\n",
      "S=60.0 \n",
      "g=180*p/S \n",
      "ph=3 \n",
      "m=S/(p*ph)     #slots/pole/phase\n",
      "\n",
      "#Calculations\n",
      "K_b=math.sin(math.radians(m*g/2.0))/(m*math.sin(math.radians(g/2)))      #breadth factor\n",
      "I_L=48 \n",
      "I_P=I_L/math.sqrt(3) \n",
      "I_Pmax=I_P*math.sqrt(2) \n",
      "c=24         #conductors\n",
      "N_ph=S*c/(ph*2)       #turns/phase\n",
      "F_m=(4/math.pi)*K_b*(N_ph/p)*I_Pmax \n",
      "print(F_m,'F_m(AT/pole)') \n",
      "F_peak=(3/2)*F_m \n",
      "\n",
      "#Results\n",
      "print(F_peak,'F_peak(AT/pole)') \n",
      "n=120*f/P \n",
      "print(n,'speed(rpm)') \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(2864.325776100667, 'F_m(AT/pole)')\n",
        "(2864.325776100667, 'F_peak(AT/pole)')\n",
        "(1500, 'speed(rpm)')\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.12 Page No 165"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "# to calculate resultant air gap flux/pole\n",
      "\n",
      "F1=400.0 \n",
      "F2=850.0 \n",
      "a=123.6 \n",
      "\n",
      "#Calculations\n",
      "Fr=math.sqrt(F1**2+F2**2+2*F1*F2*math.cos(math.radians(a))) \n",
      "P=1.408*10**-4         #permeance/pole\n",
      "phi_r=P*Fr \n",
      "\n",
      "#Results\n",
      "print(phi_r,'air gap flux/pole(Wb)') "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(0.10017539016595711, 'air gap flux/pole(Wb)')\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.13 Page No 172"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "#To calculate resultant AT/pole and peak air gap flux density, rotor AT/pole, stator AT and its angle with the resultant AT, stator currrent\n",
      "\n",
      "ph=3.0 \n",
      "S=36.0 \n",
      "c=8.0*2 \n",
      "p=4.0 \n",
      "f=50.0 \n",
      "N_ph=S*c/(ph*2)       #turns/phase\n",
      "ga=180.0*p/S \n",
      "m=S/(p*ph)     #slots/pole/phase\n",
      "\n",
      "#Calculations\n",
      "K_b=math.sin(math.radians(m*g/2.0))/(m*math.sin(math.radians(g/2)))      #breadth factor\n",
      "V_L=400 \n",
      "V_ph=V_L/math.sqrt(3) \n",
      "phi_r=V_ph/(4.44*K_b*f*N_ph) \n",
      "print(phi_r,'phi_r(Wb/pole)') \n",
      "D=.16 \n",
      "l=0.12 \n",
      "PA=math.pi*l*D/4         #pole area\n",
      "B_rav=phi_r/PA \n",
      "B_rpeak=(math.pi/2)*B_rav \n",
      "g=2*10**-3 \n",
      "u_o=4*math.pi*10**-7 \n",
      "F_r=g*B_rpeak/u_o \n",
      "print(F_r,'F_r(AT/pole)') \n",
      "T=60         #torque(Nm)\n",
      "d=26 \n",
      "F2=T/((math.pi/2)*(p/2)**2*phi_r*math.sin(math.radians(d))) \n",
      "print(F2,'F2(AT/pole)') \n",
      "F1=math.sqrt(F2**2+F_r**2-2*F2*F_r*math.sin(math.radians(d))) \n",
      "print(F1,'F1(AT/pole)') \n",
      "w=math.degrees(math.acos((F1**2+F_r**2-F2**2)/(2*F1*F_r)))\n",
      "print(w,'angle(deg)') \n",
      "K_w=K_b \n",
      "I_a=F1/((3/2)*(4*math.sqrt(2)/math.pi)*K_w*(N_ph/p))\n",
      "\n",
      "#Results\n",
      "print(I_a,'I_a(A)') "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(0.01099635147629408, 'phi_r(Wb/pole)')\n",
        "(1823.0455139875667, 'F_r(AT/pole)')\n",
        "(1980.9832697544216, 'F2(AT/pole)')\n",
        "(2020.2729202496512, 'F1(AT/pole)')\n",
        "(61.80134857667341, 'angle(deg)')\n",
        "(47.44026875335716, 'I_a(A)')\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.14, Page No 176"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "#to determine in F2,peak rotor AT, max torque, ele i/p at max torque(motoring mode),open ckt voltage(generating mode)\n",
      "\n",
      "print('motoring mode') \n",
      "K_w=.976 \n",
      "N_pole=746 \n",
      "p=4 \n",
      "I_f=20 \n",
      "\n",
      "#Calculations\n",
      "F2=(4/math.pi)*K_w*(N_pole/p)*I_f \n",
      "print(F2,'F2(AT)') \n",
      "B_r=1.6 \n",
      "D=.29 \n",
      "l=.35 \n",
      "T_max=(p/2)*(math.pi*D*l/2)*F2*B_r \n",
      "print(T_max,'T_max') \n",
      "f=50 \n",
      "w_m=4*math.pi*f/p \n",
      "P_in=T_max*w_m \n",
      "print(P_in,'P_in(W)') \n",
      "\n",
      "print('generating mode') \n",
      "m=S/(3*p) \n",
      "ga=180*p/S \n",
      "K_b=math.sin(math.radians(30))/(3*math.sin(math.radians(15.0/2))) \n",
      "K_w=K_b \n",
      "u_o=4*math.pi*10**-7 \n",
      "phi_r=((2*D*l/p)*(u_o/g))*F2 \n",
      "N_ph=20*p*4/2 \n",
      "E_ph=4.44*K_b*f*N_ph*phi_r \n",
      "E_l=math.sqrt(3)*E_ph \n",
      "\n",
      "#Results\n",
      "print(E_l,'E_l(V)') "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "motoring mode\n",
        "(4622.77627986085, 'F2(AT)')\n",
        "(2358.515712, 'T_max')\n",
        "(370474.781709765, 'P_in(W)')\n",
        "generating mode\n",
        "(11579.863937164595, 'E_l(V)')\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.15, Page No 186"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "# to find motor speed\n",
      "\n",
      "n=1500.0         #speed of sync generator\n",
      "p=4 \n",
      "f=n*p/120 \n",
      "\n",
      "#Calculations\n",
      "p_im=6.0 \n",
      "n_s=120*f/p_im \n",
      "s=0.05         #slip\n",
      "n_im=(1-s)*n_s \n",
      "\n",
      "#Results\n",
      "print(n_im,'speed of induction motor(rpm)') "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(950.0, 'speed of induction motor(rpm)')\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.16, Page No 187"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "#to find voltage available b/w slip rings and its freq\n",
      "\n",
      "print('(a)') \n",
      "f=50.0 \n",
      "p=6.0 \n",
      "n_s=120*f/p \n",
      "n=-1000 \n",
      "\n",
      "#Calculations\n",
      "s=(n_s-n)/n_s \n",
      "f_s=f*s \n",
      "print(f_s,'slip freq(Hz)') \n",
      "v2=100 \n",
      "V2=s*v2 \n",
      "print(V2,'slip ring voltage(V)') \n",
      "\n",
      "print('(b)') \n",
      "n=1500 \n",
      "s=(n_s-n)/n_s \n",
      "f_s=abs(f*s) \n",
      "print(f_s,'slip freq(Hz)') \n",
      "v2=100 \n",
      "V2=s*v2 \n",
      "\n",
      "#Results\n",
      "print(V2,'slip ring voltage(V)') "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)\n",
        "(100.0, 'slip freq(Hz)')\n",
        "(200.0, 'slip ring voltage(V)')\n",
        "(b)\n",
        "(25.0, 'slip freq(Hz)')\n",
        "(-50.0, 'slip ring voltage(V)')\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.18, Page No 197"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "#to find no of poles, slip and freq of rotor currents at full load, motor speed at twice of full load\n",
      "\n",
      "n_s=600.0\n",
      "f=50.0 \n",
      "P=120*f/n_s \n",
      "print(p,'no of poles') \n",
      "n=576.0 \n",
      "\n",
      "#Calculations\n",
      "s=(n_s-n)/n_s \n",
      "print(s,'slip') \n",
      "f2=s*f \n",
      "n_r=s*n_s \n",
      "print(n_r,'rotor speed wrt rotating field(rpm)') \n",
      "ss=f2*s \n",
      "n=(1-ss)*n_s \n",
      "print(n,'motor speed(rpm)') \n",
      "nn=528 \n",
      "s_old=s \n",
      "s_new=(n_s-nn)/n_s \n",
      "fac=s_new/s_old \n",
      "\n",
      "#Results\n",
      "print(fac,'factor is') "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(6.0, 'no of poles')\n",
        "(0.04, 'slip')\n",
        "(24.0, 'rotor speed wrt rotating field(rpm)')\n",
        "(552.0, 'motor speed(rpm)')\n",
        "(3.0, 'factor is')\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.19, Page No 198"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "# to calculate amplitude of travelling wave mmf,peak value of air flux density, velocity of wave, current freq at some desired velocity\n",
      " \n",
      "K_w=.925 \n",
      "N_ph=48 \n",
      "I=750.0/math.sqrt(2) \n",
      "wndnglgth=2 \n",
      "wavelgth=wndnglgth/0.5 \n",
      "p=2*wavelgth \n",
      "\n",
      "#Calculations\n",
      "F_peak=(3.0/2)*(4*math.sqrt(2)/math.pi)*K_w*(N_ph/p)*I \n",
      "print(F_peak,'F_peak(A/m)') \n",
      "g=.01 \n",
      "u_o=4*math.pi*10**-7 \n",
      "B_peak=u_o*F_peak/g \n",
      "print(B_peak,'B_peak(T)') \n",
      "f=25 \n",
      "B=.5 \n",
      "v=f*B     \n",
      "print(v,'velocity(m/s)') \n",
      "vv=72*10**3/3600         #given velocity\n",
      "f=vv/0.5 \n",
      "\n",
      "#Results\n",
      "print(f,'freq(Hz)') "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(7949.789407440174, 'F_peak(A/m)')\n",
        "(0.9990000000000002, 'B_peak(T)')\n",
        "(12.5, 'velocity(m/s)')\n",
        "(40.0, 'freq(Hz)')\n"
       ]
      }
     ],
     "prompt_number": 16
    }
   ],
   "metadata": {}
  }
 ]
}