[Bug Report] Error when using nonlinear solver ipopt.

31 views
Skip to first unread message

Dan Pan

unread,
May 2, 2017, 1:20:42 PM5/2/17
to YALMIP
Dear Johan,

Very nice to talk with you.

As I stated in the previous thread, I was playing with a nonlinear solver last night in order to detect an artifact. Now I explain the artifact as follows.

When run the simple code below, we get an error:

*** Error using Ipopt Matlab interface: ***
Jacobian Structure must be an m x n sparse matrix where m is the number of constraints and n is the number of variables.

I tried to solve the problem by a line-by-line debugging of YALMIP source code. After 10 hours of debugging, I temporarily find a solution. That is to change the default "enable the second order cone shortcut" to "disabled" ('convertconvexquad',0). This is because when YALMIP is converting the model to the nonlinear one(yalmip2nonlinearsolver.m and compileinterfacedata.m), as it uses the second order cone shortcut, it will eliminate some decision variables with quadratic convex constraints from the list of "nonlinear variables". Hence, we lose some nonlinear constraints when calling the ipopt.

I hope I'm clear in this example. If you also detect the error in the following code, I wish this small bug could be fixed in the next versions of YALMIP(either simply disable the "second-order-cone shortcut" when calling the nonlinear solvers, or some deep debugging to make everything consistent).

Best wishes to you and YALMIP!

Best regards,
Dan

Here is the code which shows the artifact:
clear;
x = sdpvar(2,1);

objective= x'*x;  %Simple example that x_opt = [0 0]'
constraints = x'*x <= 10;

   ops = sdpsettings('solver','ipopt');  %Error!
%   ops = sdpsettings('solver','ipopt','convertconvexquad',0); %Uncomment this line to avoid the error...

P = optimizer(constraints, objective, ops,[],x);
[x,errorcode,~,~,~]  = P()



Reply all
Reply to author
Forward
0 new messages