Beispiel #1
0
ArtificialLoadBusSet = set()
necessaryMidpointSet = set()  # set of tf midpoints which need to be there
ParentDict = {}
AllToBeMappedSet = set()  # All the non-345 comed buses to be mapped
toGetPathSet = set(
)  # set of 138 kV belonging to the 3 SVC substations, from which we need to get paths to 345
OldToNewBusDict = {}  # key: new CAPE bus number, old: old CAPE bus number
# get the path from the three 138 kV substations where the SVCs are at, to nearest 345
impSubStationList = [
    'TSS 135 ELMHURST', 'TSS 117 PROSPECT HEIGHTS', 'STA 13 CRAWFORD'
]
AllToBeMappedLines = []
OldBusSet = set()
directTFConnLines = []
BoundaryBusSet = set()
CAPEBranchGroupDict = makeBranchGroups(CAPERaw)
ArtificialLoadLines = []


def populatePathDict(FromBus, toBus):
    # info needed for getting artificial load bus flows
    if toBus not in ParentDict.keys():
        ParentDict[toBus] = FromBus
    else:
        try:
            ParentBusGroup = CAPEBranchGroupDict[ParentDict[toBus]]
            if FromBus in ParentBusGroup:
                return
            ParentDict[toBus] += ',' + FromBus
        except:
            ParentDict[toBus] += ',' + FromBus
flowData = BusFlowData(flowReport, CAPERaw)
"""
Clues on how to access the data within flowData:
Each key of flowData contains the following class
class mismatchReport(object):
	def __init__(self):
		self.toBus = []
		self.MWList = []
		self.MVARList = []
		self.MVAList = []
		self.cktID = []
		self.MismatchMVA = 0.0
		self.MismatchMW = 0.0
		self.MismatchMVAR = 0.0
"""
BranchGroupDict = makeBranchGroups(CAPERaw)  # every value here is a set
##########################
#functions used here


def getMismatch(searchBus):
    # function to get the total mismatch
    totalMWMismatch = 0.0
    totalMVARMismatch = 0.0
    try:  # for bus groups
        for ties in list(BranchGroupDict[searchBus]):
            totalMWMismatch += flowData[ties].MismatchMW
            totalMVARMismatch += flowData[ties].MismatchMVAR

    except:  # for single buses
        totalMWMismatch = flowData[searchBus].MismatchMW
Beispiel #3
0
changeDictNewToOld = {}
changeDictOldToNew = {}
mismatchBusSet345 = set()
noMismatch345Set = set(
)  # set of 345 buses (not including fict midpoints) which show no mismatch
ComedCAPESet345 = set()
MapDict = {
}  # dict containing all CAPE bus maps (the bus numbers all include the latest numbers, ie, include 75xxxxx and 27xxxxx)
maxDepth = 3  # max depth in CAPE for impedance branch comparison
planningUnmappedList = []
explored = set()
planningExplored = set()
#################################

# get all the ties to buses which have no mismatch
BranchGroupDict = makeBranchGroups(CAPERaw)  # every value here is a set
#_, BranchDataDictCAPE = generateNeighbours(CAPERaw)
_, BranchDataDictPlanning = generateNeighbours(planningRaw)
BusDataDict = getBusData(CAPERaw)
BranchGroupDictPlanning = makeBranchGroups(planningRaw)


def printUsefulMappingOutput(originBus, CAPEneighbour, planningBus,
                             planningNeighbour, searchDepth):
    # output mapping info which helps in checking its validity, originBus: CAPE origin bus, CAPEneighbour: CAPE to bus, planningBus: planning from Bus, planningNeighbour: planning to bus
    # searchDepth: depth from CAPE to and from bus
    print CAPEneighbour + '->' + str(
        autoMapDict[CAPEneighbour]
    ) + '\t' + planningBus + ',' + planningNeighbour + ',' + originBus + ',' + CAPEneighbour + ',' + str(
        searchDepth)
Beispiel #4
0
from updatedMaps import MapDictNew, MapDictOld # needed to scan mappings and compare branch data (between CAPE and planning)
from getBusDataFn import getBusData # function to all relevant bus data given the raw file
from getBranchGroupFn import makeBranchGroups # to help with identifying all the fringe buses causing mismatch
flowReport = 'BusReports_RAW0509.txt'
sortedMismatchData = 'sortedMismatchData0509.txt'
CAPERaw = 'RAW0509.raw'
planningRaw = 'hls18v1dyn_1219.raw'
getMaxFlowBranches = 'mismatchAnalysisv2.txt' # contains the mismatch info as well as some info about the branch which causes max mismatch
flowDict = {}
mismatchSet = set()
areaList = []
exploredBranchSet = set() # set of branches already identified as the main cause behind mismatches
mismatchAnalysis = [] # lines which will contain the max mismatch branch data as well as the total mismatch at the bus
BusDataCAPE = getBusData(CAPERaw) # contains all the bus data for all in-service buses in CAPE
BusDataPlanning = getBusData(planningRaw) # contains all the bus data for all in-service buses in planning
BusGroupData = makeBranchGroups(CAPERaw) # contains dict for every bus which has ties

class mismatchReport(object):
	def __init__(self):
		self.toBus = []
		self.MWList = []
		self.MVARList = []
		self.MVAList = []
		self.cktID = []
		self.MismatchMVA = 0.0
		self.MismatchMW = 0.0
		self.MismatchMVAR = 0.0


def tryMatchImpedance(CAPEZ,PlanningBus1):
	# searches for possible matches using the CAPE branch impedance and PlanningBus1