decogo.pyomo_problem.subproblem¶
This module implements and manages all sub-problems of Pyomo models
Classes
|
This class defines line search sub-problem between exterior point \(x_k^{ext}\) and interior point \(x_k^{int}\) |
|
A class for defining the following sub-problem |
|
A class for defining a projection sub-problem |
A class for defining a projection sub-problem |
|
|
A base class for construction of Pyomo model. |
|
A container class for managing all sub-problems |
- class decogo.pyomo_problem.subproblem.PyomoSubProblemBase(block_model, block_id)[source]¶
A base class for construction of Pyomo model. Here are implemented methods for creating local linear and nonlinear constraints
- Parameters:
block_model (PyomoBlockModel) – Block model
block_id (int) – Block identifier
- solve(solver_name, start_point=None, solver_options=None)[source]¶
Base method for calling the external solver to solve the model
- Parameters:
solver_name (str) – External solver name
start_point (ndaray or None) – Starting point for the solver, defaults to
Nonesolver_options (list) – Options for external solver, defaults to
None
- Returns:
Solution point, primal bound, dual bound, flag if the primal bound is feasible
- Return type:
tuple
- unset_nlp()[source]¶
Sets to integer type for the variables which are integer in the original formulation
- update_var_lower_bound(index)[source]¶
Updates the lower bound of the variable. The value is taken form the BlockModel
- Parameters:
index (tuple) – Index (block_id, index)
- update_var_upper_bound(index)[source]¶
Updates the upper bound of the variable. The value is taken form the BlockModel
- Parameters:
index (tuple) – Index (block_id, index)
- fix_integers(x)[source]¶
Fixes integer variables with given value
- Parameters:
x (ndarray) – Given array
- class decogo.pyomo_problem.subproblem.PyomoMinlpSubProblem(block_model, block_id)[source]¶
A class for defining the following sub-problem
\[\begin{equation} \begin{split} \min \ &d_k^Ty_k, \newline &y_k \in X_k, d_k \in \mathbb{R}^{n_k} \end{split} \end{equation}\]- Parameters:
block_model (PyomoBlockModel) – Block model
block_id (int) – Block identifier
- class decogo.pyomo_problem.subproblem.PyomoProjectionSubProblem(block_model, block_id)[source]¶
A class for defining a projection sub-problem
\[\begin{equation} \begin{split} \min \ &||y_k-x_k||^2,\newline &y_k \in G_k, x_k \text{ is fixed} \end{split} \end{equation}\]- Parameters:
block_model (PyomoBlockModel) – Block model
block_id (int) – Block identifier
- class decogo.pyomo_problem.subproblem.PyomoResourceProjectionSubProblem(block_model, block_id)[source]¶
A class for defining a projection sub-problem
\[\begin{equation} \begin{split} \min \ &||A_kx_k - w_k||^2,\newline &y_k \in G_k, w_k \text{ is fixed} \end{split} \end{equation}\]- Parameters:
block_model (PyomoBlockModel) – Block model
block_id (int) – Block identifier
- class decogo.pyomo_problem.subproblem.PyomoLineSearchSubProblem(block_model, block_id)[source]¶
This class defines line search sub-problem between exterior point \(x_k^{ext}\) and interior point \(x_k^{int}\)
\[\begin{equation} \begin{split} \max \ & \alpha, \newline &y_k = \alpha x_k^{ext} + (1 - \alpha) x_k^{int}, \newline &y_k \in X_k \end{split} \end{equation}\]- Parameters:
block_model (PyomoBlockModel) – Block model
block_id (int) – Block identifier
- class decogo.pyomo_problem.subproblem.PyomoSubProblems(block_model, block_id)[source]¶
A container class for managing all sub-problems
- Parameters:
minlp_sub_problem (PyomoMinlpSubProblem) – Sub-probem with linear objective
proj_sub_problem (PyomoProjectionSubProblem) – Pure projection sub-problem
resource_constrained_sub_problem (PyomoResourceConstrainedSubProblem) – Resource constrained sub-problem for checking the feasibility of the resources
line_search_sub_problem (PyomoLineSearchSubProblem) – Line search sub-problem
block_model (PyomoBlockModel) – Block model
block_id (int) – Block identifier
- minlp_solve(solver_name, solver_options=None, start_point=None, direction=None, cell=None)[source]¶
Solves
MinlpSubProblem- Parameters:
solver_name (str) – External solver name
solver_options (list or None) – External solver options, defaults to
Nonestart_point (ndarray or None) – Staring point for the solver, defaults to
Nonedirection (ndarray or None) – Direction for the objective, defaults to
Nonecell (Cell or None) – Cell, defaults to
None
- Returns:
Solution point, primal and dual bound
- Return type:
tuple
- fixed_minlp_solve(solver_name, start_point, solver_options=None, direction=None, cell=None)[source]¶
Solves
MinlpSubProblemwith fixed integer variables- Parameters:
solver_name (str) – External solver name
start_point (ndarray or None) – Staring point for the solver, and point which is used for fixing the integers
solver_options (list or None) – External solver options, defaults to
Nonedirection (ndarray or None) – Direction for the objective, defaults to
Nonecell (Cell or None) – Cell, defaults to
None
- Returns:
Solution point, primal and dual bound
- Return type:
tuple
- nlp_proj_solve(solver_name, point_to_project, start_point=None)[source]¶
Solves
ProjSubProblem- Parameters:
solver_name (str) – External solver name
point_to_project (ndarray) – Projection point
start_point (ndarray or None) – Staring point for the solver, defaults to
None
- Returns:
Solution point, primal bound and flag indicating the feasibility of primal solution
- Return type:
tuple
- resource_proj_solve(solver_name, point_to_project, solver_options=None, start_point=None)[source]¶
Solves
ResourceProjSubProblem- Parameters:
solver_name (str) – External solver name
point_to_project (ndarray) – Projection point
start_point (ndarray or None) – Staring point for the solver, defaults to
None
- Returns:
Solution point, primal bound and flag indicating the feasibility of primal solution
- Return type:
tuple
- solve_line_search_subproblem(solver_name, exterior_point, interior_point)[source]¶
Solves
LineSearchSubProblem- Parameters:
solver_name (str) – External solver name
exterior_point (ndarray) – Exterior point
interior_point (ndarray) – Interior point
- Returns:
value of parameter \(\alpha\) and solution point
- Return type:
tuple