question about yalmip

39 views
Skip to first unread message

cairan

unread,
Aug 25, 2013, 2:49:23 AM8/25/13
to yal...@googlegroups.com
Hi All,

I want solve a simple optimization problem as follows:

maximize   f = x1^2 + x2.^2
subject to:  0<= x1 <= 10
                 0<= x2 <= 10

Then, I write the code like this:

x = sdpvar(1,2);
% f = [1 1]*(x'.^2);
f = x*x';
F = set(10 >= x >= 0);
solvesdp(F,-f);
double(f)
double(x)

The solution of yalmip is:
f = 100
x = [10 0]

Obviously, the solution x is not the optimal solution. I don't know why the solution is not the optimal one.
In addition, the solution x euqal to [10 10] (the optimal one ) when I change the definition of x to intvar(1,2). Thanks for any help.

Best Regards,
Cai Ran


Johan Löfberg

unread,
Aug 25, 2013, 2:52:45 AM8/25/13
to yal...@googlegroups.com
1. SET is obsolete

2. The problem is nonconvex (maximization of convex) and you are most likely using a local solver such as quadprog or fmincon, hence, you have no other guarantees than (at best) local optimality.

cairan

unread,
Aug 25, 2013, 3:20:54 AM8/25/13
to yal...@googlegroups.com
Hi, Johh,

Thank you for your kindly remind.
The yalmip choose the QUADPROG as the solver to solve the nonconvex optimization problem. Is there any solver that can interact with yalmip to solve a problem like this?
Thanks!

Best Regards,
Cai Ran

Johan Löfberg

unread,
Aug 25, 2013, 3:23:48 AM8/25/13
to yal...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages