I get following error after implementing the attached code.
Error Message
"fmincon stopped because the size of the current step is less than the default value of the step size tolerance but constraints are not satisfied to within the selected value of the constraint tolerance."
Code:
rho = (1/3)*eye(3);
v1 = sdpvar(3,1);
v2 = sdpvar(3,1);
v3 = sdpvar(3,1);
v4 = sdpvar(3,1);
v5 = sdpvar(3,1);
obj2 = trace((v1*v1' + v2*v2'+v3*v3'+v4*v4'+v5*v5')*rho);
cons2 = [sum(v1.*v1) == 1; sum(v2.*v2) == 1;sum(v3.*v3) == 1;sum(v4.*v4) == 1;sum(v5.*v5) == 1; sum(v1.*v2) == 0;sum(v2.*v3) == 0;sum(v3.*v4) == 0;sum(v4.*v5) == 0;sum(v5.*v1) == 0];
ops2 = sdpsettings('solver','fmincon');
optimize(cons2, -obj2, ops2);
obj2 = double(obj2)
I tried changing tolerances by adding following code.
options = optimset('TolX',1e-30,'TolFun', 1e-6)
I tried different values, but it doesn't work. Any suggestions to debug it will be helpful.Suggestions to reformulate the problem or use another solver will also be appreciated (in case fmincon is not the best solver for this problem).