gym_anm.simulator.components.devices.Device

class gym_anm.simulator.components.devices.Device(dev_spec, bus_ids, baseMVA)[source]

Bases: object

A electric device connected to an electric power grid.

dev_id

The unique device ID \(d\).

Type:

int

bus_id

The ID of the bus the device is connected to \(i\).

Type:

int

type

The device type : -1 (load), 0 (slack), 1 (classical generator), 2 (renewable energy), 3 (storage).

Type:

int

qp_ratio

The constant ratio of reactive over real power injection \((Q/P)_d\).

Type:

float

p_min, p_max, q_min, q_max

The minimum and maximum real (p.u.) and reactive (p.u.) power injections (\(\underline P_d, \overline P_d, \underline Q_d, \overline Q_d\)).

Type:

float

p_plus, p_minus, q_plus, q_minus

The bounds describing the (P, Q) region of physical operation of the device (p.u.) (\(P^+_d, P^-_d, Q^+_d, Q^-_d\)).

Type:

float

soc_min, soc_max

The minimum and maximum state of charge if the device is a storage unit \([\underline {SoC}_d, \overline {SoC}_d]\) (p.u. per hour); None otherwise.

Type:

float

eff

The round-trip efficiency \(\eta \in [0, 1]\) if the device is a storage unit; None otherwise.

Type:

float

tau_1, tau_2, tau_3, tau_4

The slope of the constraints on Q when P is near its maximum (\(\tau^{(1)}_d, \tau^{(2)}_d, \tau^{(3)}_d, \tau^{(4)}_d\)) (1-2 are used for generators, 1-4 for storage units, and the remaining ones are None).

Type:

float

rho_1, rho_2, rho_3, rho_4

The offset of the linear constraints on Q when P is near its maximum (\(\rho^{(1)}_d, \rho^{(2)}_d, \rho^{(3)}_d, \rho^{(4)}_d\))(see tau_1).

Type:

float

is_slack

True if the device is connected to the slack bus; False otherwise.

Type:

bool

p, q

The real \(P_d^{(dev)}\) and reactive \(Q_d^{(dev)}\) power injections from the device (p.u.).

Type:

float

p_pot

The maximum active generation of the device at the current time \(P_g^{(max)}\) (p.u.), if a generator; None otherwise.

Type:

float

soc

The state of charge \(SoC_d\) if the device is a storage unit (p.u. per hour); None otherwise.

Type:

float

__init__(dev_spec, bus_ids, baseMVA)[source]
Parameters:
  • dev_spec (numpy.ndarray) – The corresponding device row in the network file describing the network.

  • bus_ids (list of int) – The list of unique bus IDs.

  • baseMVA (int) – The base power of the network.

Methods

__init__(dev_spec, bus_ids, baseMVA)

param dev_spec:

The corresponding device row in the network file describing the