MATLAB Answers

linprog crashes Matlab R2017b

1 view (last 30 days)
Eric Trudel
Eric Trudel on 5 Dec 2019
Answered: Kavya Vuriti on 2 Apr 2020
Hello,
I am running an optimization routine on Matlab R2017b using a custom SLP algorithm. At some point when passing a sub problem to linprog; it will cause MATALB to crash and exit. I have tried the problem on future versions (Matlab online only - R2019b) and no crashes occured. Is this a bug or is there somthing wrong with my linear program? The reproducible code is below;
Any insight would be greatly appreciated.
Thanks
%linrog crash?
A2 = [ 1 1 1 0 0 0 1 0 0;
1 2 0 1 0 0 0 0 0;
-1 0 0 0 1 0 0 1 0;
0 -1 0 0 0 1 0 0 1];
c= [0;
0;
0;
0;
0;
0;
1;
1;
1];
b = [ -0.1895;
-0.0000;
-0.8296;
-0.9965];
sL2 = [-0.1866 -0.1866 -0.1866 -0.1866 -0.1866 -0.1866 0 0 0];
sU2 = [0.1866 0.1866 0.1866 0.1866 0.1866 0.1866 Inf Inf Inf];
s0 = [ 0;
0;
0;
0;
0;
0;
0.1895;
0.8296;
0.9965];
lpoptions = optimoptions(@linprog,'Display','iter','algorithm','dual-simplex');
[sn,fval,flagn,~,lambda] = linprog(c,[],[],A2,-b,sL2,sU2,s0,lpoptions);

  0 Comments

Sign in to comment.

Answers (1)

Kavya Vuriti
Kavya Vuriti on 2 Apr 2020
Hi,
This crash might be because the "linprog" function is using the default 'dual-simplex' algorithm.Try switching to the 'interior-point' algorithm.
Hope this helps!!

  0 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!