1 optimization problem, 3 different solver, 3 different errors/results

154 views
Skip to first unread message

Lukas

unread,
Apr 10, 2014, 6:36:07 PM4/10/14
to yal...@googlegroups.com
Hello.

i was trying the last couple of days to solve an optimization problem with 3 different solver and got 3 different strange results or errors

A part of my matlab programm can be found at the bottom, where Q, R, S are positive definite matrices and W, X_, and all X{t} are positive semidefinite matrices.

I tried:

1.) sedumi: matlab crashes although sedumi works with other type of problems
2.) sdpt3: i get following error 

Error using validate (line 142)
total dimension of C should be > length(b)

Error in sdpt3 (line 172)
 [blk,At,C,b,blkdim,numblk,parbarrier] = validate(blk,At,C,b,par,parbarrier);

Error in callsdpt34 (line 152)
 evalc('[obj,X,y,Z,info,runhist] =  sdpt3(blk,A,C,b,options.sdpt3,[],x0,[]);');

Error in optimizer/subsref (line 103)
              eval(['output = ' self.model.solver.call '(self.model);']);

Error in mpc_controller (line 248)
  [sol, errcode] = controller{{xinit,Xinit}};

3. mosek: it says my objective is unbounded but that is impossible since my objective comes from Expecation values of some random variables (thats why the trace occur in the objective). Actually, when i  remove the trace(...) from the objective it is not bounded anymore so there must be a problme. But in nevertheless, my objective is bounded from below by 0.

I am very appreciate any help! I run out of ideas. 

Greetings,
Lukas



for t = 1:N  

    fprintf('Adding constraints and objective for t = %d\n',t-1);

    %stage costs = objective

    objective = objective + xnom{t}'*Q*xnom{t} + unom{t}'*R*unom{t} + trace((Q + K{t}'*R*K{t})*X{t});

    %constraints

    constraints = [constraints, bx'*xnom{t} <= rhsx_a - rhsx_b.*diag(bx'*X{t}*bx)];

    constraints = [constraints, bu'*unom{t} <= rhsu_a - rhsu_b.*diag(bu'*K{t}*X{t}*K{t}'*bu)];

    constraints = [constraints, xnom{t+1} == A*xnom{t} + B*unom{t}];

    constraints = [constraints, X{t+1} == (A+B*K{t})*X{t}*(A+B*K{t})' + F*W*F'];

end

disp('Adding terminal constraints and terminal objective');

objective = objective + xnom{N+1}'*S*xnom{N+1} + trace(S*X{N+1});  %terminal cost

constraints = [constraints, Af*xnom{N+1} <= bf]; %terminal set for x (polytope)

constraints = [constraints, X_ - X{N+1} >= 0];   %terminal set for X


controller = optimizer(constraints, objective, ops, {xnom{1}, X{1}}, {unom{1}, K{1}, objective});


[sol, errcode] = controller{{xinit,Xinit}}; 



Johan Löfberg

unread,
Apr 11, 2014, 2:22:22 AM4/11/14
to yal...@googlegroups.com
Reproducible code needed.
Message has been deleted

Johan Löfberg

unread,
Apr 11, 2014, 3:29:35 AM4/11/14
to yal...@googlegroups.com
>> Xf = Oinf_changed(A+B*K_, bx, px, xmax, bu, pu, umax, X_, K_, e); % Xf has type polyhedron see MPT3
Undefined function 'Oinf_changed' for input arguments of type 'double'.
 

Johan Löfberg

unread,
Apr 11, 2014, 3:33:14 AM4/11/14
to yal...@googlegroups.com
and the function gwn is not defined

Joachim Dahl

unread,
Apr 11, 2014, 4:30:49 AM4/11/14
to yal...@googlegroups.com
I would also be interested in reproducible code.

Johan Löfberg

unread,
Apr 11, 2014, 5:26:32 AM4/11/14
to
This

  constraints = [constraints, X{t+1} == (A+B*K{t})*X{t}*(A+B*K{t})' + F*W*F'];

is not convex and cannot be solved using sdpt3/mosek/sedumi (except for t==1 where YALMIUP will replace X{t} with a constant, for all other t, it is a cubic constraint in K{t} and X{t}). Hence optimizer would fail to derive anything sensible, and simply send garbage to the solver (optimizer trusts the user that the problem actually boils down to a problem which can be solved using the selected solver, when the parameters are fixed)

Johan Löfberg

unread,
Apr 11, 2014, 5:35:42 AM4/11/14
to yal...@googlegroups.com
Correction: It is nonconvex for all t (t==1 leads to a quadratic equality, i.e., nonconvex)

Lukas

unread,
Apr 12, 2014, 3:09:23 AM4/12/14
to yal...@googlegroups.com
thank you very very much! 
since i am a beginner at this topics, i would have never thought about this! 
Reply all
Reply to author
Forward
0 new messages