edisgo.opf.powermodels_opf

Module Contents

Functions

pm_optimize(edisgo_obj[, s_base, flexible_cps, ...])

Run OPF for edisgo object in julia subprocess and write results of OPF to edisgo

edisgo.opf.powermodels_opf.pm_optimize(edisgo_obj, s_base=1, flexible_cps=None, flexible_hps=None, flexible_loads=None, flexible_storage_units=None, opf_version=1, method='soc', warm_start=False, silence_moi=False)[source]

Run OPF for edisgo object in julia subprocess and write results of OPF to edisgo object. Results of OPF are time series of operation schedules of flexibilities.

Parameters:
  • edisgo_obj (EDisGo)

  • s_base (int) – Base value of apparent power for per unit system. Default: 1 MVA.

  • flexible_cps (numpy.ndarray or None) – Array containing all charging points that allow for flexible charging. Default: None.

  • flexible_hps (numpy.ndarray or None) – Array containing all heat pumps that allow for flexible operation due to an attached heat storage. Default: None.

  • flexible_loads (numpy.ndarray or None) – Array containing all flexible loads that allow for application of demand side management strategy. Default: None.

  • flexible_storage_units (numpy.ndarray or None) – Array containing all flexible storage units. Non-flexible storage units operate to optimize self consumption. Default: None

  • opf_version (int) –

    Version of optimization models to choose from. The grid model is a radial branch flow model (BFM). Optimization versions differ in lifted or additional constraints and the objective function. Implemented versions are:

    • 1
      • Lifted constraints: grid restrictions

      • Objective: minimize line losses and maximal line loading

    • 2
      • Objective: minimize line losses and grid related slacks

    • 3
      • Additional constraints: high voltage requirements

      • Lifted constraints: grid restrictions

      • Objective: minimize line losses, maximal line loading and HV slacks

    • 4
      • Additional constraints: high voltage requirements

      • Objective: minimize line losses, HV slacks and grid related slacks

    Must be one of [1, 2, 3, 4]. Default: 1.

  • method (str) – Optimization method to use. Must be either “soc” (Second Order Cone) or “nc” (Non Convex). If method is “soc”, OPF is run in PowerModels with Gurobi solver with SOC relaxation of equality constraint P²+Q² = V²*I². If method is “nc”, OPF is run with Ipopt solver as a non-convex problem due to quadratic equality constraint P²+Q² = V²*I². Default: “soc”.

  • warm_start (bool) – If set to True and if method is set to “soc”, non-convex IPOPT OPF will be run additionally and will be warm started with Gurobi SOC solution. Warm-start will only be run if results for Gurobi’s SOC relaxation is exact. Default: False.

  • silence_moi (bool) – If set to True, MathOptInterface’s optimizer attribute “MOI.Silent” is set to True in julia subprocess. This attribute is for silencing the output of an optimizer. When set to True, it requires the solver to produce no output, hence there will be no logging coming from julia subprocess in python process. Default: False.

  • save_heat_storage (bool) – Indicates whether to save results of heat storage variables from the optimization to eDisGo object. Default: True.

  • save_slack_gen (bool) – Indicates whether to save results of slack generator variables from the optimization to eDisGo object. Default: True.

  • save_slacks (bool) – Indicates whether to save results of slack variables of OPF. Depending on chosen opf_version, different slacks are used. For more information see edisgo.io.powermodels_io.from_powermodels(). Default: True.