KKTsystem error

45 views
Skip to first unread message

Aras

unread,
Jan 1, 2020, 11:24:40 AM1/1/20
to YALMIP
Happy new year, YALMIP community!

I am trying to run a simple code:
x = sdpvar(2,1);
Objective = -x(1)*x(2);
Constraints = [x(1) + x(2) == 2];
[KKTsystem, details] = kkt(Constraints,Objective,x);

And in turn I receive:
Starting derivation of dual bounds (can be turned off using option kkt.dualbounds)
Error using  : 
For colon operator with char operands, first and last operands must be char.

Error in lmi/kkt (line 195)
KKTConstraints = [KKTConstraints, (s == 0):'Stationarity'];

Error in constraint/kkt (line 9)
    [KKTConstraints, details] = kkt(lmi(F),h,parametricVariables);

Error in b1 (line 4)
[KKTsystem, details] = kkt(Constraints,Objective,x);


Am I doing a mistake? All I want to see is that (1,1) is the KKT point. Thanks!

Aras

unread,
Jan 1, 2020, 11:28:23 AM1/1/20
to YALMIP
Ok, I deleted the ,x in the kkt command, then added optimize(KKTsystem), now it works!

Is there a way I can see each of the KKT points (of course in this example there is only 1).

Johan Löfberg

unread,
Jan 1, 2020, 12:07:06 PM1/1/20
to YALMIP
You can only solve the resulting optimization problem, and that gives you 1 solution. If you somehow want to enumerate all possible solutions, you have to iteratively add constraints to cut away previous solutions you aren't interested in

Aras

unread,
Jan 1, 2020, 2:46:38 PM1/1/20
to YALMIP
Great, thanks!
Reply all
Reply to author
Forward
0 new messages