{
 "metadata": {
  "name": "",
  "signature": "sha256:3824b4cd7803bc4b9f0f05bdcb9567f1ce010c90984000335daadddb007d6162"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 8: Synchronous Motors"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.1, Page 477"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "R_s=complex(0,5);#synchronous reactance of motor\n",
      "P_o=10*746;#power output (in Watts)\n",
      "P_rot=230.;#rotational loss (in Watts)\n",
      "P_d=P_o+P_rot;#power developed (in Watts)\n",
      "V=230.;#in volts\n",
      "V_a=V/math.sqrt(3);#rms value of per phase voltage\n",
      "P_fw=70.;#feild winding loss\n",
      "pf=0.707;#power factor (leading)\n",
      "theta=math.acos(pf);\n",
      "\n",
      "#Calculations\n",
      "I_ao=P_d/(pf*V*math.sqrt(3));\n",
      "P_in=P_d+P_fw;\n",
      "Eff=(P_o/P_in)*100;\n",
      "I_a=I_ao*complex(math.cos(theta),math.sin(theta));\n",
      "E_a=V_a-(I_a*R_s);\n",
      "\n",
      "#Results\n",
      "print 'efficiency (%%)=%.1f'%Eff\n",
      "print 'magnitude of generated voltage (in Volts)=%.1f'%(abs(E_a))\n",
      "print 'Phase angle of generated voltage (in Degree)=%.1f'%(math.degrees(math.atan(E_a.imag/E_a.real)))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "efficiency (%)=96.1\n",
        "magnitude of generated voltage (in Volts)=248.8\n",
        "Phase angle of generated voltage (in Degree)=-22.8\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.2, Page 480"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "V=480.;#in volts\n",
      "V_a=V/math.sqrt(3);#per phase applied voltage\n",
      "I_a=50.;#in Amperes\n",
      "R_a=0.5;#armature winding resistance\n",
      "X_d=complex(0,3.5);#d-axis reactance\n",
      "X_q=complex(0,2.5);#q-axis reactance\n",
      "\n",
      "#Calculations&Results\n",
      "E_ao=V_a-(I_a*R_a)-(I_a*X_q);\n",
      "delta=math.atan(E_ao.imag/E_ao.real);\n",
      "I_d=I_a*math.sin(abs(delta))*complex(math.cos(90+delta),math.sin(90+delta));#d-axis current\n",
      "E_a=E_ao-(I_d*(X_d-X_q));\n",
      "E_L=E_a*math.sqrt(3);\n",
      "print 'rms value of excitation voltage (in Volts)=%.2f'%(abs(E_L))\n",
      "P_d=3*E_ao*I_a.conjugate()\n",
      "print 'power developed by motor (in Kilo-Watts)=%.2f'%(P_d.real/1000)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "rms value of excitation voltage (in Volts)=522.10\n",
        "power developed by motor (in Kilo-Watts)=37.82\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.3, Page 483"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "V=440.;#in volts\n",
      "V_a=V/math.sqrt(3);#per phase voltage\n",
      "w_m=188.5;#rad/sec\n",
      "\n",
      "#Calculations&Results\n",
      "X_s=complex(0,36./3);#per phase reactance\n",
      "E_ao=560/math.sqrt(3);#per-phase excitation voltage\n",
      "P_d=9000;#power developed (in Watts)\n",
      "delta=math.degrees(math.asin(-P_d*12/(3*V_a*E_ao)))\n",
      "E_a=E_ao*complex(math.cos(delta),math.sin(delta));\n",
      "I_a=(V_a-E_a)/X_s;\n",
      "alpha=math.atan(I_a.imag/I_a.real);\n",
      "print '(a) Power factor=%.2f'%(math.cos(alpha))\n",
      "print '(b) power angle (in Degree)=%.f'%delta\n",
      "E_L=(math.sqrt(3))*E_a*complex(math.cos(30),math.sin(30));\n",
      "print '(c) line to line excitation voltage (in Volts)=%.f'%(abs(E_L))\n",
      "print 'phase angle of line to line excitation voltage (in Degree) %.1f'%(math.degrees(math.atan(E_L.imag/E_L.real)))\n",
      "T_d=P_d/w_m;\n",
      "print '(d) Torque developed (in Newton-meter)=%.2f'%T_d"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Power factor=0.98\n",
        "(b) power angle (in Degree)=-26\n",
        "(c) line to line excitation voltage (in Volts)=560\n",
        "phase angle of line to line excitation voltage (in Degree) 49.4\n",
        "(d) Torque developed (in Newton-meter)=47.75\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.4, Page 486"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "pf=0.8;#lagging\n",
      "theta=-math.degrees(math.acos(pf))\n",
      "V_a=120;#in V\n",
      "X_d=2.7;#d-axis reactance (in ohms/phase)\n",
      "X_q=1.7;#q-axis reactances (in ohms/phase)\n",
      "\n",
      "#Calculations&Results\n",
      "I_a=40*complex(math.cos(-36.87*math.pi/180),math.sin(-36.87*math.pi/180));#in Amperes\n",
      "E_a_dash=V_a-complex(0,(I_a*X_q));#in Volts\n",
      "delta=math.degrees(math.atan(E_a_dash.imag/E_a_dash.real));#in degree\n",
      "alpha=abs(theta-delta);#in degree\n",
      "I_d=abs(I_a)*math.sin(alpha*math.pi/180)*complex(math.cos((-34.48-90)*math.pi/180),math.sin((-34.48-90)*math.pi/180));\n",
      "E_a=E_a_dash-complex(0,(I_d*(X_d-X_q)))\n",
      "E_a_m=math.sqrt(E_a.real**2+E_a.imag**2)\n",
      "print '(a) per-phase excitation voltage(in Volts)=%.3f'%(abs(E_a_m))\n",
      "print 'phase angle of excitation voltage (in degree)=%.2f'%(math.degrees(math.atan(E_a.imag/E_a.real)))\n",
      "P_df=(3*V_a*abs(E_a)*math.sin(34.48*math.pi/180))/X_d;\n",
      "print '(b) power developed due to field excitation(in Watts)=%.2f'%P_df\n",
      "P_ds=((X_d-X_q)*math.sin(2*34.48*math.pi/180)*3*V_a**2)/(2*X_d*X_q);\n",
      "print '(c) power developed due to saliency of motor (in Watts)=%.2f'%P_ds\n",
      "P_d=P_df+P_ds;\n",
      "print '(d) total power developed (in Watts)=%.f'%P_d\n",
      "P_r=0.05*P_d;#rotational loss (in Watts)\n",
      "P_in=3*V_a*I_a.conjugate();#power input (in Watts)\n",
      "P_o=P_in.real-P_r;#power output (in Watts)\n",
      "Eff=(P_o/P_in.real)*100;\n",
      "print '(e) Efficiency (in %%)=%.f'%Eff\n",
      "#refer to eqn 8.24\n",
      "A=(3*120*abs(E_a))/X_d;\n",
      "B=3*(X_d-X_q)*120**2/(2*X_d*X_q);\n",
      "P_dm=A*math.sin(63.4*math.pi/180)+B*math.sin(2*63.4*math.pi/180);\n",
      "print '(f) maximum power developed (in Watts)=%.f'%P_dm"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) per-phase excitation voltage(in Volts)=94.418\n",
        "phase angle of excitation voltage (in degree)=-34.48\n",
        "(b) power developed due to field excitation(in Watts)=7126.90\n",
        "(c) power developed due to saliency of motor (in Watts)=4392.14\n",
        "(d) total power developed (in Watts)=11519\n",
        "(e) Efficiency (in %)=95\n",
        "(f) maximum power developed (in Watts)=15025\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.5, Page 491"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "Zs = complex(0.5,3)  #armature winding resistance,ohms\n",
      "Vs = 69.28*complex(math.cos(0*math.pi/180),math.sin(0*math.pi/180))  #V\n",
      "Ia1 = 10*complex(math.cos(36.87*math.pi/180),math.sin(36.87*math.pi/180)) #A\n",
      "Ea1 = 87.54*complex(math.cos(-17.96*math.pi/180),math.sin(-17.96*math.pi/180))\n",
      "\n",
      "#Calculations&Results\n",
      "Sm = math.degrees(math.atan(Zs.imag/Zs.real))  #degrees\n",
      "Ea2 = 87.54*complex(math.cos(-Sm*math.pi/180),math.sin(-Sm*math.pi/180))\n",
      "Ia2 = (Vs-Ea2)/Zs  #A\n",
      "Ia2_mag = math.sqrt(Ia2.real**2+Ia2.imag**2)\n",
      "Ia2_phase = math.degrees(math.atan(Ia2.imag/Ia2.real))\n",
      "print \"The line current is %.2f with phase = %.2f A\"%(Ia2_mag,Ia2_phase)\n",
      "\n",
      "Pdma = Ea2*Ia2_mag*complex(math.cos(-Ia2_phase*math.pi/180),math.sin(-Ia2_phase*math.pi/180))\n",
      "print \"The pre-phase maximum power developed is %.f W/phase\"%Pdma.real\n",
      "\n",
      "Pdm = 3*Pdma\n",
      "print \"Total power developed = %.f W\"%Pdm.real"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The line current is 33.64 with phase = -22.98 A\n",
        "The pre-phase maximum power developed is 1580 W/phase\n",
        "Total power developed = 4740 W\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.6, Page 496"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "V=208;#in Volts\n",
      "V_a=V/math.sqrt(3);#in volts\n",
      "P=7200;#in Watts\n",
      "X_a=4;#synchronous reactance\n",
      "pf=0.8;#lagging\n",
      "theta=-math.degrees(math.acos(pf))\n",
      "\n",
      "#Calculations&Results\n",
      "I_a=(P/(3*V_a*pf))*complex(math.cos(theta*math.pi/180),math.sin(theta*math.pi/180));#Armature current (in Amperes)\n",
      "E_a=V_a-(I_a*complex(0,X_a));#in Volts\n",
      "E_a_m=math.sqrt(E_a.real**2+E_a.imag**2)\n",
      "E_an=1.5*abs(E_a_m);#new excitation voltage (in Volts)\n",
      "delta_n=-math.degrees(math.asin(P*X_a/(3*E_an*V_a)));#new torque angle\n",
      "I_an=(V_a-E_an*complex(math.cos(delta_n*math.pi/180),math.sin(delta_n*math.pi/180)))/complex(0,4);\n",
      "print '(a) New armature current (in Ampere)=%.3f'%(abs(I_an))\n",
      "print 'Phase angle of new armature current (in Degree)=%.2f'%(math.degrees(math.atan(I_an.imag/I_an.real)))\n",
      "pf_n=math.cos(math.atan(I_an.imag/I_an.real));\n",
      "print '(b) New Power factor=%.3f'%pf_n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) New armature current (in Ampere)=20.059\n",
        "Phase angle of new armature current (in Degree)=4.93\n",
        "(b) New Power factor=0.996\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.7, Page 499"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Calculations&Results\n",
      "#for load:\n",
      "theta_L=math.degrees(math.acos(0.6));#lag (in degree)\n",
      "S_L=100*complex(math.cos(53.13*math.pi/180),math.sin(53.13*math.pi/180));#in KVA\n",
      "#for synchronous motor:\n",
      "theta_m=math.degrees(math.acos(0.5));#lead (in degree)\n",
      "x = complex(math.cos(theta_m*math.pi/180),math.sin(theta_m*math.pi/180))\n",
      "S_m=(10./0.5)*x.conjugate();#in Watts\n",
      "S_t=S_L+S_m;#overall power (in Watts)\n",
      "pf=math.cos(math.atan(S_t.imag/S_t.real));\n",
      "print 'overall power factor=%.2f'%pf\n",
      "#for power factor=0.9\n",
      "theta_t=25.84;\n",
      "S_tn=(S_t.real/0.9)*complex(math.cos(theta_t*math.pi/180),math.sin(theta_t*math.pi/180));#in KVA\n",
      "S_mn=S_tn-S_L;#in KVA\n",
      "pf_n=math.cos(math.atan(S_mn.imag/S_mn.real));\n",
      "print 'power factor of motor to improve overall power factor to 0.9=%.2f'%pf_n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "overall power factor=0.74\n",
        "power factor of motor to improve overall power factor to 0.9=0.21\n"
       ]
      }
     ],
     "prompt_number": 7
    }
   ],
   "metadata": {}
  }
 ]
}