Voltage Controler

This page is organized as follow:

Objectives

Powergrid are really complex objects. One of this complexity comes from the management of the voltages.

To make the difference between ensuring the safety (in terms of thermal limit and powerflow) and the voltages magement, we decided to split these two concepts on different class.

Typically, the safety (make sure every powerline is bellow its thermal limit) is ensured by an grid2op.Agent and the voltage control is performed by a grid2op.VoltageControler.

This module presents the class that can be modified to adapt (on the fly) the setpoint of the generators with respect to the voltage magnitude.

Voltage magnitude plays a big part in real time operation process. Bad voltages can lead to different kind of problem varying from:

  • high losses (the higher the voltages, the lower the losses in general)

  • equipment failures (typically if the voltages are too high)

  • a really bad “quality of electricity” for consumers (if voltages is too low)

  • partial or total blackout in case of voltage collapse (mainly if voltages are too low)

We wanted, in this package, to treat the voltages setpoint of the generators differently from the other part of the game. This module exposes the main class to do this.

Detailed Documentation by class

Classes:

BaseVoltageController(gridobj, ...[, ...])

This class is the most basic controler for the voltages.

ControlVoltageFromFile(gridobj, ...[, ...])

This class is the most basic controler for the voltages.

class grid2op.VoltageControler.BaseVoltageController(gridobj, controler_backend, actionSpace_cls, _local_dir_cls=None)[source]

This class is the most basic controler for the voltages. Basically, what it does is read the voltages from the chronics.

If the voltages are not on the chronics (missing files), it will not change the voltage setpoints at all.

Methods:

attach_layout(grid_layout)

INTERNAL

close()

If you require some "backend" to control the voltages, then you need to implement this (and also some specific things for the copy) to have it working correctly

copy()

INTERNAL

fix_voltage(observation, agent_action, ...)

This method must be overloaded to change the behaviour of the generator setpoint for time t+1.

seed(seed)

Used to seed the voltage controler class

attach_layout(grid_layout)[source]

INTERNAL

Warning

/!\ Internal, do not use unless you know what you are doing /!\

close()[source]

If you require some “backend” to control the voltages, then you need to implement this (and also some specific things for the copy) to have it working correctly

copy()[source]

INTERNAL

Warning

/!\ Internal, do not use unless you know what you are doing /!\

Make a (deep) copy of this instance.

abstractmethod fix_voltage(observation, agent_action, env_action, prod_v_chronics)[source]

This method must be overloaded to change the behaviour of the generator setpoint for time t+1.

This simple class will:

  • do nothing if the vector prod_v_chronics is None

  • set the generator setpoint to the value in prod_v_chronics

Basically, this class is pretty fast, but does nothing interesting, beside looking at the data in files.

More general class can use, to adapt the voltage setpoint:

  • observation the observation (receive by the agent) at time t

  • agent_action the action of the agent at time t

  • env_action the modification of the environment at time t, that will be observed by the agent at time t+1

  • prod_v_chronics the new setpoint of the generators present in the data (if any, this can be None)

To help this class, a grid2op.Backend.Backend is available and can be used to perform simulation of potential impact of voltages setpoints.

Parameters:
  • observation (grid2op.Observation.Observation) – The last observation (at time t)

  • agent_action (grid2op.Action.Action) – The action that the agent took

  • env_action (grid2op.Action.Action) – The modification that the environment will take.

  • prod_v_chronics (numpy.ndarray) – The next voltage setpoint present in the data (if any) or None if not.

Returns:

res – The new setpoint, in this case depending only on the prod_v_chronics.

Return type:

grid2op.Action.Action

seed(seed)[source]

Used to seed the voltage controler class

Warning

/!\ Internal, do not use unless you know what you are doing /!\

class grid2op.VoltageControler.ControlVoltageFromFile(gridobj, controler_backend, actionSpace_cls, _local_dir_cls=None)[source]

This class is the most basic controler for the voltages.

Basically, what it does is read the voltages from the chronics.

If the voltages are not on the chronics (missing files), it will not change the voltage setpoint at all.

Methods:

fix_voltage(observation, agent_action, ...)

This method must be overloaded to change the behaviour of the generator setpoint for time t+1.

fix_voltage(observation, agent_action, env_action, prod_v_chronics)[source]

This method must be overloaded to change the behaviour of the generator setpoint for time t+1.

This simple class will:

  • do nothing if the vector prod_v_chronics is None

  • set the generator setpoint to the value in prod_v_chronics

Basically, this class is pretty fast, but does nothing interesting, beside looking at the data in files.

More general class can use, to adapt the voltage setpoint:

  • observation the observation (receive by the agent) at time t

  • agent_action the action of the agent at time t

  • env_action the modification of the environment at time t, that will be observed by the agent at time t+1

  • prod_v_chronics the new setpoint of the generators present in the data (if any, this can be None)

To help this class, a grid2op.Backend.Backend is available and can be used to perform simulation of potential impact of voltages setpoints.

Parameters:
  • observation (grid2op.Observation.Observation) – The last observation (at time t)

  • agent_action (grid2op.Action.Action) – The action that the agent took

  • env_action (grid2op.Action.Action) – The modification that the environment will take.

  • prod_v_chronics (numpy.ndarray) – The next voltage setpoint present in the data (if any) or None if not.

Returns:

res – The new setpoint, in this case depending only on the prod_v_chronics.

Return type:

grid2op.Action.Action

If you still can’t find what you’re looking for, try in one of the following pages:

Still trouble finding the information ? Do not hesitate to send a github issue about the documentation at this link: Documentation issue template