フィルターのクリア

is the selected solution the optimal one?

1 回表示 (過去 30 日間)
Housam
Housam 2021 年 3 月 13 日
コメント済み: Walter Roberson 2021 年 3 月 13 日
linprog always selects the lower limits (zero) for the last two variables and the upper limit for the second variable. However, the values should not be zeros.
question2: how can i visualize the feasible region, plotting the constraints?
objfunc.Constraints.econs1 = var1 + var2 == vector(i);
objfunc.Constraints.cons1 = var1 + var2 <= var3;
objfunc.Constraints.cons2 = var5 >= 3 * var4;
f= [49.1 49.1 98 577 1306];
vector=[950;1200;2000;20000];
for i=1:length(vector)
A= [1 1 -1 0 0
0 0 0 -3 1]
b= [0 0]
Aeq=[1 1 0 0 0]
beq=vector(i)
lb=[0;0;0;0;0]
ub=[25112; 1255; 25112-0.05*25112; 1255; 3*1255]
options = optimoptions('linprog','Algorithm','dual-simplex','Display','iter');
[x,fval,exitflag,output,lambda] = linprog(f,A,b,Aeq,beq,lb,ub,options)
X{i,1}=x
FVAL{i,1}=fval + 580
end
  4 件のコメント
Housam
Housam 2021 年 3 月 13 日
Thanks for the reply.
zero is physically not an acceptable solution. then how can i improve my problem formulation to maximize the last two variables instead
Walter Roberson
Walter Roberson 2021 年 3 月 13 日
lb=[0;0;0;0;0]
tells it that 0 is acceptable. If 0 is not acceptable change the appropriate lb entry to hold the smallest acceptable value such as eps(realmin) which technically is not 0. However if the rejection is for physical reasons perhaps you should use the planck distance or 1/avagadro's number or whatever value corresponds to one quanta

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by