Root LP problem is unbounded

3 次查看(过去 30 天)
Daniele Di Lauro
Daniele Di Lauro 2024-4-9
编辑: Catalytic 2024-4-9
I've been trying to resolve this error for several hours, but I'm probably missing something. I didn't post the construction of the constraint matrices because I believe the problem concerns the lower bound and upper bound of the variables (also because I should have posted 300 lines of code)
A = [A_P_ch;A_P_disch;A_SOC;A_del_L;A_J_soc;A_J_P_batt;A_P_in];
b = [b_P_ch;b_P_disch;b_SOC;b_del_L;b_J_soc;b_P_batt;B_P_in];
intcon = [2*(Hp+1)+2*Hp:4*(Hp+1)+4*Hp]; %sl1 sl2 zita_ch zita_disch
up=inf*ones(1,(Hp*(8+(2*n)))+n+2);
up(2*(2*Hp+1):4*(2*Hp+1)) = 1; %SL1/2 zit_ch zita_disch
up(4*(2*Hp+1)+2*Hp:4*(2*Hp+1)+3*Hp) = 0.6; %rho
up(2*(Hp+1):2*(Hp+1)+2*Hp) = 0.1; %epsilon e theta
x0=1*ones(size(obj1));
lw = zeros(1,8*Hp+4*(Hp+1));
mat = [];
z = [];
[z,fval,exitflag,output] = intlinprog(obj1,intcon,A,b,A_eq,b_eq,lw,up);
  3 个评论
Matt J
Matt J 2024-4-9
It's not what I suggested and it doesn't help. Running the mfile does not generate the matrices, but rather the error message,
Not enough input arguments.
Error in myFun (line 192)
b_soc1 = ones(Hp,1)*(soc_0-0.3);

请先登录,再进行评论。

回答(1 个)

Catalytic
Catalytic 2024-4-9
编辑:Catalytic 2024-4-9
Nobody can help you troubleshoot the error, because it is not a coding error. It is an error of problem definition. You have provided an LP that intlinprog cannot solve. Nobody has any way of knowing the actual LP you intended to solve, or if it even has a solution.
The only recommendation that can be made is that you make all your up(k) components finite, even if it means specifying a super-conservative upper bound -
up=min(up, 1e8);

类别

Help CenterFile Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by