edisgo.opf.results.opf_result_class.OPFResults

class edisgo.opf.results.opf_result_class.OPFResults

Container for the results of the multi-period optimal power flow.

An instance is populated when reading back the PowerModels.jl solution (see from_powermodels()) and is accessible on the EDisGo object via edisgo.opf_results. The operation schedules are additionally written into edisgo.timeseries; the objects below hold the raw optimisation variables and slacks.

status

Solver termination status (e.g. "OPTIMAL").

Type:

str or None

solution_time

Wall-clock solve time in seconds.

Type:

float or None

solver

Name of the solver used (e.g. "Gurobi" or "Ipopt").

Type:

str or None

lines_t

Per-line branch-flow results.

Type:

LineVariables

slack_generator_t

Active power of the slack generator at the grid’s feed-in point in MW.

Type:

pandas.DataFrame

heat_storage_t

Thermal-storage results.

Type:

HeatStorage

hv_requirement_slacks_t

Slacks on the requirements handed down from the overlying (HV) grid (opf_version 3 and 4).

Type:

pandas.DataFrame

grid_slacks_t

Grid slack variables (curtailment and load shedding).

Type:

GridSlacks

overlying_grid

Aggregated exchange with the overlying grid.

Type:

pandas.DataFrame

battery_storage_t

Battery-storage results.

Type:

BatteryStorage

status = None
solution_time = None
solver = None
lines_t
slack_generator_t
heat_storage_t
hv_requirement_slacks_t
grid_slacks_t
overlying_grid
battery_storage_t
to_csv(directory, attributes=None)

Exports OPF results data to csv files.

The following attributes can be exported:

  • ‘lines_t’ : The results of the three variables in attribute lines_t are saved to lines_t_p.csv, lines_t_p.csv, and lines_t_ccm.csv.

  • ‘slack_generator_t’ : Attribute slack_generator_t is saved to slack_generator_t.csv.

  • ‘heat_storage_t’ : The results of the two variables in attribute heat_storage_t are saved to heat_storage_t_p.csv and heat_storage_t_e.csv.

  • ‘hv_requirement_slacks_t’ : Attribute hv_requirement_slacks_t is saved to hv_requirement_slacks_t.csv.

  • ‘grid_slacks_t’ : The results of the five variables in attribute grid_slacks_t are saved to dispatchable_gen_crt.csv, non_dispatchable_gen_crt.csv, load_shedding.csv, cp_load_shedding.csv and hp_load_shedding.csv.

  • ‘overlying_grid’ : Attribute overlying_grid is saved to overlying_grid.csv.

Parameters:
  • directory (str) – Path to save OPF results data to.

  • attributes (list(str) or None) – List of attributes to export. See above for attributes that can be exported. If None, all specified attributes are exported. Default: None.

from_csv(data_path, from_zip_archive=False)

Restores OPF results from csv files.

Parameters:
  • data_path (str) – Path to OPF results csv files.

  • from_zip_archive (bool, optional) – Set True if data is archived in a zip archive. Default: False.