Commit bbcaebe5 authored by admin-mpa's avatar admin-mpa
Browse files

Changed Jacobian signs to have generated power with positive values and...

Changed Jacobian signs to have generated power with positive values and consumed power with negative values
parent a0a7e582
......@@ -40,24 +40,24 @@ def solve(system):
H[m][i] = 1
H[m + 1][i2] = 1
elif node_type is BusType.PQ:
H[m][i] = - np.real(system.Ymatrix[i][i])
H[m][i2] = np.imag(system.Ymatrix[i][i])
H[m + 1][i] = - np.imag(system.Ymatrix[i][i])
H[m + 1][i2] = - np.real(system.Ymatrix[i][i])
H[m][i] = np.real(system.Ymatrix[i][i])
H[m][i2] = - np.imag(system.Ymatrix[i][i])
H[m + 1][i] = np.imag(system.Ymatrix[i][i])
H[m + 1][i2] = np.real(system.Ymatrix[i][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])
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:
z[m + 1] = np.real(node.power)
H[m][i] = - np.real(system.Ymatrix[i][i])
H[m][i2] = np.imag(system.Ymatrix[i][i])
H[m][i] = np.real(system.Ymatrix[i][i])
H[m][i2] = - np.imag(system.Ymatrix[i][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][idx1] = np.real(system.Ymatrix[i][idx1])
H[m][idx2] = - np.imag(system.Ymatrix[i][idx1])
epsilon = 10 ** (-10)
#epsilon = 0.01
......
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