Hi,
I am attempting to use the optimizer command to pre-build my model but I seem to be having some issues with the solution not obeying the constraints. I may have called the function incorrectly.
Any help would be greatly appreciated.
yalmip('clear')
options = sdpsettings('solver','sedumi');
n = 2;
S = sdpvar(n, n, 'full');
t = sdpvar(1, n);
x = sdpvar(1, n);
Constraints = [x*S*x' <= 1, x >= 0.1, x <= 0.9];
Objective = -x*t';
P = optimizer(Constraints, Objective, options, {S, t}, x);
Then calling the model object,
S_a = [1.0, 0.5; 0.5, 1.0];
T = [1.0, 1.0];
P({S_a, T})
gives the solution,
which does not satisfy the first constraint.
Calling optimize directly does seem to work fine,
optimize([x*S_a*x' <= 1, x>= 0.1, x <= 0.9], -x*T', options)
value(x)
ans = [0.5774, 0.5774]
Where have I gone wrong? Thank you.