Error using linprog (line 369)

4 views (last 30 days)
Duy Dang on 6 Dec 2023
Commented: Duy Dang on 7 Dec 2023
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.
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 on 6 Dec 2023
Edited: Torsten on 6 Dec 2023
A_s and f_s are not specified in your code.
I don't know if linprog accepts sparse matrices as input. Read about it in the documentation.
Duy Dang on 7 Dec 2023
Thanks Torsten, I think you are right. I am trying to reformulate to reduce the size of the matrix

Steven Lord on 6 Dec 2023
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.

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

R2021a

Community Treasure Hunt

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

Start Hunting!