Aufgrund einer Störung des s3 Storage, könnten in nächster Zeit folgende GitLab Funktionen nicht zur Verfügung stehen: LFS, Container Registry, Job Artifacs, Uploads (Wiki, Bilder, Projekt-Exporte). Wir bitten um Verständnis. Es wird mit Hochdruck an der Behebung des Problems gearbeitet. Weitere Informationen zur Störung des Object Storage finden Sie hier: https://maintenance.itc.rwth-aachen.de/ticket/status/messages/59-object-storage-pilot

Commit e15940a0 authored by Jan Dinkelbach's avatar Jan Dinkelbach
Browse files

Merge branch 'updates-mpa' into development

parents 1372d438 18f81440
...@@ -95,7 +95,6 @@ class System(): ...@@ -95,7 +95,6 @@ class System():
self.branches = [] self.branches = []
self.breakers = [] self.breakers = []
self.Ymatrix = np.zeros([], dtype=np.complex) self.Ymatrix = np.zeros([], dtype=np.complex)
self.Adjacencies = np.array([])
def get_node_by_uuid(self, node_uuid): def get_node_by_uuid(self, node_uuid):
for node in self.nodes: for node in self.nodes:
...@@ -335,16 +334,16 @@ class System(): ...@@ -335,16 +334,16 @@ class System():
self.reindex_nodes_list() self.reindex_nodes_list()
nodes_num = self.get_nodes_num() nodes_num = self.get_nodes_num()
self.Ymatrix = np.zeros((nodes_num, nodes_num), dtype=np.complex) self.Ymatrix = np.zeros((nodes_num, nodes_num), dtype=np.complex)
self.Adjacencies = [[] for _ in range(nodes_num)] self.Bmatrix = np.zeros((nodes_num, nodes_num), dtype=np.complex)
for branch in self.branches: for branch in self.branches:
fr = branch.start_node.index fr = branch.start_node.index
to = branch.end_node.index to = branch.end_node.index
self.Ymatrix[fr][to] -= branch.y_pu self.Ymatrix[fr][to] -= branch.y_pu
self.Ymatrix[to][fr] -= branch.y_pu self.Ymatrix[to][fr] -= branch.y_pu
self.Ymatrix[fr][fr] += branch.y_pu self.Ymatrix[fr][fr] += branch.y_pu # + branch.b_pu
self.Ymatrix[to][to] += branch.y_pu self.Ymatrix[to][to] += branch.y_pu # + branch.b_pu
self.Adjacencies[fr].append(to + 1) # to + 1??? # self.Bmatrix[fr][to] += branch.b_pu
self.Adjacencies[to].append(fr + 1) # fr + 1??? # self.Bmatrix[to][fr] += branch.b_pu
#Testing functions #Testing functions
def print_nodes_names(self): def print_nodes_names(self):
......
...@@ -40,24 +40,14 @@ def solve(system): ...@@ -40,24 +40,14 @@ def solve(system):
H[m][i] = 1 H[m][i] = 1
H[m + 1][i2] = 1 H[m + 1][i2] = 1
elif node_type is BusType.PQ: elif node_type is BusType.PQ:
H[m][i] = - np.real(system.Ymatrix[i][i]) H[m][:nodes_num] = np.real(system.Ymatrix[i])
H[m][i2] = np.imag(system.Ymatrix[i][i]) H[m][nodes_num:] = - np.imag(system.Ymatrix[i])
H[m + 1][i] = - np.imag(system.Ymatrix[i][i]) H[m+1][:nodes_num] = np.imag(system.Ymatrix[i])
H[m + 1][i2] = - np.real(system.Ymatrix[i][i]) H[m+1][nodes_num:] = np.real(system.Ymatrix[i])
idx1 = np.subtract(system.Adjacencies[i], 1)
idx2 = idx1 + nodes_num
H[m][idx1] = - np.real(system.Ymatrix[i][idx1])
H[m][idx2] = np.imag(system.Ymatrix[i][idx1])
H[m + 1][idx1] = - np.imag(system.Ymatrix[i][idx1])
H[m + 1][idx2] = - np.real(system.Ymatrix[i][idx1])
elif node_type is BusType.PV: elif node_type is BusType.PV:
z[m + 1] = np.real(node.power) z[m + 1] = np.real(node.power)
H[m][i] = - np.real(system.Ymatrix[i][i]) H[m][:nodes_num] = np.real(system.Ymatrix[i])
H[m][i2] = np.imag(system.Ymatrix[i][i]) H[m][nodes_num:] = - np.imag(system.Ymatrix[i])
idx1 = np.subtract(system.Adjacencies[i], 1)
idx2 = idx1 + nodes_num
H[m][idx1] = - np.real(system.Ymatrix[i][idx1])
H[m][idx2] = np.imag(system.Ymatrix[i][idx1])
epsilon = 10 ** (-10) epsilon = 10 ** (-10)
#epsilon = 0.01 #epsilon = 0.01
...@@ -86,7 +76,7 @@ def solve(system): ...@@ -86,7 +76,7 @@ def solve(system):
h[m + 1] = np.inner(H[m + 1], state) h[m + 1] = np.inner(H[m + 1], state)
elif node_type is BusType.PV: elif node_type is BusType.PV:
z[m] = (np.real(node.power_pu) * np.real(V[i]) + z[m] = (np.real(node.power_pu) * np.real(V[i]) +
np.imag(node.power_pu) * np.imag(V[i]))(np.abs(V[i]) ** 2) np.imag(node.power_pu) * np.imag(V[i])) / (np.abs(V[i]) ** 2)
h[m] = np.inner(H[m], state) h[m] = np.inner(H[m], state)
h[m + 1] = np.abs(V[i]) h[m + 1] = np.abs(V[i])
H[m + 1][i] = np.cos(np.angle(V[i])) H[m + 1][i] = np.cos(np.angle(V[i]))
......
This diff is collapsed.
...@@ -44,7 +44,7 @@ class Results(): ...@@ -44,7 +44,7 @@ class Results():
self.nodes = [] self.nodes = []
self.branches = [] self.branches = []
self.Ymatrix = system.Ymatrix self.Ymatrix = system.Ymatrix
self.Adjacencies = system.Adjacencies self.Bmatrix = system.Bmatrix
for node in system.nodes: for node in system.nodes:
if node.ideal_connected_with == '': if node.ideal_connected_with == '':
self.nodes.append(ResultsNode(topo_node=node)) self.nodes.append(ResultsNode(topo_node=node))
...@@ -106,7 +106,7 @@ class Results(): ...@@ -106,7 +106,7 @@ class Results():
for branch in self.branches: for branch in self.branches:
fr = branch.topology_branch.start_node.index fr = branch.topology_branch.start_node.index
to = branch.topology_branch.end_node.index to = branch.topology_branch.end_node.index
branch.current_pu = - (self.nodes[fr].voltage_pu - self.nodes[to].voltage_pu) * self.Ymatrix[fr][to] branch.current_pu = - (self.nodes[fr].voltage_pu - self.nodes[to].voltage_pu) * self.Ymatrix[fr][to] + 1j*self.Bmatrix[fr][to] * self.nodes[fr].voltage_pu
branch.current = branch.current_pu * branch.topology_branch.base_current branch.current = branch.current_pu * branch.topology_branch.base_current
def calculateIinj(self): def calculateIinj(self):
...@@ -121,7 +121,7 @@ class Results(): ...@@ -121,7 +121,7 @@ class Results():
fr = fr + branch.current_pu fr = fr + branch.current_pu
if node.topology_node.index == branch.topology_branch.end_node.index: if node.topology_node.index == branch.topology_branch.end_node.index:
to = to + branch.current_pu to = to + branch.current_pu
node.current_pu = to - fr node.current_pu = fr - to
node.current = node.current_pu * node.topology_node.base_current node.current = node.current_pu * node.topology_node.base_current
def calculateSinj(self): def calculateSinj(self):
......
...@@ -26,7 +26,7 @@ for file in xml_files: ...@@ -26,7 +26,7 @@ for file in xml_files:
xml_files_abs.append(os.path.abspath(file)) xml_files_abs.append(os.path.abspath(file))
# read cim files and create new network.Systen object # read cim files and create new network.Systen object
res, _ = cimpy.cim_import(xml_files_abs, "cgmes_v2_4_15") res, _, _ = cimpy.cim_import(xml_files_abs, "cgmes_v2_4_15")
system = network.System() system = network.System()
base_apparent_power = 25 # MW base_apparent_power = 25 # MW
system.load_cim_data(res, base_apparent_power) system.load_cim_data(res, base_apparent_power)
...@@ -40,7 +40,7 @@ V_unc = 0 ...@@ -40,7 +40,7 @@ V_unc = 0
I_unc = 0 I_unc = 0
Sinj_unc = 0 Sinj_unc = 0
S_unc = 0 S_unc = 0
Pmu_mag_unc = 1 Pmu_mag_unc = 0
Pmu_phase_unc = 0 Pmu_phase_unc = 0
# Create measurements data structures # Create measurements data structures
......
Markdown is supported
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