Unknown problem in solver

667 views
Skip to first unread message

Frank

unread,
Feb 26, 2016, 2:11:25 PM2/26/16
to YALMIP
I am using the Yalmip to optimize a polynomial according to existed data points. 
When the equation is to minimize sum((y-yi)), I can get the results. 
However, when the equation is to minimize sum(abs(y-yi)). I could not get the correct results.

    yalmiptime: NaN
    solvertime: NaN
          info: 'Unknown problem in solver (Turn on 'debug' in sdpsettings) (Error using ldl
Out of memory....'
       problem: 9

Do you know the reason? How could I modify the current code? Thanks.

The relevant code is folowing:
%Both CurveFit.High_postive_power and CurveFit.High_FC are (20000*1) vector.
a = sdpvar(1);
b = sdpvar(1);
c = sdpvar(1);
d = sdpvar(1);

% High power area fc=e*x^2+f*x+h
e = sdpvar(1);
f = sdpvar(1);
h = sdpvar(1);

constr_Low=[1e-7<a<5e-7,-9e-7<b<1.5e-5, 8e-5<c<3e-4,-2.3e-4<d<2.3e-4];
constr_High=[5e-7<e<2e-6,8e-6<f<3e-5,2.5e-5<h<1e-3];

residual_High=abs(e*CurveFit.High_postive_power.*CurveFit.High_postive_power+f*CurveFit.High_postive_power+h-CurveFit.High_FC);

optimize(constr_High,sum(residual_High))




Johan Löfberg

unread,
Feb 26, 2016, 2:20:40 PM2/26/16
to YALMIP
Well, the error message is clear: The solver runs into a memory issue. 

...which is absolutely weird, because this is a pretty small model. Which solver are you using?

Note though, for YALMIP modelling efficiency, use norm(z,1) instead of sum(abs(z))

Frank

unread,
Feb 26, 2016, 2:43:39 PM2/26/16
to YALMIP
Thanks, Johan.

As to the solver, I always using the matlab default solver. I did not change the solver ever before. In Simulink, I find the default solver is variable-step and ode45. But in m code, I am not sure which solver I am using. Could you give me a recommendation which solver is appropriate for this case? 

In this case, the CurveFit.High_postive_power and CurveFit.High_FC are (20000*1) vectors are both double data type.

Thanks.

Johan Löfberg

unread,
Feb 26, 2016, 2:51:47 PM2/26/16
to YALMIP
With solver, I mean linear programming solver. Simulink ode-solver has nothing to do with optimization

Standard LP solver in matlab is linprog, but it solves the problem without issues on my machince. Solve a small problem and you will see which solver was used

sdpvar x
optimize
(x>=0,x)




Frank

unread,
Feb 26, 2016, 2:56:39 PM2/26/16
to YALMIP
Thanks, Johan. As following:

%% Simple code
clear
sdpvar x
optimize(x>=0,x)


>>YALMIP
Optimization terminated.

ans = 

    yalmiptime: 12.5724
    solvertime: 0.9896
          info: 'Successfully solved (LINPROG)'
       problem: 0

 It works well on the simple issue.

Johan Löfberg

unread,
Feb 26, 2016, 2:59:57 PM2/26/16
to YALMIP
saw now that the dimension was 20000, and yes linprog might crash then maybe. it is a crappy solver

good solvers are gurobi, mosek, cplex, scip,... see solver section on wiki

and don't forget to fix your code. Strict inequalities are not supported (YALMIP screams at you), and use norm 

Frank

unread,
Feb 26, 2016, 3:22:48 PM2/26/16
to YALMIP
Johan, thank you very much.
I found the above solvers mentioned are all commercial solvers. 

So I used the following codes to test whether I could use these solver:

clear
tic
close all
sdpsettings('solver','scip');
sdpvar x
optimize(x>=0,x)

>> YALMIP
Optimization terminated.

ans = 

    yalmiptime: 5.4092
    solvertime: 0.0078
          info: 'Successfully solved (LINPROG)'
       problem: 0

The results shows the solver remains (LINPROG).
So, is there appropriate free solver for this case if possible?

Thanks Johan.

Johan Löfberg

unread,
Feb 27, 2016, 3:20:31 AM2/27/16
to YALMIP
you have to supply the options to solvesdp as a third argument

Reply all
Reply to author
Forward
0 new messages