How to model multiple constraints using mixed integer linear programming?

1 回表示 (過去 30 日間)
Jose Parga
Jose Parga 2015 年 6 月 29 日
編集済み: Matt J 2015 年 6 月 30 日
For example,
I have 3 generators that must meet an hourly demand, but each of the generators has their own constraints.
Minimize: 15X1+25X2 (cost)
Subject to: X1+X2=250 (have to meet load), 0<=X1<=250 (min/max capacity for X1), 0<=X2<=150 (min/max capacity for X2)
Solving this example is easy, but if I wanted to add more constraints on X1 and X2 how would I go about this? Other constraints I would like to model are generator ramp rates and minimum up and down times. X1(i)+X1(i+1)<=ramp rate, X1ON(i)>=minimum up time
Thank you in advance for the help.
  1 件のコメント
Matt J
Matt J 2015 年 6 月 29 日
You need to elaborate on the difficulty you're having. The additional constraints you've shown are still linear. Why is it harder to write the matrices A,b,Aeq,beq than you already did in the original version?

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

回答 (1 件)

Matt J
Matt J 2015 年 6 月 29 日
編集済み: Matt J 2015 年 6 月 30 日
As I commented above, I'm not completely clear on the difficulty being addressed here, but to create matrices A,b representing constraints X(i)+X(i+1)<=b(i), you could do as follows:
e=1:length(X)-1;
A=sparse([e;e],[e;e+1],1);
b=...

カテゴリ

Help Center および File ExchangeGet Started with Optimization Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by