Commit b144b1cc authored by Markus Mirz's avatar Markus Mirz
Browse files

minor restructuring

parent 8c28c3a4
......@@ -20,8 +20,8 @@ class Znod:
self.R = self.Z.real
self.X = self.Z.imag
def BC_power_flow(branches, nodes):
"""It performs Power Flow by using rectangular branches current state variables."""
def solve(branches, nodes):
"""It performs Power Flow by using rectangular branch current state variables."""
znod = Znod(branches,nodes)
# real matrices storing complex numbers
......
......@@ -15,7 +15,7 @@ def Ymatrix_calc(branch, node):
Adjacencies[to].append(fr+1)
return Ymatrix, Adjacencies
def NV_power_flow(branch, node):
def solve(branch, node):
"""It performs Power Flow by using rectangular node voltage state variables."""
Ymatrix, Adj = Ymatrix_calc(branch,node)
......
......@@ -20,4 +20,9 @@ slackV = 1.02
Base = PerUnit(S,V)
branch, node = py_95bus_network_data.Network_95_nodes(Base, slackV)
Vtrue, Itrue, Iinjtrue, S1true, S2true, Sinjtrue, num_iter = bc_powerflow.BC_power_flow(branch, node)
\ No newline at end of file
Vtrue, Itrue, Iinjtrue, S1true, S2true, Sinjtrue, num_iter = bc_powerflow.solve(branch, node)
system = network.load_python_data(node, branch)
#Vtrue_cim, Itrue_cim, Iinjtrue_cim, S1true_cim, S2true_cim, Sinjtrue_cim, num_iter_cim = nv_powerflow_cim.solve(system)
print('done')
......@@ -19,9 +19,9 @@ def Network_95_nodes(Base, slackV):
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.P2 = numpy.concatenate(([slackV,],P),axis=0)
self.Q2 = numpy.concatenate(([0,],Q),axis=0)
self.pwr_flow_values = [ntype, self.P2, self.Q2]
self.num = len(ntype)
......
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