pypowsybl.network.Network.create_ratio_tap_changers#

Network.create_ratio_tap_changers(rtc_df, steps_df)[source]#

Create ratio 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:
  • rtc_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)

  • on_load: true if the transformer has on-load voltage regulation capability

  • target_v: the target voltage, in kV

  • target_deadband: the target voltage regulation deadband, in kV

  • regulating: true if the tap changer should regulate voltage

  • regulated_side: the side where voltage is regulated (ONE or TWO)

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)

Examples

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

rtc_df = pd.DataFrame.from_records(
    index='id',
    columns=['id', 'target_deadband', 'target_v', 'on_load', 'low_tap', 'tap'],
    data=[('NGEN_NHV1', 2, 200, False, 0, 1)])
steps_df = pd.DataFrame.from_records(
    index='id',
    columns=['id', 'b', 'g', 'r', 'x', 'rho'],
    data=[('NGEN_NHV1', 2, 2, 1, 1, 0.5),
          ('NGEN_NHV1', 2, 2, 1, 1, 0.5),
          ('NGEN_NHV1', 2, 2, 1, 1, 0.8)])
network.create_ratio_tap_changers(rtc_df, steps_df)