{
 "metadata": {
  "name": "",
  "signature": "sha256:630bab3e982e6c25d82e6eef216fc98c8bed190320cfe05ba04a1faa42427906"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter10-The Synchronous Generator"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex9-pg407"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "## Example10_9_pg407.sce\n",
      "## To find the field excitation required\n",
      "## Theory of Alternating Current Machinery by Alexander Langsdorf\n",
      "## First Edition 1999, Thirty Second reprint\n",
      "## Tata McGraw Hill Publishing Company\n",
      "## Example in Page 407\n",
      "\n",
      "\n",
      "import math\n",
      "\n",
      "## Given data\n",
      "va = 2500e+3; ## Volt Ampere rating of machine, VA\n",
      "vll = 6600.; ## Line to Line voltage in volts\n",
      "N = 3000.; ## Number of turns\n",
      "f = 50.; ## Frequency in Hz\n",
      "slots = 60.;\n",
      "n = 4.;\n",
      "poles =2.;\n",
      "r = 0.073;\n",
      "x = 0.87;\n",
      "pf1 = 0.8;\n",
      "pf2 = 1.;\n",
      "pf3 = 0.;\n",
      "phase = 3.;\n",
      "\n",
      "## Calculations \n",
      "\n",
      "## For 80% power factor\n",
      "\n",
      "phi = math.acos(pf1);\n",
      "V = vll / math.sqrt(3.);\n",
      "I = round(va / (phase*V)) ;\n",
      "IR_a = I*r;\n",
      "IX_a = I*x;\n",
      "V_vec = complex(V*math.cos(phi) ,V*math.sin(phi));\n",
      "E = V_vec + complex(I*r , I*x);\n",
      "E_mag = math.sqrt((E.real)**2+ (E.imag)**2)\n",
      "conductors = slots * n;\n",
      "turns = conductors/2;\n",
      "N_p = turns / (poles * phase);\n",
      "q = slots / (poles * phase);\n",
      "gama = 360 / slots;\n",
      "gama = gama*math.pi/2;\n",
      "k_b1 = (math.sin(q*gama/2))/(q*math.sin(gama/2));\n",
      "k_p1 = 1;\n",
      "A = (2.*math.sqrt(2)/math.pi)*phase*k_b1*k_p1*N_p*I;\n",
      "cos_alpha = ((E.real)/E_mag);\n",
      "sin_alpha = ((E.imag)/E_mag);\n",
      "alpha = math.acos(cos_alpha);\n",
      "F_r_mag = 17500.;\n",
      "F_r = complex(F_r_mag*math.cos(alpha + math.pi/2.) , F_r_mag*math.sin(alpha + math.pi/2));\n",
      "F = F_r - A;\n",
      "F_mag = math.sqrt((F.real)**2+ (F.imag)**2)\n",
      "print('The open-circuit voltage corresponding to this excitation, determined from Fig. 10-12, is 4450 volts;');\n",
      "oc_volt = 4450.;\n",
      "regulation80 = ((oc_volt - V)/V)*100.;\n",
      "print'%s %.2f %s'%(\"\\n\\nThe regulation for 80%% power factor is  \", regulation80,\"%\");\n",
      "\n",
      "## For power factor 1.0\n",
      "\n",
      "phi = math.acos(pf2);\n",
      "V_vec = complex(V*math.cos(phi) ,V*math.sin(phi));\n",
      "E = V_vec + complex(I*r , I*x);\n",
      "E_mag = math.sqrt((E.real)**2+ (E.imag)**2)\n",
      "cos_alpha = ((E.real)/E_mag);\n",
      "sin_alpha = ((E.imag)/E_mag);\n",
      "alpha = math.acos(cos_alpha);\n",
      "F_r_mag = 16500.;\n",
      "F_r =complex(F_r_mag*math.cos(alpha + math.pi/2.) , F_r_mag*math.sin(alpha + math.pi/2));\n",
      "F = F_r - A;\n",
      "F_mag = math.sqrt((F.real)**2 + (F.imag)**2);\n",
      "print('The open-circuit voltage corresponding to this excitation, determined from Fig. 10-12, is 4150 volts;');\n",
      "oc_volt = 4150.;\n",
      "regulation100 = ((oc_volt - V)/V)*100.;\n",
      "print'%s %.2f %s'%(\"\\n\\nThe regulation for 100%% power factor is  \", regulation100,\"%\");\n",
      "\n",
      "\n",
      "## For power factor 0\n",
      "\n",
      "phi = math.acos(pf3);\n",
      "E = V + I*(x);\n",
      "F_r_mag = 18000.;\n",
      "F_r = F_r_mag + 11300.;\n",
      "print'%s %.2f %s'%(\"\\nThe value F_R corresponding to Fig 10-12 is \",F_r,\" Volts\\n\");\n",
      "print('The open-circuit voltage corresponding to this excitation, determined from Fig. 10-12, is 4500 volts;');\n",
      "oc_volt = 4500.;\n",
      "regulation0 = ((oc_volt - V)/V)*100.;\n",
      "print'%s %.2f %s'%(\"\\n\\nThe regulation for 0%% power factor is  \", regulation0,\"%\");\n",
      "\n",
      "## Result\n",
      "##  The open-circuit voltage corresponding to this excitation, determined from Fig. 10-12, is 4450 volts;       \n",
      "##\n",
      "## The regulation for 80% power factor is 16.8 %  \n",
      "## The open-circuit voltage corresponding to this excitation, determined from Fig. 10-12, is 4150 volts;\n",
      "##\n",
      "## The regulation for 100% power factor is 8.9 % \n",
      "## The value F_R corresponding to Fig 10-12 is 29300 Volts\n",
      "##  \n",
      "## The open-circuit voltage corresponding to this excitation, determined from Fig. 10-12, is 4500 volts;\n",
      "##\n",
      "## The regulation for 0% power factor is 18.1 % \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The open-circuit voltage corresponding to this excitation, determined from Fig. 10-12, is 4450 volts;\n",
        "\n",
        "\n",
        "The regulation for 80%% power factor is   16.78 %\n",
        "The open-circuit voltage corresponding to this excitation, determined from Fig. 10-12, is 4150 volts;\n",
        "\n",
        "\n",
        "The regulation for 100%% power factor is   8.91 %\n",
        "\n",
        "The value F_R corresponding to Fig 10-12 is  29300.00  Volts\n",
        "\n",
        "The open-circuit voltage corresponding to this excitation, determined from Fig. 10-12, is 4500 volts;\n",
        "\n",
        "\n",
        "The regulation for 0%% power factor is   18.09 %\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex10-pg413"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "## Example10_10_pg413.sce\n",
      "## Regulation by emf method\n",
      "## Theory of Alternating Current Machinery by Alexander Langsdorf\n",
      "## First Edition 1999, Thirty Second reprint\n",
      "## Tata McGraw Hill Publishing Company\n",
      "## Example in Page 413\n",
      "\n",
      "\n",
      "import math\n",
      "\n",
      "## Given data\n",
      "va = 2500e+3; ##Volt-Ampere rating of the transformer, VA\n",
      "vll = 6600.; ## Line to Line voltage in volts\n",
      "r = 0.073; ## Resistance in Ohms\n",
      "pf1 = 0.8;\n",
      "phase = 3.;\n",
      "vref = 3640.; ## Reference for voltage in volts\n",
      "iref = 340.; ## Reference for current in Amperes\n",
      "\n",
      "## Calculations\n",
      "z_s = vref/iref;\n",
      "x_s = math.sqrt(z_s**2 - r**2);\n",
      "print('By Referring to Fig. 10-19');\n",
      "phi = math.acos(pf1);\n",
      "V = vll / math.sqrt(3.);\n",
      "I = round(va / (phase*V)) ;\n",
      "V_vec = complex(V*math.cos(phi) ,V*math.sin(phi));\n",
      "E = V_vec + complex(I*r , I*x_s);\n",
      "E_mag = math.sqrt((E.real)**2+ (E.imag)**2)\n",
      "\n",
      "Regulation = ((E_mag - V)/V)*100;\n",
      "\n",
      "print'%s %.2f %s'%(\" Regulation is found to be \",Regulation,\" %%\");\n",
      "\n",
      "\n",
      "\n",
      "## Result\n",
      "## By Referring to Fig. 10-19   \n",
      "## Regulation is found to be 45.73 % \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "By Referring to Fig. 10-19\n",
        " Regulation is found to be  45.73  %%\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex12-pg416"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "## Example10_12_pg416.sce\n",
      "## Regulation by mmf method\n",
      "## Theory of Alternating Current Machinery by Alexander Langsdorf\n",
      "## First Edition 1999, Thirty Second reprint\n",
      "## Tata McGraw Hill Publishing Company\n",
      "## Example in Page 416\n",
      "\n",
      "import math\n",
      "\n",
      "## Given data\n",
      "va = 2500e+3; ## Volt Ampere rating of the transformer, VA\n",
      "vll = 6600.; ## Line to Line voltage, Volts\n",
      "r = 0.073; ## Resistance in Ohms\n",
      "x = 0.87; ## Reactance in Ohms\n",
      "pf1 = 0.8;\n",
      "phase = 3.;\n",
      "\n",
      "## Calculations \n",
      "\n",
      "phi = math.acos(pf1);\n",
      "V = vll / math.sqrt(3.);\n",
      "I = round(va / (phase*V)) ;\n",
      "IR_a = I*r;\n",
      "IX_a = I*x;\n",
      "V_vec = complex(V*math.cos(phi) ,math.sin(phi));\n",
      "E = V_vec + IR_a;\n",
      "E_mag = math.sqrt((E.real)**2+ (E.imag)**2)\n",
      "F_r1_mag = 16500.;\n",
      "cos_alpha = ((E.real)/E_mag);\n",
      "sin_alpha = ((E.imag)/E_mag);\n",
      "alpha = math.acos(cos_alpha);\n",
      "F_r1 = complex(F_r1_mag*math.cos(math.pi/2 + alpha) , F_r1_mag*math.sin(math.pi/2. + alpha));\n",
      "A_plus_Ax = 10000.;\n",
      "F = F_r1 - (A_plus_Ax);\n",
      "F_mag = math.sqrt((F.real)**2+ (F.imag)**2)\n",
      "print'%s %.2f %s'%(\"\\n Magnitude of F is \",F_mag,\" amp-turns per pole\");\n",
      "print('This magnitude of F corresponds to Open-circuit voltage of 4330 Volts');\n",
      "oc_volt = 4330.;\n",
      "regulation = ((oc_volt - V)/V)*100;\n",
      "print'%s %.2f %s'%(\"\\nRegulation is found to be \", regulation,\"\");\n",
      "\n",
      "## Result\n",
      "##  Magnitude of F is 23866.02 amp-turns per pole \n",
      "## This magnitude of F corresponds to Open-circuit voltage of 4330 Volts   \n",
      "##\n",
      "## Regulation is found to be 13.6 % \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " Magnitude of F is  19295.46  amp-turns per pole\n",
        "This magnitude of F corresponds to Open-circuit voltage of 4330 Volts\n",
        "\n",
        "Regulation is found to be  13.63 \n"
       ]
      }
     ],
     "prompt_number": 3
    }
   ],
   "metadata": {}
  }
 ]
}