pypowsybl.network.Network.create_phase_tap_changers#

Network.create_phase_tap_changers(ptc_df, steps_df)[source]#

Create phase tap changers on transformers.

Tap changers data must be provided in 2 separate dataframes: one for the tap changers attributes, and another one for tap changers steps attributes. The latter one will generally have multiple lines for one transformer ID. The steps are created in order of the dataframe order meaning (for a transformer) first line of the steps dataframe will create step one of the steps of these transformer.

Parameters:
  • ptc_df (DataFrame) – dataframe of tap changers data

  • steps_df (DataFrame) – dataframe of steps data

Return type:

None

Notes

Valid attributes for the tap changers dataframe are:

  • id: the transformer where this tap changer will be created

  • tap: the current tap position

  • low_tap: the number of the lowest tap position (default 0)

  • regulation_mode: the regulation mode (CURRENT_LIMITER, ACTIVE_POWER_CONTROL, FIXED_TAP)

  • target_deadband: the regulation deadband

  • regulating: true if the tap changer should regulate

  • regulated_side: the side where the current or active power is regulated (ONE or TWO if two-winding transformer, ONE, TWO or THREE if three-winding transformer)

  • side: Side of the tap changer (only for three-winding transformers)

Valid attributes for the steps dataframe are:

  • id: the transformer where this step will be added

  • g: the shunt conductance increase compared to the transformer, for this step, in percentage

  • b: the shunt susceptance increase compared to the transformer, for this step, in percentage

  • r: the resistance increase compared to the transformer, for this step, in percentage

  • x: the reactance increased compared to the transformer, for this step, in percentage

  • rho: the transformer ratio for this step (1 means real ratio is rated_u2/rated_u1)

  • alpha: the phase shift, in degrees, for this step

Examples

We need to provide 2 dataframes, 1 for tap changer basic data, and one for step-wise data:

ptc_df = pd.DataFrame.from_records(
    index='id', columns=['id', 'target_deadband', 'regulation_mode', 'low_tap', 'tap'],
    data=[('TWT_TEST', 2, 'CURRENT_LIMITER', 0, 1)])
steps_df = pd.DataFrame.from_records(
    index='id', columns=['id', 'b', 'g', 'r', 'x', 'rho', 'alpha'],
    data=[('TWT_TEST', 2, 2, 1, 1, 0.5, 0.1),
          ('TWT_TEST', 2, 2, 1, 1, 0.4, 0.2),
          ('TWT_TEST', 2, 2, 1, 1, 0.5, 0.1)])
n.create_phase_tap_changers(ptc_df, steps_df)