cons = [];
cons = [cons, 100 <= x <= 200];
cons = [cons, 300 <= y <= 400];
cons = [cons, t <= plog(y, x + y)];
optsB = sdpsettings('solver','baron', ...
'verbose',1, ...
'savesolveroutput',1, ...
'savesolverinput',0,'CplexLibName','cplex12100.dll',...
'filekp',1);
elapsedTime = toc;
if solB.problem == 0
% Extract and display values
x_opt = value(x);
y_opt = value(y);
t_opt = value(t);
obj_opt = value(obj); % this is -t_opt
fprintf('Optimal solution found.\n');
fprintf('x* = %.10f\n', x_opt);
fprintf('y* = %.10f\n', y_opt);
fprintf('t* = %.10f\n', t_opt);
fprintf('Objective value (-t) = %.10f\n', obj_opt);
fprintf('Elapsed time = %.4f seconds\n', elapsedTime);
else
fprintf('Solver reported an issue: %s\n', yalmiperror(solB.problem));
end
I run this program and got this strange output
z =
'(x(4)*log(x(5)/x(4)))'
Not sure why thought ?