edisgo.opf.powermodels_opf ========================== .. py:module:: edisgo.opf.powermodels_opf Functions --------- .. autoapisummary:: edisgo.opf.powermodels_opf.pm_optimize Module Contents --------------- .. py:function:: 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) 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. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param s_base: Base value of apparent power for per unit system. Default: 1 MVA. :type s_base: int :param flexible_cps: Array containing all charging points that allow for flexible charging. Default: None. :type flexible_cps: :numpy:`numpy.ndarray` or None :param flexible_hps: Array containing all heat pumps that allow for flexible operation due to an attached heat storage. Default: None. :type flexible_hps: :numpy:`numpy.ndarray` or None :param flexible_loads: Array containing all flexible loads that allow for application of demand side management strategy. Default: None. :type flexible_loads: :numpy:`numpy.ndarray` or None :param flexible_storage_units: Array containing all flexible storage units. Non-flexible storage units operate to optimize self consumption. Default: None :type flexible_storage_units: :numpy:`numpy.ndarray` or None :param opf_version: 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. :type opf_version: int :param method: 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". :type method: str :param warm_start: 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. :type warm_start: bool :param silence_moi: 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. :type silence_moi: bool :param save_heat_storage: Indicates whether to save results of heat storage variables from the optimization to eDisGo object. Default: True. :type save_heat_storage: bool :param save_slack_gen: Indicates whether to save results of slack generator variables from the optimization to eDisGo object. Default: True. :type save_slack_gen: bool :param save_slacks: Indicates whether to save results of slack variables of OPF. Depending on chosen opf_version, different slacks are used. For more information see :func:`edisgo.io.powermodels_io.from_powermodels`. Default: True. :type save_slacks: bool