简体   繁体   English

线性编程约束:优化变量的乘法

[英]Linear programming constraints: multiplication of optimization variables

Given an optimization problem with two optimization variables ( x_in(t) , x_out(t) ). 给出两个优化变量( x_in(t)x_out(t) )的优化问题。 For any time-step, when x_in is non-zero, x_out must be zero (and vice versa). 对于任何时间步长,当x_in不为零时, x_out必须为零(反之亦然)。 Written as a constraint: 写成约束:

x_in(t)*x_out(t)=0

How can such a constraint be included in Matlab's linprog function? 如何在Matlab的linprog函数中包含这样的约束?

Since the problem is not entirely linear, I do not believe you can solve it as-is using the linprog function. 由于问题不是完全线性的,我不相信你可以使用linprog函数解决它。 However, you should be able to reformulate the problem as a mixed integer linear programming problem. 但是,您应该能够将问题重新表述为混合整数线性规划问题。 Then you would be able to use for example this extension from Matlab Central to solve the problem. 然后你就可以使用Matlab Central的 这个扩展来解决问题。

Assuming that x_in(t) and x_out(t) are non-negative variables with upper bounds x_in_max and x_out_max , respectively, then you can add the variables y_in(t) and y_out(t) to your optimization problem and include the following constraints: 假设x_in(t)x_out(t)分别是上限为x_in_maxx_out_max非负变量,则可以将变量y_in(t)y_out(t)到优化问题中,并包含以下约束:

(1) y_in(t) and y_out(t) are binary, i.e. 0 or 1
(2) x_in(t)  <= x_in_max  * y_in(t)
(3) x_out(t) <= x_out_max * y_out(t)
(4) y_in(t) + y_out(t) = 1

Given that y_in and y_out are binary variables, constraints (2) and (3) relate the x_ and y_ variables with each other and ensure that the x_ variables remain within bounds (fix bounds on the x_ variables can thus and should be removed from the problem formulation). 假设y_iny_out是二元变量,约束(2)和(3)将x_y_变量相互关联,并确保x_变量保持在边界内( x_变量的固定边界因此可以从中删除问题制定)。 Constraint (4) ensures that either the _in or the _out event occurs, but not both at the same time. Constraint(4)确保发生_in_out事件,但不能同时发生。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在不是来自目标函数的变量上对线性编程添加约束 - How to add constraints to linear programming on variables not from objective function in matlab 具有线性约束的二次编程(Matlab) - quadratic programming with linear constraints(Matlab) 具有非线性约束和二元变量的线性目标函数 - linear objective function with non-linear constraints and binary variables 在Matlab中调用线性约束的具有线性约束的混合整数二次规划 - Mixed Integer Quadratic Programming with linear constraints in Matlab calling Gurobi 混合整数线性规划:如何生成约束? - Mixed-integer linear programming: How to generate constraints? 在线性编程中优先考虑某些变量 - Giving priority to some variables in linear programming 当变量之一属于集合时如何求解整数线性规划 - how to solve integer linear programming when one of the variables belong to a set 如何将线性约束引入优化算法,该线性约束涉及取决于决策变量的计算变量 - How to introduce into optimization algorithm a linear constraint which involves calculated variables which depend on decision variables 约束条件下的优化 - Optimization under constraints Matlab中的线性不等式约束 - Linear inequality constraints in Matlab
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM