Generates a dataset of pandapower power grids datasets from a single snapshot.
python main.py --config_file config.json
It generates both a train and a test sets from the same data generating process.
The file config.json
defines the parameters of the data generation process.
parameter | purpose |
---|---|
default_net_path |
Path to the default pandapower network. Should be a .json file. |
dataset_name |
Path where the generated dataset should be stored. |
n_train |
Amount of samples in the train set. |
n_test |
Amount of samples in the test set. |
reject_max |
Max amount of rejection (negative loads or out of range generation) before complete restart. |
sampling |
Defines the data generating process from which power grids are sampled. |
In the sampling
field, one can define how the topology, loads and generation are built :
parameter | purpose |
---|---|
topology |
Sampling of lines, generators and loads to be disconnected. |
total_load |
Sampling of total summed load in MW. |
active_load |
Sampling of individual active load in MW. |
reactive_load |
Sampling of individual reactive loads in MVAr. |
active_gen |
Sampling of individual active generation in MW. |
voltage_setpoint |
Sampling of individual generator voltage setpoints in p.u.. |
These options are detailed in the following.
Sampling of the power grid topology.
method | parameters | process |
---|---|---|
constant |
None | Does nothing |
random_disconnection |
See below | Randomly disconnects lines, generators and loads. |
In the random_disconnection
mode, one should define a list of disconnection probabilities
for generators, loads and lines. The first value of the list is the probability that
no object of the given class is disconnected, the second is the probability that one
object is disconnected, the third is the probability that two objects are disconnected,
and so on.
Then, once the amount of object to disconnect has been sampled, the process chooses randomly
this amount of objects uniformly from the list of existing devices.
For instance, let us consider the following parameters :
{"sampling_method": "random_disconnection",
"params": {"gen": [0.6, 0.4], "load": [1.0], "line": [0.0, 1.0]},
"black_lists: {"line": [10, 11]}}
There is a 60% probability that no generators are disconnected, and 40% probability that one of them is disconnected. There is a 100% probability that no loads is disconnected, and a 100% probability that exactly one transmission line is disconnected.
Moreover, lines 10 and 11 are ``blacklisted'' and will not be disconnected at all.
Sampling of the total consumption of the grid, denoted as
method | parameters | process |
---|---|---|
constant |
None |
|
uniform_factor |
|
|
normal_factor |
|
|
uniform_values |
||
normal_values |
Sampling of the individual active loads in MW.
The following sampling methods are available, where parameters are denoted as
method | parameters | process |
---|---|---|
homothetic |
None | |
uniform_independent_factor |
||
normal_independent_factor |
||
uniform_independent_values |
||
normal_independent_values |
where
In the four last sampling methods, the parameter uniform_independent_values
.
- If
$\alpha = 0$ , then the distribution is a dirac where all loads are the same. - If
$\alpha = 1$ then the distribution is uniform over a simplex.
WARNING: The marginal distributions displayed in the figures above are only valid if there are only two loads. When dealing with n loads, the uniform sampling will amount to sampling from a n-dimensional simplex, thus making the marginal distributions skewed towards low values.
Sampling of the individual reactive loads in MVAr.
The sampling of the reactive load is performed after the sampling of active loads.
In many of the proposed methods, the reactive power of a load depends on the new value of the active power.
The following sampling methods are available, where parameters are denoted as
method | parameters | process |
---|---|---|
constant |
None | |
constant_pq_ratio |
None | |
uniform_homothetic_factor |
||
normal_homothetic_factor |
||
uniform_independent_factor |
||
normal_independent_factor |
||
uniform_independent_values |
||
normal_independent_values |
||
uniform_power_factor |
Identical to active loads. The total load is scaled by a factor 1.02 to account for the power losses caused by Joule's effect.
An additional mode called opf
is available.
Generator costs are sampled from pandapower.rundcopp
.
The percentage of thermal limits can be adjusted so that going from DC to AC does not cause overflows.
method | parameters | process |
---|---|---|
homothetic |
None | |
uniform_independent_factor |
||
normal_independent_factor |
||
uniform_independent_values |
||
normal_independent_values |
||
opf |
max_current_percentage |
DC-OPF with random costs, and thermal limits at max_current_percentage of |
Sampling of the individual voltage setpoints in p.u..
The following sampling methods are available, where parameters are denoted as
method | parameters | process |
---|---|---|
constant |
None | |
uniform_homothetic_factor |
||
normal_homothetic_factor |
||
uniform_independent_factor |
||
normal_independent_factor |
||
uniform_independent_values |
||
normal_independent_values |
For now, this code generates pandapower files in .json
. If you wish to convert this database
into another format, you may use the dataset_converter.py
script as follows :
python dataset_converter.py --source_database 'data/case60' --target_database 'data/case60_matpower' --target_extension '.mat'
If you have any questions, please contact me at balthazar.donon@uliege.be