Skip to content

Commit

Permalink
Merge pull request #2195 from e2nIEE/fix/numerical_issues_tdpf
Browse files Browse the repository at this point in the history
add some safegueards for numerical issues in TDPF
  • Loading branch information
rbolgaryn authored Jan 2, 2024
2 parents 401d573 + e103bfd commit 79352a9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Change Log
- [CHANGED] cim2pp: extracted getting default classes, added generic setting datatypes from CGMES XMI schema
- [ADDED] function :code:`getOTDF` to obtain Outage Transfer Distribution Factors, that can be used to analyse outages using the DC approximation of the power system
- [ADDED] function :code:`outage_results_OTDF` to obtain the matrix of results for all outage scenarios, with rows as outage scenarios and columns as branch power flows in that scenario
- [FIXED] add some safeguards for TDPF to avoid numerical issues in some cases


[2.13.1] - 2023-05-12
Expand Down
2 changes: 1 addition & 1 deletion pandapower/pf/create_jacobian_tdpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def calc_r_theta(t_air_pu, a0, a1, a2, i_square_pu, p_loss_pu):
2019, pp. 1-6, doi: 10.1109/EEEIC.2019.8783234.
"""
t_rise_pu = a0 + a1 * i_square_pu + a2 * np.square(i_square_pu) - t_air_pu
r_theta_pu = t_rise_pu / p_loss_pu
r_theta_pu = t_rise_pu / np.where(p_loss_pu == 0, 1e-6, p_loss_pu)
return r_theta_pu


Expand Down
3 changes: 2 additions & 1 deletion pandapower/pypower/newtonpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ def newtonpf(Ybus, Sbus, V0, ref, pv, pq, ppci, options, makeYbus=None):

if tdpf:
# update the R, g, b for the tdpf_lines, and the Y-matrices
branch[tdpf_lines, BR_R] = r = r_ref_pu * (1 + alpha_pu * (T - t_ref_pu))
# here: limit the change of the R to reflect a realistic range of values for T to avoid numerical issues
branch[tdpf_lines, BR_R] = r = r_ref_pu * (1 + alpha_pu * np.clip(np.nan_to_num(T - t_ref_pu), -50, 250 / T_base))
# todo expansion with SSC and VSC (that are not controllable)
Ybus, Yf, Yt = makeYbus(baseMVA, bus, branch)
g, b = calc_g_b(r, x)
Expand Down

0 comments on commit 79352a9

Please sign in to comment.