Skip to content

[bug] Ideal 3 winding transformers with tap at hv side and star point do not work properly #2692

@DimitrisTrakas

Description

@DimitrisTrakas

Bug report checklis

  • Searched the issues page for similar reports

  • Read the relevant sections of the documentation

  • Browse the tutorials and tests for usefull code snippets and examples of use

  • Reproduced the issue after updating with pip install --upgrade pandapower (or git pull)

  • Tried basic troubleshooting (if a bug/error) like restarting the interpreter and checking the pythonpath

Reproducible Example

import pandapower as pp
import copy
import pandas as pd

net = pp.create_empty_network()
pp.set_user_pf_options(net, trafo3w_losses="star")

bus1 = pp.create_bus(net, name="Busbar 1", vn_kv=380)
bus2 = pp.create_bus(net, name="Busbar 2", vn_kv=220)
bus3 = pp.create_bus(net, name="Busbar 3", vn_kv=110)

pp.create_ext_grid(net, bus1, vm_pu=1.02, va_degree=2)
pp.create_load(net, bus2, p_mw=4, q_mvar=0.4, name="load")  # type: ignore
pp.create_transformer3w_from_parameters(
    net,
    bus1,
    bus2,
    bus3,
    vn_hv_kv=380,
    vn_mv_kv=220,
    vn_lv_kv=110,
    sn_hv_mva=400,
    sn_mv_mva=300,
    sn_lv_mva=100,
    vk_hv_percent=2.1,
    vk_mv_percent=2.1,
    vk_lv_percent=2.1,
    vkr_hv_percent=0.26,
    vkr_mv_percent=0.03,
    vkr_lv_percent=0.04,
    pfe_kw=0,
    i0_percent=0,
    shift_mv_degree=0,
    shift_lv_degree=0,
    tap_min=-15,
    tap_max=15,
    tap_neutral=4,
    tap_at_star_point=True,
    tap_side="hv",
    tap_pos=0,
    tap_step_percent=0,
    tap_step_degree=1,
    tap_changer_type="Ideal",
    name="HV-MV-MV-Trafo",
)

net_pos_0 = copy.deepcopy(net)

net_pos_1 = copy.deepcopy(net)
net_pos_1.trafo3w.tap_pos = 1

net_pos_2 = copy.deepcopy(net)
net_pos_2.trafo3w.tap_pos = 2

pp.runpp(net_pos_0)
pp.runpp(net_pos_1)
pp.runpp(net_pos_2)

net_pos_0.res_bus['vm_pu'] - net_pos_2.res_bus['vm_pu']
net_pos_0.res_bus['vm_pu'] - net_pos_1.res_bus['vm_pu']

net_pos_0.res_bus['va_degree'] - net_pos_2.res_bus['va_degree']
net_pos_0.res_bus['va_degree'] - net_pos_1.res_bus['va_degree']

Issue Description and Traceback

It seems that when tap_step_percent is equal to zero and tap_side is 'hv' and tap_at_star_point is 'True' , t variable in function _calculate_3w_tap_changers of pandapower.build_branch is always equal to zero regardless of the value of variable tap_step_degree.
Hence an ideal 3winding transformer does not operate properly. However, regarding ratio 3w transformers, it works properly.
In the above code, based on pp power flow results, the bus voltage magnitude is always the same regardless of tap position. Voltage angle has a difference of -180 degrees for consecutive tap positions (e.g. 3 and 4 or 4 and 5) and it is the same for tap positions with a difference of multiple of 2 (e.g., 2 and 4, 2 and 6, 4 and 6)

Expected Behavior

Correct angle shift of ideal 3w transformers

Installed Versions

INSTALLED VERSIONS

python : 3.12.3.final.0
pandapower 3.1.2
pandas : 2.2.2
numpy : 1.26.4
pytz : 2024.1
dateutil : 2.9.0.post0
setuptools : 75.1.0
pip : 24.2
Cython : None
pytest : 8.4.1
hypothesis : None
sphinx : 7.3.7
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 5.2.1
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.4
IPython : 8.27.0
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
bottleneck : 1.3.7
dataframe-api-compat : None
fastparquet : None
fsspec : 2024.6.1
gcsfs : None
matplotlib : 3.9.2
numba : 0.60.0
numexpr : 2.8.7
odfpy : None
openpyxl : 3.1.5
pandas_gbq : None
pyarrow : 16.1.0
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : 2024.6.1
scipy : 1.13.1
sqlalchemy : 2.0.34
tables : 3.10.1
tabulate : 0.9.0
xarray : 2023.6.0
xlrd : None
zstandard : 0.23.0
tzdata : 2023.3
qtpy : 2.4.1
pyqt5 : None

Label

  • Relevant labels are selected

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions