Skip to content

Transformer tap positions are silently ignored with pandapower >= 3.0 #69

Description

@langestefan

get_simbench_net creates transformers without setting tap_changer_type.

Since pandapower 3.0, _calc_tap_from_dataframe only applies a transformer's tap_pos when tap_changer_type is set ("Ratio", "Symmetrical", "Ideal", or "Tabular" via tap_dependency_table).

With the default None the tap position is silently ignored. Because of this, every SimBench grid runs at neutral tap ratio regardless of
the tappos values in the dataset.

The converter still writes the pre-3.0 field tap_phase_shifter = False in _inscribe_fix_values, but that field no longer controls tap
application. Pandapower only reads it as a deprecated fallback when the tap_changer_type column is absent, which it never is here. Passing the old field through the create API would even trigger pandapower's migration and a deprecation warning, but the converter writes the column directly into the dataframe, bypassing both.

For reference see:

MWE

import simbench as sb
import pandapower as pp

net = sb.get_simbench_net("1-MV-urban--1-no_sw")
print(net.trafo.tap_pos.tolist())            # [-1.0, -1.0]
print(net.trafo.tap_changer_type.tolist())   # [None, None]

pp.runpp(net, calculate_voltage_angles=True)
vm_ignored = net.res_bus.vm_pu.copy()
print(net._ppc["branch"][-2:, 8].real)       # [1. 1.]  <- tap NOT applied

net.trafo["tap_changer_type"] = "Ratio"
pp.runpp(net, calculate_voltage_angles=True)
print(net._ppc["branch"][-2:, 8].real)       # [0.985 0.985]  <- tap applied

print((net.res_bus.vm_pu - vm_ignored).abs().max())   # 0.0165

Suggested fix

Apply the same classification pandapower's own convert_trafo_pst_logic migration uses. tap_step_percent set and tap_step_degree != 90 means "Ratio". Every SimBench transformer type has dVa = 0 and a nonzero dVm, so they all classify as "Ratio". Setting that for tappable transformers, e.g. in _inscribe_fix_values, restores the pandapower 2 results.

A workaround until then:

net.trafo["tap_changer_type"] = "Ratio"

Environment

  • simbench 1.6.2
  • pandapower 3.5.4
  • Python 3.14

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions