{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 14 : Protective Relayes"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.1, Page No 366"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "If=4000.0\t# fault current \n",
      "I=5*1.25\t# operating current of relay \n",
      "\n",
      "#Calculations\n",
      "CT=400.0/5\t# CT ratio\n",
      "PSM=If/(I*CT)\t# plug setting multiplier\n",
      "\n",
      "#Results\n",
      "print(\"PSM =%.2f\" %PSM)\n",
      "print(\"operating time for PSM=8 is 3.2sec.\")\n",
      "print(\"actual operating time = 1.92 sec.\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "PSM =8.00\n",
        "operating time for PSM=8 is 3.2sec.\n",
        "actual operating time = 1.92 sec.\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.2, Page No 369"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "Z=1000.0*complex(math.cos(math.radians(60)),math.sin(math.radians(60)))   #impedence\n",
      "X=math.cos(math.radians(50))*1000*math.cos(math.radians(60))\n",
      "Xl=1000.0*math.cos(math.radians(60))\n",
      "Xc=Xl-X\n",
      "\n",
      "#Calculations\n",
      "C=1000000.0/(314.0*Xc)\n",
      "\n",
      "#Results\n",
      "#Answers don't match due to difference in rounding off of digits\n",
      "print(\"X= %.2f\" %X)\n",
      "print(\"Xc= %.2f\" %Xc)\n",
      "print(\"C(micro farads)= %.2f\" %C)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "X= 321.39\n",
        "Xc= 178.61\n",
        "C(micro farads)= 17.83\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.3, Page No 384"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "Isec1=4000.0/40# secondary current(amps)\n",
      "PSM=100.0/5# PSM if 100% setting is used\n",
      "Isec2=4000.0/40\n",
      "PSM2=100.0/6.25#PSM if setting used is 125%\n",
      "TMSb=0.72/2.5\n",
      "\n",
      "#Calculations\n",
      "PSM1=5000.0/(6.25*40)\n",
      "to=2.2\n",
      "tb=to*TMSb\n",
      "PSMa=5000/(6.25*80)\n",
      "TMS=1.138/3\n",
      "PSMa1=6000/(6.25*80)\n",
      "ta=(2.6*.379)\n",
      "\n",
      "#Results\n",
      "print(\"Actual operating time of realy at b=%.3f sec\" %tb)\n",
      "print(\"Actual operating time of realy at a=%.3f sec \" %ta)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Actual operating time of realy at b=0.634 sec\n",
        "Actual operating time of realy at a=0.985 sec \n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.4 Page No 399"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "Vph=6600/(math.sqrt(3))\n",
      "Ifull=5000/(math.sqrt(3)*6.6)\n",
      "\n",
      "#Calculations\n",
      "Ib=Ifull*.25\n",
      "x=Ib*800.0/Vph\n",
      "\n",
      "#Results\n",
      "print(\"Percent of the winding remains unprotected = %.2f \" %x)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Percent of the winding remains unprotected = 22.96 \n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.5, Page No 399"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "Iph=10000.0/math.sqrt(3)\t# phase voltage of alternator(V)\n",
      "x=1.8*100*10*1000.0/(5*Iph)\n",
      "\n",
      "#Calculations\n",
      "print(\"(i) percent winding which remains unprotected=%.2f \" %x)\n",
      "Ip=Iph*.2\n",
      "R=1.8*1000.0/(5*Ip)\n",
      "\n",
      "#Results\n",
      "print(\"(ii)minimum  value of earthing resistance required to protect 80 percent of winding =%.4f ohms\" %R)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) percent winding which remains unprotected=62.35 \n",
        "(ii)minimum  value of earthing resistance required to protect 80 percent of winding =0.3118 ohms\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.6, Page No 400"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "Ic=360-320    # the difference current (amp)\n",
      "Io=40*5/400.0\n",
      "\n",
      "#Calculations\n",
      "Avg=(360+320)/2    # average sum of two currents\n",
      "Iavg=340*5/400.0\n",
      "Ioc=.1*Iavg +0.2\n",
      "\n",
      "#Results\n",
      "print(\"operating current=%.3f amp. \" %Ioc)\n",
      "print(\"since current through  operating coil is %.3f amp.  \" %Io)\n",
      "print(\"therefore Relay will not operate \")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "operating current=0.625 amp. \n",
        "since current through  operating coil is 0.500 amp.  \n",
        "therefore Relay will not operate \n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.7 Page No 403"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "Il=400*6.6/33.0\t\t# line current on star side of PT(amps)\n",
      "\n",
      "#Calculations\n",
      "Ic=5/math.sqrt(3.0)\t\t# current in CT secondary \n",
      "\n",
      "#Results\n",
      "print(\" The CT ratio on HT will be %d : %.3f\" %(Il,Ic))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The CT ratio on HT will be 80 : 2.887\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.8, Page No 404"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "Il=10000.0/((math.sqrt(3.0))*132)\n",
      "ILV=10000/((math.sqrt(3.0))*6.6)\n",
      "\n",
      "#Calculations\n",
      "a=5.0/math.sqrt(3.0)\n",
      "\n",
      "#Results\n",
      "print(\"Ratio of CT on LV side is %.3f : %.3f\" %(ILV,a))\n",
      "print(\"Ratio of CT on HT side is %.3f : %d\" %(Il,5))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Ratio of CT on LV side is 874.773 : 2.887\n",
        "Ratio of CT on HT side is 43.739 : 5\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.9 Page No 404"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "Vs=110.0\n",
      "I=1.0\n",
      "\n",
      "#Calculations\n",
      "R2=Vs/(complex(3, -math.sqrt(3))*I)\n",
      "c=abs(R2)\n",
      "print(\"R2=%.2f ohms\" %c)\n",
      "R1=2*c\n",
      "d=abs(R1)\n",
      "C=(10**6)/(0.866*d*314)\n",
      "print(\"R1=%.2f ohms \" %R1)\n",
      "print(\"C=%.1f micro farads \" %C)\n",
      "Vt=d*complex(-0.5,-0.866) + complex(c,-55 )\n",
      "\n",
      "#Results\n",
      "print(\" Voltage across the terminals of the relay will be (V)= {0:.5f}+{1:.5f}i\" .format(Vt.real, Vt.imag))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "R2=31.75 ohms\n",
        "R1=63.51 ohms \n",
        "C=57.9 micro farads \n",
        " Voltage across the terminals of the relay will be (V)= 0.00000+-109.99839i\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.10 Page No 272"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "Ic=5*0.25\t\t# operating current(amp)\n",
      "Vsec=5.0/1.25\t# secondary voltage(V)\n",
      "Bm=1.4\n",
      "f=50\n",
      "N=50\n",
      "\n",
      "#Calculations\n",
      "V=15*Vsec\n",
      "A=60/(4.44*Bm*f*N)\n",
      "\n",
      "#Results\n",
      "print(\"The knee point must be slightly higher than =%.3f V \" %V)\n",
      "print(\"Area of cross section=%.6f m_2 \" %A)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The knee point must be slightly higher than =60.000 V \n",
        "Area of cross section=0.003861 m_2 \n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.11 Page No 273"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "\n",
      "#Calculations\n",
      "o_p=5*5*(.1+.1) +5\n",
      "\n",
      "#Results\n",
      "print(\" VA output of CT =%.0f VA\\n \" %o_p)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " VA output of CT =10 VA\n",
        " \n"
       ]
      }
     ],
     "prompt_number": 11
    }
   ],
   "metadata": {}
  }
 ]
}