Object objective function influences whether my problem is feasible.

27 views
Skip to first unread message

Peng He

unread,
Apr 19, 2017, 7:07:18 AM4/19/17
to YALMIP
Hi:
    I want to solve a SDP program using YALMIP. And my code is
function [alpha,x,eta1,eta2,Q,W] = rand_test(N,mu,Sigma,r0,beta,gamma1,gamma2)

%varibles
alpha = sdpvar(1);
lambda1 = sdpvar(1);
kama1 = sdpvar(1);
eta1 = sdpvar(N,1);
eta2 = sdpvar(N,1);
tao1 = sdpvar(N,1);
tao2 = sdpvar(N,1);
x = sdpvar(N,1);
Q = sdpvar(N,N);
W = sdpvar(N,N);

%constraints
c1 = [eta1 >= 0];
c2 = [eta2 >= 0];
c3 = [tao1 >= 0];
c4 = [tao2 >= 0];
c5 = [Q >= 0];%Semidefinite constraint
c6 = [W >= 0];%Semidefinite constraint
c7 = [x >= 0];
c8 = [sum(x)==1];
c9 = [[Q (eta1-eta2+x)/2-Q*mu;((eta1-eta2+x)/2-Q*mu)' lambda1+alpha]>=0];%Semidefinite constraint
c10 = [[Q (eta1-eta2)/2-Q*mu;((eta1-eta2)/2-Q*mu)' lambda1]>=0];%Semidefinite constraint
c11 = [[W (tao1-tao2+x)/2-W*mu;((tao1-tao2+x)/2-W*mu)' kama1]>=0];%Semidefinite constraint
c12 = [-kama1-tao1'*(mu+gamma1)+tao2'*(mu-gamma1)-sum(sum(W.*(gamma2*Sigma-mu*mu')))>=r0];
%c13 = [lambda1 >= 0];
%c14 = [kama1 >= 0];

Constraints = [c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12];

%object
Obj = alpha+1/(1-beta)*(lambda1+eta1'*(gamma1+mu)+eta2'*(gamma1-mu)+sum(sum(Q.*(gamma2*Sigma-mu*mu'))));

optimize(Constraints);% Problem status  : PRIMAL_AND_DUAL_FEASIBLE;  Solution status : OPTIMAL
optimize(Constraints,Obj);% Problem status  : PRIMAL_INFEASIBLE ; Solution status : PRIMAL_INFEASIBLE_CER
%solvesdp(Constraints);
check(Constraints)在此输入代码...
When I execute ‘optimize’ function without objective function,there's a optimal solution,but when execute the same function with objective function,the problem status turns out 'The problem is primal infeasible'.I'm confused,why objective function can influence feasible region?Thanks.

Johan Löfberg

unread,
Apr 19, 2017, 7:10:35 AM4/19/17
to YALMIP
That typically means the problem is unbounded (dual unbounded/primal infeasible)

Simple trick is to add constraints Obj >= -10000 for example, and solve. If the solution nicely ends up at -10000, you should suspect unbounded. Look at the values at that point, most likely you will see that some variables tend to very large values, i.e., you've formulated a bad model missing constraints

Peng He

unread,
Apr 19, 2017, 7:21:14 AM4/19/17
to YALMIP
Many thanks.I'll check my model again.
Reply all
Reply to author
Forward
0 new messages