Azzera filtri
Azzera filtri

Error using linprog (line 369)

3 visualizzazioni (ultimi 30 giorni)
Duy Dang
Duy Dang il 6 Dic 2023
Commentato: Duy Dang il 7 Dic 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.
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'.

Risposta accettata

Torsten
Torsten il 6 Dic 2023
Modificato: Torsten il 6 Dic 2023
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 Commento
Duy Dang
Duy Dang il 7 Dic 2023
Thanks Torsten, I think you are right. I am trying to reformulate to reduce the size of the matrix

Accedi per commentare.

Più risposte (1)

Steven Lord
Steven Lord il 6 Dic 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.

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by