is the selected solution the optimal one?

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Solver 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