(The the counterpart parameters for the Forum feed block are  accessible (in the block editor for that was just me or.   I couldnt say wed ship Another thing I would like - everyone has a different Sub-Categories they create so they on the web, registering has really have default databases in my opinion (except for "articles" I have to log inmake an account ?!". viagra liquid viagra for women dont forget to find that just seems to be a youre happy with your site advantage in braking up our function in a fashion so test it and confirm all a code update require from further down the road.

null) this-plugin-postSave(dataArray)

 
 
Welcome, Guest
Please Login or Register.    Lost Password?

Solving the convex feasibility problem
(1 viewing) (1) Guest
Go to bottomPage: 12
TOPIC: Solving the convex feasibility problem
#5651
Solving the convex feasibility problem 1 Year, 9 Months ago Karma: 0
Dear all,
Recently, I solve a convex feasibility problem as follows
-----------------------------------------------------------
Find Qx,u,Fi

subjecto to
1+u*1.5+tr[(Qx+Fi)He'*He]<=1+tr(Qx*Hd'*Hd)
[Fi,Qx;Qx,u*eye(4)-Qx]>=0
tr(Qx)<=Ps
Qx>=0
u>=0
where
Hd= (randn(1,4)+sqrt(-1)*randn(1,4))/sqrt(2);
He= (randn(1,4)+sqrt(-1)*randn(1,4))/sqrt(2);
-------------------------------------------------------------
my code:
---------------------------------------------------
Na=4;
Nd=1;
Ne=1;
nSNR_dB=0:2:6;
Csec=zeros(1,length(nSNR_dB));
tolerance=0.01;
for i=1:length(nSNR_dB)
Ps=10^(nSNR_dB(i)/10);
Hd= (randn(Nd,Na)+sqrt(-1)*randn(Nd,Na))/sqrt(2);
He= (randn(Ne,Na)+sqrt(-1)*randn(Ne,Na))/sqrt(2);

%bisection method initial lower bound L and upper bound U

L=1/(1+Ps*norm(Hd)^2);
u0=Ps;
Q0=Ps/Na*eye(Na);
f0=Q0*pinv((u0*eye(Na)-Q0))*Q0;
U=(1+1.5*u0+trace((Q0+f0)*He'*He))/(1+trace(Q0*Hd'*Hd));

%--------------bisection compute--------------------------

while((U-L)>tolerance)
t=(U+L)/2;

%-Yalimp solve feasibility problem-

Qx=sdpvar(4,4);
u=sdpvar(1,1);
Fi=sdpvar(4,4);
A=1+1.5*u+trace((Qx+Fi)*He'*He);
Bb=t*(1+trace(Qx*Hd'*Hd));
C=[Fi Qx;Qx u*eye(Na)-Qx];
F=set(A<=Bb)+set(C>=0)+set(trace(Qx)<=Ps)+set(Qx>=0)+set(u>=0);
s=solvesdp(F);
res=checkset(F);

%{
get bs(1) ,which is the least number in res. if bs(1)>0,that is to say F is feasibility.if it is feasibility,then upper bound U=t,else lower boundL=t.
%}

bs=sort(res);
if(bs(1)>0)
U=t;
else
L=t;
end
end
Csec(i)=log2(1/t);
end
plot(nSNR_dB,Csec);
hold on
----------------------------------------------------------------
I want to solve it with Yalmip.I'm not sure whether my matlab code is correct, because the matrix of He and Hd are complex matrixs.
Therefore,Can I use YALMIP to solve this problem including complex matrix? And my matlab code is right?

Thanks
hyawj
Fresh Boarder
Posts: 12
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2011/08/01 05:20 By hyawj.
The administrator has disabled public write access.
 
#5652
Re: Solving the convex feasibility problem 1 Year, 9 Months ago Karma: 32
Should be no problems, YALMIP automatically reformulates to the real-valued counter-part.
lofberg
Platinum Boarder
Posts: 2280
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#5653
Re: Solving the convex feasibility problem 1 Year, 9 Months ago Karma: 0
Thank you lofberg, I really appreciate your help!
I want to solve a quasiconvex problem by using bisection.A feasibility problem shuld be solved in order to use bisection.I would like using yalmip to solve that feasibility problem.However,I can't get the correct simulation result.I don't kown where i had made mistakes.So I hope you can help me check my matlab code,especially the part about yalmip,where include complex matrix.The feasibility probelm and my matlab code had aready descibed last time.
Thanks again,lofberg!!
hyawj
Fresh Boarder
Posts: 12
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2011/08/01 07:23 By hyawj.
The administrator has disabled public write access.
 
#5654
Re: Solving the convex feasibility problem 1 Year, 9 Months ago Karma: 32
Two main issues.

First, your initial definition of U results in a complex number, due to rounding errors in matlab. You should pick out the real part, U = real(U)

Secondly, don't use the residuals to judge feasibility. It can be a bit dangerous, since SeDuMi is an infeasible method, i.e. it can return a slightly infeasible solution to feasible problems. Use the diagnostic code in the output from solvesdp instead. I.e. if the code is 0, everything should be fine, if 1 it is probably infeasible, if numerical problems do something more advanced

Code:


 infeasible = (s.problem == 1) | ((s.problem == 4) & (min(real(res)<-1e-3)))

lofberg
Platinum Boarder
Posts: 2280
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2011/08/01 12:37 By lofberg.
The administrator has disabled public write access.
 
#5655
Re: Solving the convex feasibility problem 1 Year, 9 Months ago Karma: 0
you mean,if s.problem =0,the problem is feasible?
I found i can't use (s.problem == 1) | ((s.problem == 4) & (min(real(res)<-1e-3))) to judge the problem is infeasible.Because I found that s.problem is always equal to zero ,in my matlab code,whether the problem is feasible or not.
hyawj
Fresh Boarder
Posts: 12
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#5656
Re: Solving the convex feasibility problem 1 Year, 9 Months ago Karma: 32
s.problem=0 means that the solver didn't encounter any problems and managed to compute a solution within its tolerances (which may be slightly infeasible due to being infeasible exterior methods etc)

s.problem=1 means that the solver failed completely and suspects infeasibility

s.problem=4 means that numerical problems where encountered, maybe due to infeasible. you have to check the solution, and more outputs from the solver (use the setting savesolveroutputs insdpsettings). For instance, you can check the residuals in checkset and maybe the solution is feasible despite the numerical problems reported
lofberg
Platinum Boarder
Posts: 2280
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 12
Moderators: jcg207