Error using linprog (line 369)

3 次查看(过去 30 天)
Dear all,
I tried to run the linear optimization on my computer (Matlab 2021a) and receive the following error message. Hope someone can help. Many thanks in advanced.
Error using linprog (line 369)
LINPROG has stopped because it encountered an internal error. We are sorry for the inconvenience.
Please contact technical support for assistance with your problem, quoting the code "-1000@-1000".
I use the same code and run on onother computer (Matlab 2023b) and receive another error message
Linprog stopped because it exceeded its allocated memory.
My code is basically like that:
A_s is matrix size 14844 x 14854 double
I_s is matrix of 1 and 0, same size as A_s
f_s is vector size 14844 x 1 double
e_s is row vector size 14854 x 1 double
n = 14839
n = 14839
e_s = ones(1,14854);
I_s = zeros(n+5,n+15);
I_s(1:n,1:n) = eye(n);
for i=1:5
I_s(n+i,n+3*(i-1)+1)= 1;
I_s(n+i,n+3*(i-1)+2)= 1;
I_s(n+i,n+3*(i-1)+3)= 1;
end
lb = zeros(14854,1);
Aieq = zeros(2,14854);
Aieq(1,14840:14842) = [-1 -1 -1]*(1/(16691*365));
Aieq(2,14840:14842) = [-1 -1 -1]*(6/16691);
Aieq(2,14852:14854) = [1 1 1]*(1/17605);
Bieq = zeros(2,1);
Bieq(1,1) = -1.48;
x_s = linprog(e_s,Aieq,Bieq,(I_s - A_s),f_s,lb,[]);
Unrecognized function or variable 'A_s'.

采纳的回答

Torsten
Torsten 2023-12-6
编辑:Torsten 2023-12-6
A_s and f_s are not specified in your code.
But without running your code, I think your problem exceeds your available computer RAM.
I don't know if linprog accepts sparse matrices as input. Read about it in the documentation.
  1 个评论
Duy Dang
Duy Dang 2023-12-7
Thanks Torsten, I think you are right. I am trying to reformulate to reduce the size of the matrix

请先登录,再进行评论。

更多回答(1 个)

Steven Lord
Steven Lord 2023-12-6
Please send your code and data to Technical Support directly using this link so the development staff can determine the cause of this internal error. You can either directly include a link to this thread in your message to Support or you can quote the code "-1000@-1000" as the error message requested.

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by