Closed pbpf closed 4 years ago
You would have to supply reproducible example. (You restart YALMIP or clear globals after installing new versions but you never have to clear except for performance reasons in normal use)
Here is the code ,filename bilinear.m
function bilinear()
% This example formulates and solves the following simple bilinear model:
% maximize x
% subject to x + y + z <= 10
% x * y <= 2 (bilinear inequality)
% x * z + y * z = 1 (bilinear equality)
% x, y, z non-negative (x integral in second version)
% Copyright 2020, Gurobi Optimization, LLC
% Linear constraint matrix
x=sdpvar(1,1);
y=sdpvar(1,1);
z=sdpvar(1,1);
obj=-x;
con=[x+y+z<=10;x*y>=2;x*z+y*z==1;x>=0;y>=0];
ops = sdpsettings('verbose',0,'solver','GUROBI');%,'GUROBI.IterationLimit',20);%%mosek GUROBI
% ops = sdpsettings('verbose',1,'solver','ecos','ecos.maxit',10);%,'GUROBI.OptimalityTol',1e-8,'GUROBI.FeasibilityTol',2e-5);
result=optimize(con,obj,ops);
disp(result.info);
disp(value(x));
end
You would have to supply reproducible example. (You restart YALMIP or clear globals after installing new versions but you never have to clear except for performance reasons in normal use)
[yalmip last via git clone]
I try to solve a binear model with solver GUROBI using yalmip.
1st time I got: Successfully solved (GUROBI-NONCONVEX);
but when re-run .m file, there is a error:
I fould clear all can solve this, so it may be cause by gobal variables.
Should we remove all gobal variables in yalmip to avoid this kinds of problems forever?