Commit 972d2a0b authored by martin.moraga's avatar martin.moraga
Browse files

fixed some errors

parent 5bfb9cbf
......@@ -18,7 +18,7 @@ class Node():
self.power = complex(p, q)
self.voltage = v_mag*np.cos(v_phase) + 1j * v_mag*np.sin(v_phase)
self.type = BusType[bus_type]
class Branch():
def __init__(self, r, x, start_node, end_node):
self.r = r
......@@ -26,7 +26,7 @@ class Branch():
self.start_node = start_node
self.end_node = end_node
self.z = self.r + 1j*self.x
self.y = 1/self.z
self.y = 1/self.z if (self.z != 0) else 0
class System():
def __init__(self):
......@@ -36,8 +36,8 @@ class System():
self.bX=[]
self.P=[]
self.Q=[]
def load_cim_data(res):
def load_cim_data(self, res):
#this function is used to fill the vectors node, branch, bR, bX, P and Q
for key, value in res.items():
if value.__class__.__name__=="TopologicalNode":
......
import sys
import logging
sys.path.append("..\..\cimpy")
sys.path.append("..")
import cimpy
import logging
from acs.state_estimation.network import System
logging.basicConfig(level=logging.INFO)
xml_files=[r"..\..\cim-grid-data\WSCC-09\WSCC-09_Neplan_EQ.xml",
......@@ -11,7 +15,8 @@ xml_files=[r"..\..\cim-grid-data\WSCC-09\WSCC-09_Neplan_EQ.xml",
res=cimpy.cimread(xml_files)
cimpy.setNodes(res)
cimpy.setPowerTransformerEnd(res)
network=System(res)
network=System()
network.load_cim_data(res)
print("Vector bR:")
print(network.bR)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment