フィルターのクリア

Continuity Constraint in a Optimization Problem

4 ビュー (過去 30 日間)
VB
VB 2019 年 11 月 8 日
編集済み: Alberto Chavez 2020 年 3 月 31 日
I'm working on an optimization algorithm and I should insert a continuity constraint on a variable x to be optimized. In other words, I have some appliances and I have to match active/off periods. This is my optimization variable :
x = optimvar('x',8,24,'Type','integer','LowerBound',0,'UpperBound',1);
I have to try to write a constraint to keep appliances running consecutively. How can I do?
  1 件のコメント
Matt J
Matt J 2020 年 3 月 21 日
What does "consecutively" mean in relation to the 8x24 structure of x?

サインインしてコメントする。

回答 (1 件)

Alberto Chavez
Alberto Chavez 2020 年 3 月 20 日
編集済み: Alberto Chavez 2020 年 3 月 31 日
Sometimes it is better to write the functions and contraints by hand using a small scale problem, and then try to write your code so that you have a clear idea of what you need to do. What I believe you are trying to do is a scheduling constraint, so that if one appliance stops running the next takes over, correct?
In that case, it's not only one constraint, but a set of constraints. If you have 2 appliances for example:
appliance 1 : x11, x12
appliance 2: x21, x22
Variables xij , index "i" represents the appliance name, index "j" represents the order in which it is used.
constraint set 1:
x11+x12+x21+x22 = 2 (this set permits only 2 elements in the schedule)
constraint set 2:
x11+x12 = 1
x21+x22 = 1 (this set permits only one order for each appliance)
constraint set 3:
x11+x21 = 1
x12+x22 = 1 (this set permits only one appliance for each order)
Results:
If x11=1, then x12=0, x22=1, x21=0
this means that appliance 1 runs first and then appliance 2.
If x11=0, then x12=1, x22=0, x21=1
this means that appliance 1 runs second and appliance 2 runs first.
Is that helpful?
Edit:
the 2 indexes in xij can be transformed into one:
instead of x11, x12, x21, x22, it would be x1, x2, x3, x4

カテゴリ

Help Center および File ExchangeOptimization Toolbox についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by