Model creation failed (Model not available in constraint at level 1

49 views
Skip to first unread message

H. Jin

unread,
Sep 17, 2017, 2:21:35 PM9/17/17
to YALMIP
Hi there, I got the problem that failed to create the model.

A simple version of my problem is 

```
x = sdpvar(3, 1); y = sdpvar(4, 1);
assign(x, rand(3, 1)); assign(y, rand(4, 1));
M = rand(3, 4);

optimize([norm(x) == 1, norm(y) == 1], norm(x*y' - M, 'fro')^2);

```

I know this is a nonconvex problem, will the yalmip handle with it and how?

Thanks

Johan Löfberg

unread,
Sep 17, 2017, 2:39:41 PM9/17/17
to YALMIP
2-norm is a convex aware operator which has no implementation for the non-convex case.

hence
e =x*y' - M;
optimize([x'*x == 1, y'*y == 1], e(:)'*e(:));


Johan Löfberg

unread,
Sep 17, 2017, 2:46:52 PM9/17/17
to YALMIP
interestingly, the global solver bmibnb struggles to close optimality gap in default max100 iterations (but easily finds global solution)

sol = optimize([x'*x == 1, y'*y == 1,-1<= [x;y] <= 1], e(:)'*e(:),sdpsettings('solver','bmibnb'));
e(:)'
*e(:)


Moment based solver finds two solutions rather easily

sol = optimize([x'*x == 1, y'*y == 1,-1<= [x;y] <= 1], e(:)'*e(:),sdpsettings('solver','moment'));
assign([x;y],sol.xoptimal{1});
e(:)'*e(:)



H. Jin

unread,
Sep 17, 2017, 2:56:15 PM9/17/17
to YALMIP
Really appreciated. 
Reply all
Reply to author
Forward
0 new messages