decogo.pyomo_problem.oa_master_problem

This module implements OA master problems

Classes

CompactOaMasterProblem(block_model, approx_data)

A class for defining compact outer master problem

MipOaMasterProblem(block_model, approx_data)

A class for defining MIP Outer Approximation master problem

OaMasterProblem(block_model)

A class for defining an outer master problem

SlackMipOaMasterProblem(block_model, approx_data)

A class for MIP Outer Approximation problem with slacks

class decogo.pyomo_problem.oa_master_problem.OaMasterProblem(block_model)[source]

A class for defining an outer master problem

\[\begin{equation} \begin{split} \min \ &c^Tx,\newline &x \in P \cap Y \end{split} \end{equation}\]
Parameters

block_model (PyomoBlockModel) – Block model

__init__(block_model)[source]

Constructor method

set_default_objective()[source]

Sets a linear objective function with the costs given from the original formulation

class decogo.pyomo_problem.oa_master_problem.MipOaMasterProblem(block_model, approx_data)[source]

A class for defining MIP Outer Approximation master problem

\[\begin{equation} \begin{split} \min \ &c^Tx,\newline &x \in P \cap Y \cap \hat{G} \end{split} \end{equation}\]

where \(\hat{G}\) is an Outer Approximation of nonlinear feasible set \(G\)

Parameters
__init__(block_model, approx_data)[source]

Constructor method

add_linearization_cuts(number_of_cuts)[source]

Adds linearization cuts

Parameters

n (dict) – Number of cuts to be added

class decogo.pyomo_problem.oa_master_problem.SlackMipOaMasterProblem(block_model, approx_data)[source]

A class for MIP Outer Approximation problem with slacks

\[\begin{equation} \begin{split} \min \ &c_k^Tx + \gamma\sum\limits_{j \in [m]}s_j,\newline &x_k \in Y_k \cap \hat{G}, \newline & a_{kj}^Tx \leq b_j + s_j, j \in [m], \newline & x_{\ell} \text{ is fixed}, \ell \in K\setminus{k}, \gamma > 0 \end{split} \end{equation}\]
Parameters
__init__(block_model, approx_data)[source]

Constructor method

set_objective(block_id)[source]

Sets objective function

Parameters

block_id (int) – Block identifier

solve(solver_name, start_point=None, solver_options=None)[source]

Calls the base method solve() and additionally returns the flag if slacks are zeros

Note

If the solution is reported by the solver to be infeasible, then the variable bounds are too small

class decogo.pyomo_problem.oa_master_problem.CompactOaMasterProblem(block_model, approx_data)[source]

A class for defining compact outer master problem

\[\begin{equation} \begin{split} \min &\sum\limits_{k \in K} w_{k0}, \newline &\sum\limits_{k \in K} w_k \leq b, \newline &w_k \in D_k \subset \mathbb{R}^{m + 1}, k \in K \end{split} \end{equation}\]

where \(D_k\) is an Outer Approximation

Parameters
  • block_model (PyomoBlockModel) – Block model

  • approx_data (ApproxData) – Class that stores compact linear constraints, generated during solving the sub-problems

__init__(block_model, approx_data)[source]

Constructor method

set_default_objective()[source]

Sets objective

add_compact_lin_local_const(block_id, lhs, relation, rhs, added_compact_cut=True)[source]

Adds compact linear constraints

Parameters
  • block_id (int) – Block identifier

  • lhs (ndarray) – Left hand side of the constraint

  • relation (str) – Relation of the constraint

  • rhs (float) – Right hand side of the constraint

set_new_objective(direction)[source]

Sets new linear objective

Parameters

direction (ndarray) – Given direction

set_bounds(lb_w, ub_w)[source]

Sets bounds on the variables

Parameters
remove_bounds()[source]

Resets the bounds of all variables

solve(solver_name, solver_options=None)[source]

Solves the problem by calling an external solver

Parameters
  • solver_name (str) – External solver name

  • solver_options (list) – Options for external solver

Returns

Solution point, dual solution and objective value

Return type

tuple