solve a problem by YALMIP

133 views
Skip to first unread message

Saeed Mashdour

unread,
Aug 29, 2014, 4:53:22 PM8/29/14
to yal...@googlegroups.com
Dear Johan,
how can i solve the below problem by YALMIP:
 
W:3*1, F:2*3,A:3*1, e=constant
finding W
min. norm( FW)  s.t. to  abs(W'A)-e*norm(W) >= 1
 
Thanks.

Johan Löfberg

unread,
Aug 30, 2014, 2:05:45 AM8/30/14
to yal...@googlegroups.com

Johan Löfberg

unread,
Aug 30, 2014, 2:12:39 AM8/30/14
to yal...@googlegroups.com
BTW, I hope you understand the problem is nonconvex (very hard) due to the abs operator which is convex but "on the wrong side" of the inequality (convex >= something is a nonconvex set). YALMIP will be forced to model this using mixed-integer second-order cone programming.

Saeed Mashdour

unread,
Aug 31, 2014, 5:03:52 AM8/31/14
to yal...@googlegroups.com
Dear Johan,
I used the yalmip to solve the problem, but it didn't give me the solution, and the hint ''something went wrong'' wan displayed,
please guide me that where maybe the mistake, or, how can i solve it.
thanks,
best regards.

Johan Löfberg

unread,
Aug 31, 2014, 8:34:20 AM8/31/14
to yal...@googlegroups.com
You give us nothing to help you with. You are essentially saying "My car does not work. Help."

What data were you using? What was displayed? Which solver was selected? What was the error code?

Saeed Mashdour

unread,
Sep 1, 2014, 4:01:40 AM9/1/14
to yal...@googlegroups.com

Dear johan,

I used the below data in the given optimization problem

Using the folling matlab program results to the error that is shown after the program

How can I solve the optimization problem using yalmip

--------------------------------------------------------------------------------------------------------------

F2= [  -0.1551 - 0.5912i   1.2433 - 0.5241i   0.4226 + 0.1924i;1.2433 - 0.5241i   0.4226 + 0.1924i -10.7550 - 2.4243i];
a=[ 1.0000 + 0.0000i ;  0.5184 + 0.8551i ; -0.4626 + 0.8866i];

e=2.4999;

w=spdvar(3,1);

constraints=[abs(w'*a)-e*norm(w)]>=1;

objective=norm(conj(F2)*w);

options=spdsettings

sol=solvesdp(constraints, objective, options);

if sol.problem==0

solution=double(w)

else

display('hmm, something went wrong');

sol.info

yalmiperroe(sol.problem)

end

-------------------------------------------

the run result was as,

 

Hmm, something went wrong!

ans =

Infeasible problem (BNB)


ans =

Infeasible problem

---------------------------------------

thank you

regards

 

 

 

 

 

 

 

Johan Löfberg

unread,
Sep 1, 2014, 4:04:10 AM9/1/14
to yal...@googlegroups.com
No, this is not the code you are running as it is full of typos and won't run

Saeed Mashdour

unread,
Sep 1, 2014, 4:56:29 AM9/1/14
to yal...@googlegroups.com
sorry,
in this code, just the sdp was written as spd
the othe informations were corect
please chek it again
if it is possible
 

F2= [ -0.1551 - 0.5912i 1.2433 - 0.5241i 0.4226 + 0.1924i;1.2433 - 0.5241i 0.4226 + 0.1924i -10.7550 - 2.4243i];

a=[ 1.0000 + 0.0000i ; 0.5184 + 0.8551i ; -0.4626 + 0.8866i];

e=2.4999;

w=sdpvar(3,1);

constraints=[abs(w'*a)-e*norm(w)]>=1;

objective=norm(conj(F2)*w);

options=sdpsettings

sol=solvesdp(constraints, objective, options);

Johan Löfberg

unread,
Sep 1, 2014, 5:16:51 AM9/1/14
to yal...@googlegroups.com
Frist, I think you misplaced a bracket and mean (yields the same result, but makes more sense syntactically

constraints=[abs(w'*a)-e*norm(w)>=1];


The problem is that convexity propagation fails (as seen in the info field in the sol structure). The reason is that abs for a complex expression leads to a norm expression, and the norm operator is only applicable to convex expressions as it uses an SOCP representation. Hence, you need to get rid of the norm in the nonconvexity. Squaring it would work, and you would then have

sdpvar t
constraints
=[w'*a*a'*w >= t^2,t-e*norm(w)>=1];
objective
=norm(conj(F2)*w);
sol
=solvesdp(constraints, objective)

This will not work though as there is no solver suitable for this model in the current release of YALMIP (nonconvex quadratic +  norms). Hence, we square everything, and add a real operator to make sure all we actually get real expressions despite floating-point issues

sdpvar t
constraints
=[real(w'*a*a'*w) >= t^2,(t-1)^2 >= e^2*w'*w, t-1>=0];
objective= real(w'
*F2'*F2*w);

At this point though, you have to decide if you want to solve the nonconvex quadratically constrained QP locally or globally. The global solver bmibnb in YALMIP tells us the problem is infeasible though (or extremely ill-conditioned)

sol=solvesdp([-10000<= w <= 10000,constraints], objective,sdpsettings('solver','bmibnb'))
* Starting YALMIP global branch & bound.
* Branch-variables : 4
* Upper solver     : fmincon
* Lower solver     : GUROBI
* LP solver        : GUROBI
 
Node       Upper      Gap(%)       Lower    Open
   
1 :          Inf      NaN      2.111E-26   2    
   
2 :          Inf      NaN      2.111E-26   1  Infeasible  
   
3 :          Inf      Inf            Inf   0  Infeasible  
* Finished.  Cost: Inf Gap: Inf
* Timing: 92% spent in upper solver
*         1% spent in lower solver
*         6% spent in LP-based domain reduction

sol
=

    yalmiptime
: 0.1620
    solvertime
: 8.2460
          info
: 'Infeasible problem (BMIBNB)'
       problem
: 1









Johan Löfberg

unread,
Sep 1, 2014, 5:21:31 AM9/1/14
to yal...@googlegroups.com
An alternative nonlinear model would be

w=sdpvar(3,1);
sdpvar t
constraints
=[sqrtm(real(w'*a*a'*w))-e*sqrtm(w'*w)>=1];
objective=real(w'
*F2'*F2*w);

sol=solvesdp([-10000<= w <= 10000,constraints], objective,sdpsettings('
solver','bmibnb'))

Still reveals infeasibility though. Changing e (making it smaller) and you get a feasible model, which indicates that the solver isn't making any mistake when it judges the original problem is infeasible

constraints=[sqrtm(real(w'*a*a'*w))-sqrtm(w'*w)>=1];





Saeed Mashdour

unread,
Sep 1, 2014, 10:50:00 AM9/1/14
to yal...@googlegroups.com
Dear johan,
thank you very much for your help
best regards.
Reply all
Reply to author
Forward
0 new messages