Network_data.py 5.23 KB
 Markus Mirz committed Sep 20, 2018 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 78 79 80 81 82 83 ``````def Network_95_nodes(Base, slackV): import numpy class Branch: def __init__(self, bstart, bend, blength, br, bx, Base): self.num = len(bstart) self.start = bstart self.end = bend self.code = numpy.linspace(1,self.num,self.num) self.R = numpy.multiply(br,blength) self.X = numpy.multiply(bx,blength) # self.R = numpy.divide(R,Base.Z) # self.X = numpy.divide(X,Base.Z) self.Z = self.R + 1j*self.X class Node: def __init__(self, ntype, slackV, P, Q): self.type = ntype self.P = P self.Q = Q P2 = numpy.concatenate(([slackV,],P),axis=0) Q2 = numpy.concatenate(([0,],Q),axis=0) self.pwr_flow_values = [ntype, P2, Q2] self.num = len(ntype) bstart = numpy.array([1, 2, 1, 4, 5, 5, 7, 7, 9, 9, 11, 12, 13, 13, 15, 15, 17, 17, 19, 20, 19, 22, 23, 24, 25, 25, 27, 11, 29, 29, 31, 31, 33, 34, 33, 36, 37, 38, 39, 37, 41, 42, 43, 43, 45, 46, 47, 48, 48, 50, 50, 52, 52, 42, 55, 56, 56, 58, 55, 60, 61, 62, 61, 64, 65, 65, 67, 68, 69, 69, 71, 72, 73, 74, 74, 60, 77, 78, 79, 80, 78, 82, 82, 84, 85, 86, 84, 88, 89, 90, 91, 92, 93, 94]) bend = numpy.array([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, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95]) bR = numpy.array([0.05489, 0.03881, 0.04879, 0.09755, 0.17322, 0.21, 0.24251, 0.2586, 0.34645, 0.1293, 0.30169, 0.19395, 0.17322, 0.23705, 0.20787, 0.2586, 0.13858, 0.1293, 0.1724, 0.10775, 0.2155, 0.19395, 0.30169, 0.09, 0.13161, 0.36, 0.12, 0.295, 0.20787, 0.354, 0.24251, 0.27716, 0.2586, 0.3118, 0.11149, 0.34612, 0.15608, 0.22298, 0.2135, 0.34479, 0.1293, 0.118, 0.20787, 0.236, 0.177, 0.09401, 0.177, 0.236, 0.354, 0.354, 0.27716, 0.2135, 0.53374, 0.1724, 0.20787, 0.27716, 0.41574, 0.27716, 0.30169, 0.36517, 0.17322, 0.3118, 0.14607, 0.25562, 0.20787, 0.18258, 0.29213, 0.25562, 0.09401, 0.4382, 0.2191, 0.07521, 0.14607, 0.29213, 0.40168, 0.2586, 0.1293, 0.18258, 0.29213, 0.4382, 0.2155, 0.1293, 0.19395, 0.27716, 0.48502, 0.22621, 0.2586, 0.06465, 0.27244, 0.16346, 0.0862, 0.15085, 0.27244, 0.49039]) bX = numpy.array([0.0569, 0.104, 0.05058, 0.33284, 0.07589, 0.203, 0.10624, 0.17673, 0.15178, 0.08836, 0.20618, 0.13255, 0.07589, 0.172, 0.09107, 0.17673, 0.06071, 0.08836, 0.11782, 0.07364, 0.14727, 0.13255, 0.20618, 0.087, 0.05033, 0.348, 0.116, 0.15, 0.09107, 0.18, 0.10624, 0.12142, 0.17673, 0.1366, 0.07376, 0.20653, 0.10326, 0.14752, 0.09126, 0.23564, 0.08836, 0.06, 0.09107, 0.12, 0.09, 0.03595, 0.09, 0.12, 0.18, 0.18, 0.12142, 0.09126, 0.22816, 0.11782, 0.09107, 0.12142, 0.18213, 0.12142, 0.20618, 0.15244, 0.07589, 0.1366, 0.06098, 0.10671, 0.09107, 0.07622, 0.12195, 0.10671, 0.03595, 0.18293, 0.09146, 0.02876, 0.06098, 0.12195, 0.16768, 0.17673, 0.08836, 0.07622, 0.12195, 0.17673, 0.14727, 0.08836, 0.13255, 0.12142, 0.21249, 0.04686, 0.17673, 0.04418, 0.04012, 0.02407, 0.05891, 0.10309, 0.04012, 0.07222]) blength = numpy.linspace(1,1,94) nPQ = 'PQ' P = [0, 0.82092, 0, 0, 0.01461, 0, 0.03046, 0, 0.02805, 0, 0.00487, 0, 0.00487, 0, 0.01569, 0, 0.01316, 0, 0, 0.05754, 0.05725, 0.02777, 0.0292, 0, 0.01464, 0.6776, -0.675, 0, 0.02632, 0, 0.01831, 0, 0.0483, 0.03407, 0.02777, 0, 0.05605, 0.11734, 0.00733, 0.01098, 0, 0, 0.03167, 0.05264, 0, 0, 0, 0.01461, 0, 0.01562, 0, 0.03167, 0.04493, 0, 0, 0.00779, 0.00876, 0.00733, 0.02777, 0, 0.01461, 0.01461, 0.01783, 0, 0.02681, 0.0292, 0.02734, 0, 0.03407, 0.01363, 0, 0, 0, 0.01266, 0.05078, 0, 0, 0, 0, 0.05359, 0, 0.025, 0, 0.08578, 0, 0.09698, 0.04563, 0, 0.13277, 0, 0.0561, 0, 0.04806, -0.675] P = numpy.multiply(P,(10**6/Base.S)) Q = [0, 0.14346, 0, 0, 0.00208, 0, 0.00434, 0, 0.004, 0, 0.00069, 0, 0.00069, 0, 0.00516, 0, 0.00224, 0, 0, 0.00969, 0.00817, 0.00432, 0.00416, 0, 0.00209, 0.22267, 0.2219, 0, 0.00449, 0, 0.00261, 0, 0.00762, 0.00486, 0.00432, 0, 0.00799, 0.02783, 0.00104, 0.00156, 0, 0, 0.00451, 0.00899, 0, 0, 0, 0.00208, 0, 0.00259, 0, 0.00451, 0.00863, 0, 0, 0.00111, 0.00124, 0.00104, 0.00432, 0, 0.00208, 0.00208, 0.00328, 0, 0.00381, 0.00416, 0.005, 0, 0.00486, 0.00194, 0, 0, 0, 0.00181, 0.00982, 0, 0, 0, 0, 0.00764, 0, 0.005, 0, 0.01897, 0, 0.01456, 0.01, 0, 0.02485, 0, 0.00799, 0, 0.00796, 0.2219] Q = numpy.multiply(Q,(10**6/Base.S)) ntype = ['slack'] for j in range(1, len(P)+1): ntype.append(nPQ) branch = Branch(bstart, bend, blength, bR, bX, Base) node = Node(ntype, slackV, P, Q) return branch, node ``````