{
 "metadata": {
  "name": "",
  "signature": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter4 - Permanent magnet generators"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.1 Page 216"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import pi, floor\n",
      "# Given data\n",
      "kf=0.12  #  in Nm/A\n",
      "V=48 #in volt\n",
      "\n",
      "#Calculations\n",
      "omega_mo=V/kf#in radian/sec\n",
      "No=omega_mo*60/(2*pi)#in rpm\n",
      "print \"No load speed =\",floor(No),\"rpm\" "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "No load speed = 3819.0 rpm\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.2 Page 216"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "# Given data\n",
      "Tst=1  #  in N-m\n",
      "Ist=5 #in Ampere\n",
      "V=28 #in volt\n",
      "\n",
      "#Calculations\n",
      "kf=Tst/Ist #in Nm/A\n",
      "omega_m=V/kf#in radian/sec\n",
      "No=omega_m*60/(2*pi)#in rpm\n",
      "print \"No load speed = %0.2f rpm  \"%No"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "No load speed = 1336.90 rpm  \n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.3 Page 217"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "Ra=0.8 #in \u03a9\n",
      "Vdd=2 #in volt\n",
      "V=28 #in volt\n",
      "T1=0.3  #  in N-m\n",
      "Tst=1  #  in N-m\n",
      "Ist=5 #in Ampere\n",
      "\n",
      "#Calculations\n",
      "#We know : Tst = fi_1*Ist  and T1 = IL*fi_2\n",
      "#Deviding these two eqn we have\n",
      "IL=(T1/Tst)*Ist/0.8 #in Ampere\n",
      "Ebo=V #in volt\n",
      "NLbyNo=(V-IL*Ra-Vdd)/(0.8*Ebo) # temporary calculation for NL\n",
      "No=1337 #in rpm\n",
      "NL=NLbyNo*No #in rpm\n",
      "print \"Speed of motor = %0.f rpm\"%NL "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed of motor = 1462 rpm\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.4 page 217"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "ke=0.12 #in Nm/A\n",
      "V=48 #in volt\n",
      "Rph=0.15 #in \u03a9\n",
      "Vdd=2 #in volt\n",
      "\n",
      "#Calculations\n",
      "omega_mo=V/ke#in radian/sec\n",
      "No=omega_mo*60/(2*pi)#in rpm\n",
      "print \"No load speed = %0.1f rpm \"%No \n",
      "\n",
      "Ist=(V-Vdd)/(2*Rph) #in Ampere\n",
      "Tst=ke*Ist  #  in N-m\n",
      "print \"Starting Torque = %0.1f N-m\"%Tst "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "No load speed = 3819.7 rpm \n",
        "Starting Torque = 18.4 N-m\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.5 Page 218"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "Vs=120 #in volt\n",
      "V=60 #in volt\n",
      "Ra=2.5 #in \u03a9\n",
      "T=0.5  #  in N-m\n",
      "N=6000#in rpm\n",
      "\n",
      "#Calculations\n",
      "\n",
      "omega_mo=2*pi*N/60#in radian/sec\n",
      "ke=Vs/omega_mo #in Nm/A\n",
      "Ia=T/ke #in Ampere\n",
      "E=V-Ia*Ra #in Volt\n",
      "omega_m=E/ke#in radian/sec\n",
      "N=omega_m/(2*pi/60) #in rpm\n",
      "print \"Speed = %0.2f rpm \"%N \n",
      "#Note : answer is wrong in the book because calculation is not accurate. ."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Speed = 2672.75 rpm \n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.6 Page 219"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "lm=6*10**-3 #magnet length in m\n",
      "g=2*10**-3 #in m\n",
      "Tph=200 #turns\n",
      "Br=0.3 #in T\n",
      "l=50*10**-3 #in m\n",
      "n=25*10**-3 #in m\n",
      "I=10*10**-3 #in A\n",
      "N=200 #turns\n",
      "mo=4*pi*10**-7 #permittivity\n",
      "#Calculations\n",
      "Am=(2/3)*pi*(n-g-lm/2)*l #in m**2\n",
      "Ag=((2/3)*pi*(n-g/2)+2*g)*(l+2*g) #in m**2    \n",
      "Cfi=Am/Ag #unitless\n",
      "#For normal BLDG motor, HC=606 KA/M\n",
      "HC=606 #in  KA/M\n",
      "Hm=N*I/l #KA/M\n",
      "Bm=Br*(1-Hm/HC) #in T\n",
      "Mrec=(Br-Bm)*10**-3/(4*pi*10**-7*40) \n",
      "Pmo=mo*Mrec*Am/lm #in m-Wb/AT\n",
      "Pmo=Pmo*10**-3 #in Wb/AT\n",
      "Kc=1.05 #given constant\n",
      "g_dash=Kc*g #in m\n",
      "Rg=g_dash/mo/Am \n",
      "Bg=Cfi*Br/(1+Pmo*Rg) #in T\n",
      "Torque=2*Tph*Bg*l*n*I #in N-m\n",
      "print \"Torque per phase = %0.3e N-m \"%Torque "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Torque per phase = 1.072e-03 N-m \n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.7 Page 220"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sin, pi, sqrt\n",
      "# Given data\n",
      "P=16 #no.of poles\n",
      "slots=144 #no. of slotes\n",
      "conductors=10 #per slot\n",
      "fi=0.03 #in mb/pole\n",
      "N=375#in rpm\n",
      "\n",
      "#Calculations\n",
      "f=P*N/120 #in Hz\n",
      "print \"Frequency = %0.2f Hz \"%f \n",
      "kc=1 #for full pitcheed coil\n",
      "n=slots/P #slots per pole\n",
      "Beta=180/n #in degree\n",
      "m=n/3 #slots per pole per phase\n",
      "kd=sin(pi/180*3*Beta/2)/(m*sin(Beta/2*pi/180)) #Distribution factor\n",
      "Z=conductors*slots #total no. of conductors\n",
      "Zph=Z/3 # no. of armature per phase conductions\n",
      "Tph=Zph/2 #turns/ph\n",
      "Eph=4.44*kc*kd*f*fi*Tph #in volts\n",
      "print \"Phase Voltage = %0.f V\" %Eph\n",
      "VL=sqrt(3)*Eph #in volt\n",
      "print \"Line Voltage = %0.f V\" %VL"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Frequency = 50.00 Hz \n",
        "Phase Voltage = 1534 V\n",
        "Line Voltage = 2657 V\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.8 Page 221"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import cos\n",
      "# Given data\n",
      "P=4 #no.of poles\n",
      "phase=3 #no. of phase\n",
      "slots=36 #no. of stator slotes\n",
      "turns=20 #turns per coil\n",
      "conductors=10 #per slot\n",
      "fi_m=1.8 #in m wb\n",
      "N=3000#in rpm\n",
      "\n",
      "#Calculations\n",
      "f=P*N/120 #in Hz\n",
      "Tph=turns*phase*P #no. of turns per phase\n",
      "m=slots/(phase*P) #slots per pole per phase\n",
      "n=slots/P #slots per pole\n",
      "Beta=180/n #in degree\n",
      "kd1=sin(pi/180*3*Beta/2)/(m*sin(pi/180*Beta/2)) #Distribution factor\n",
      "alfa=2*Beta #in degree(Short Pitched by 2slots)\n",
      "kp1=cos(pi/180*alfa/2) #unitless\n",
      "ks1=1 #coefficient\n",
      "kn1=kd1*kp1*ks1 #winding factor\n",
      "Eq=4.44*f*fi_m*10**-3*kn1*Tph #in volts\n",
      "print \"Open circuit Phase emf = %0.f V\" %Eq"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Open circuit Phase emf = 173 V\n"
       ]
      }
     ],
     "prompt_number": 8
    }
   ],
   "metadata": {}
  }
 ]
}