summaryrefslogtreecommitdiff
path: root/Electrical_Power_System_by_C.L._Wadhwa/Chapter21.ipynb
blob: 15522b9741a7bb945291621640ed2f770e41e13f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 21 : Compensation In Power Systems"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 21.1, Page No 683"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "import numpy\n",
      "#initialisation of variables\n",
      "\n",
      "load1=complex(10,15)\t\t#load per phase(MVA)\n",
      "SCC=250.0/3\n",
      "V=11/math.sqrt(3)\n",
      "P=30\n",
      "Q=45\n",
      "Z=(11/math.sqrt(3))**2.0/(250.0/3)\t#Equivalent short circuit impedence\n",
      "\n",
      "#Calculations\n",
      "dsc=math.degrees(math.atan(5))\n",
      "R=.0949\n",
      "X=.4746\n",
      "#Using equation: V**2= (Vcosd+PR/V)**2 + (Vsind+QX/V)**2, we get \n",
      "y=numpy.polynomial.polynomial.polyval3d(51.7,0,-27.5,1)\n",
      "X=numpy.roots(y)\n",
      "V=5.046\n",
      "print(\"V=%.3f\" %V)\n",
      "dV=6.35-V\n",
      "Ssc=250\n",
      "#using expression ,a=dV/v=1(Pcos(dsc)+Qsin(dsc))/Ssc +j(Psin(dsc)-Qcos(dsc))/Ssc\n",
      "\n",
      "a=(P*math.cos(math.radians(dsc))+Q*math.sin(math.radians(dsc)))/Ssc +complex(P*math.sin(math.radians(dsc))-Q*math.cos(math.radians(dsc)))/Ssc\n",
      "\n",
      "#Results\n",
      "print(\"dV/V= %.2f \" %abs(a))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "V=5.046\n",
        "dV/V= 0.28 \n"
       ]
      }
     ],
     "prompt_number": 14
    }
   ],
   "metadata": {}
  }
 ]
}