Skip to content

Commit

Permalink
WIP: fixing convergence issues in corner cases
Browse files Browse the repository at this point in the history
  • Loading branch information
rbolgaryn committed Nov 8, 2023
1 parent 8715924 commit b82b024
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pandapower/pf/create_jacobian_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from scipy.sparse import csr_matrix, lil_matrix, diags
from pandapower.pf.makeYbus_facts import calc_y_svc_pu

SMALL_NUMBER = 1e-20
SMALL_NUMBER = 1e-9

def create_J_modification_svc(J, svc_buses, pvpq, pq, pq_lookup, V, x_control, svc_x_l_pu, svc_x_cvar_pu,
nsvc, nsvc_controllable, svc_controllable):
Expand Down
4 changes: 2 additions & 2 deletions pandapower/pypower/newtonpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ def _evaluate_Fx_facts(V,pq ,svc_buses=None, svc_set_vm_pu=None, tcsc_controllab
old_F[-len(pq)+pq_lookup[vsc_tb[ac_mode_v]]] = mis_vsc_v
ac_mode_q = vsc_mode_ac == 1
Sbus_vsc = V * conj(Ybus_vsc * V)
mis_vsc_q = Sbus_vsc[vsc_fb[ac_mode_q]].imag - vsc_value_ac[ac_mode_q]
mis_vsc_q = Sbus_vsc[vsc_fb[ac_mode_q]].imag * 0.5 - vsc_value_ac[ac_mode_q] # todo test for when they share same bus
old_F[-len(pq) + pq_lookup[vsc_tb[ac_mode_q]]] = mis_vsc_q


Expand Down Expand Up @@ -652,7 +652,7 @@ def _evaluate_Fx_facts(V,pq ,svc_buses=None, svc_set_vm_pu=None, tcsc_controllab
# a configuration of B2B bus connecting also with DC lines could be implemented here in the future if needed:
if len(dc_p):
# vsc_set_p_pu[vsc_p] = -P_dc[dc_p][dc_p_lookup[vsc_dc_p_bus]]
vsc_set_p_pu[vsc_p] = vsc_value_dc[vsc_p]
vsc_set_p_pu[vsc_p] = vsc_value_dc[vsc_p] # todo test for when they share same bus
if len(dc_ref):
# vsc_set_p_pu[vsc_mode_dc == 1] = -P_dc[dc_ref][dc_ref_lookup[vsc_dc_ref_bus]] # dc_p
vsc_set_p_pu[vsc_ref] = -Pbus_hvdc[dc_ref][dc_ref_lookup[vsc_dc_ref_bus]] / count_ref[vsc_dc_bus[vsc_ref]]
Expand Down
4 changes: 2 additions & 2 deletions pandapower/test/loadflow/test_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,7 @@ def test_simple_vsc_hvdc():


def test_simple_2vsc_hvdc1():
np.set_printoptions(linewidth=1000, suppress=True, precision=3)
# np.set_printoptions(linewidth=1000, suppress=True, precision=3)
net = pp.create_empty_network()
# AC part
pp.create_buses(net, 3, 110, geodata=((0, 0), (100, 0), (200, 0)))
Expand Down Expand Up @@ -1680,7 +1680,7 @@ def test_simple_2vsc_hvdc1():


def test_simple_2vsc_hvdc2():
np.set_printoptions(linewidth=1000, suppress=True, precision=3)
# np.set_printoptions(linewidth=1000, suppress=True, precision=3)
net = pp.create_empty_network()
# AC part
pp.create_buses(net, 3, 110, geodata=((0, 0), (100, 0), (200, 0)))
Expand Down

0 comments on commit b82b024

Please sign in to comment.