Why does YALMIP output such information when calling fmincon?

234 views
Skip to first unread message

Yuzhou Li

unread,
Feb 24, 2014, 12:05:26 AM2/24/14
to yal...@googlegroups.com
Here, I have a very simple optimization problem, which is given by
                               max      log(x)
                               s.t.        0 <= x <= 1.
Obviously, the optimal solution is 
                               x = 1.

I implement the code in YALMIP as
         clc;
         x                           = sdpvar(1,1);
         SumUtility                  = log(x);
         Constraints                 = [1 >= x >= 0];    
         sol = solvesdp(Constraints,-SumUtility);
         if sol.problem == 0
                   x                          = double(x);
         else
                   display('Hmm, something went wrong!');
                   sol.info
                   yalmiperror(sol.problem)
         end 
YALMIP does obtain the right solution, i.e., x = 1. However, it at the same time outputs the following information

Your initial point x0 is not between bounds lb and ub; FMINCON shifted x0 to satisfy the bounds.
                                Norm of      First-order 
 Iteration        f(x)          step          optimality   CG-iterations
     0           0.693147                             1                
     1           0.287682       0.353553          0.333           1
     2          0.0645385          0.375         0.0667           1
     3          0.0039139       0.234375        0.00392           1
     4       1.53187e-005      0.0622549      1.53e-005           1
     5       2.34664e-010     0.00391384      2.35e-010           1
Local minimum found.
Optimization completed because the size of the gradient is less than the selected value of the function tolerance.

My question is: why does YALMIP output "Your initial point x0 is not between bounds lb and ub; FMINCON shifted x0 to satisfy the bounds.", because I do not provide an initial point for the variable x in the code. Besides, the problem is convex and thus, the globally optimal solution can be obtained. Then, why does output "Local minimum found."

Johan Löfberg

unread,
Feb 24, 2014, 2:00:56 AM2/24/14
to yal...@googlegroups.com
YALMIP does not display anything. fmincon on the other hand does. fmincon requires an initial point. Since you haven't supplied any, YALMIP steps in and send the zero vector. fmincon then adjust this initial point to be consistent with the constraint x>=1e-8 which YALMIP has added on x since x is used in a logarithm.

Yuzhou Li

unread,
Feb 24, 2014, 4:04:40 AM2/24/14
to yal...@googlegroups.com
Thank you very much!
Reply all
Reply to author
Forward
0 new messages