Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pf2pp: reactive and active power limits of gen and sgens will be converted #2359

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Change Log

[upcoming release] - 2024-..-..
-------------------------------
- [ADDED] pf2pp: min/max q_mvar and min/max p_mw limits for sgens and gen will be converted
- [FIXED] using loc to remove the warning
- [FIXED] replacing deprecated H and A from scipy.sparse.csc_matrix
- [ADDED] low voltage grid Schutterwald
Expand Down
40 changes: 36 additions & 4 deletions pandapower/converter/powerfactory/pp_import_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1898,13 +1898,26 @@ def create_sgen_genstat(net, item, pv_as_slack, pf_variable_p_gen, dict_net, is_
logger.debug('av_mode: %s - creating as gen' % av_mode)
params.vm_pu = item.usetp
del params['q_mvar']

# add reactive and active power limits
params.min_q_mvar = item.cQ_min
params.max_q_mvar = item.cQ_max
params.min_p_mw = item.Pmin_uc
params.max_p_mw = item.Pmax_uc

sg = pp.create_gen(net, **params)
element = 'gen'
else:
if is_unbalanced:
sg = pp.create_asymmetric_sgen(net, **params)
element = "asymmetric_sgen"
else:
# add reactive and active power limits
params.min_q_mvar = item.cQ_min
params.max_q_mvar = item.cQ_max
params.min_p_mw = item.Pmin_uc
params.max_p_mw = item.Pmax_uc

sg = pp.create_sgen(net, **params)
element = 'sgen'
logger.debug('created sgen at index <%d>' % sg)
Expand Down Expand Up @@ -2088,13 +2101,32 @@ def create_sgen_sym(net, item, pv_as_slack, pf_variable_p_gen, dict_net):
if av_mode == 'constv':
logger.debug('creating sym %s as gen' % name)
vm_pu = item.usetp
sid = pp.create_gen(net, bus=bus1, p_mw=p_mw, vm_pu=vm_pu,
name=name, type=cat, in_service=in_service, scaling=global_scaling)
if item.iqtype == 1:
type = item.typ_id
sid = pp.create_gen(net, bus=bus1, p_mw=p_mw, vm_pu=vm_pu,
min_q_mvar=type.Q_min, max_q_mvar=type.Q_max,
min_p_mw=item.Pmin_uc, max_p_mw=item.Pmax_uc,
name=name, type=cat, in_service=in_service, scaling=global_scaling)
else:
sid = pp.create_gen(net, bus=bus1, p_mw=p_mw, vm_pu=vm_pu,
min_q_mvar=item.cQ_min, max_q_mvar=item.cQ_max,
min_p_mw=item.Pmin_uc, max_p_mw=item.Pmax_uc,
name=name, type=cat, in_service=in_service, scaling=global_scaling)
element = 'gen'
elif av_mode == 'constq':
q_mvar = ngnum * item.qgini * multiplier
sid = pp.create_sgen(net, bus=bus1, p_mw=p_mw, q_mvar=q_mvar,
name=name, type=cat, in_service=in_service, scaling=global_scaling)
if item.iqtype == 1:
type = item.typ_id
sid = pp.create_sgen(net, bus=bus1, p_mw=p_mw, q_mvar=q_mvar,
min_q_mvar=type.Q_min, max_q_mvar=type.Q_max,
min_p_mw=item.Pmin_uc, max_p_mw=item.Pmax_uc,
name=name, type=cat, in_service=in_service, scaling=global_scaling)
else:
sid = pp.create_sgen(net, bus=bus1, p_mw=p_mw, q_mvar=q_mvar,
min_q_mvar=item.cQ_min, max_q_mvar=item.cQ_max,
min_p_mw=item.Pmin_uc, max_p_mw=item.Pmax_uc,
name=name, type=cat, in_service=in_service, scaling=global_scaling)

element = 'sgen'

if sid is None or element is None:
Expand Down
Loading