Skip to content

Error for non-connected and non-active production #11

Description

@marota

Error

PyPowsyblError: Generator 'GEN.P6G3': invalid value (0.0) for voltage setpoint (voltage regulator is on)

Can be reproduced using environment "env_dijon_v2_l2rpn" and replacing the init_state.json by the following:

{"set_bus": {"lines_or_id": {"GENISY611": 6, "GENISY615": 4, "GENISY614": 1, "GENISY613": -1, "GENISY612": 2, "GENISY616": 5}, 
                      "lines_ex_id": {"GENISY611": 6, "GENISY615": 4, "GENISY614": 1, "GENISY613": -1, "GENISY612": 2, "GENISY616": 5},
                      "loads_id": {},
                      "generators_id": {"GEN.P6G6": 3, "GEN.P6G1": 2, "GEN.P6G5": 1, "GEN.P6G3": 5, "GEN.P6G2": 4, "GEN.P6G4": 6},
                      "shunts_id": {}}
                      }

Code to reproduce

import grid2op 
from pypowsybl2grid import PyPowSyBlBackend
import pypowsybl as pp

def create_olf_rte_parameter() -> pp.loadflow.Parameters:
    return pp.loadflow.Parameters(read_slack_bus=False,
                                  write_slack_bus=False,
                                  voltage_init_mode=pp.loadflow.VoltageInitMode.DC_VALUES,
                                  transformer_voltage_control_on=True,
                                  use_reactive_limits=True,
                                  shunt_compensator_voltage_control_on=True,
                                  phase_shifter_regulation_on=True,
                                  distributed_slack=True,
                                  dc_use_transformer_ratio=False,
                                  twt_split_shunt_admittance=True,
                                  provider_parameters={"useActiveLimits": "true",
                                                       "svcVoltageMonitoring": "false",
                                                       "voltageRemoteControl": "false",
                                                       "writeReferenceTerminals": "false",
                                                       "slackBusSelectionMode" : "NAME",
                                                       "slackBusesIds" : "N.SE1P1_0#0"})

from grid2op.Backend import Backend
def create_pypowsybl_backend() -> Backend:
    lf_parameters = create_olf_rte_parameter()#create_olf_parameter()#create_olf_rte_parameter()
    return PyPowSyBlBackend(n_busbar_per_sub=6,
                            lf_parameters=lf_parameters)

env_name="env_dijon_v2_l2rpn
PATH = "./"+env_name

backend=create_pypowsybl_backend()
env=grid2op.make(PATH,backend=backend, n_busbar=6,allow_detachment=True)

obs=env.reset()
do_nothing=env.action_space({})
obs.simulate(do_nothing,time_step=0)

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