Huge difference between CVX and yalmip in taking aboard some constraints

449 views
Skip to first unread message

Roberto Tumolo

unread,
Aug 7, 2021, 5:23:57 PM8/7/21
to YALMIP
the following constraint takes huge long (about 0.8 hour) in yalmip to be stored:

C= [abs(elementaryPatternOverStations_linear(Steerability_constraint).'.*(FKernel(Steerability_constraint,:)* wr)) <= ...
SLL*abs(elementaryPatternOverStations_linear(EF_pos_scanloss))*sum(amplitudeCoefficients)

whereas the CVX counterpart

abs(elementaryPatternOverStations_linear(Steerability_constraint).'.*(FKernel(Steerability_constraint,:)*wr)) <= ...
SLL*abs(elementaryPatternOverStations_linear(EF_pos_scanloss))*sum(amplitudeCoefficients);

is absolutely immediate. I also used a for cycle to store it, but huge time taken as well. 

Some details (below is not matlab code; it's just to give the size):

size(elementaryPatternOverStations_linear(Steerability_constraint).')=size((FKernel(Steerability_constraint,:)*wr)) ~ [52864           1]

size( SLL*abs(elementaryPatternOverStations_linear(EF_pos_scanloss))*sum(amplitudeCoefficients)) ~ [1 1]

size(wr) ~ [336 1]
length(SLL) ~ [1 1]

Any clue why there's such a huge difference in time?

Thank you





Johan Löfberg

unread,
Aug 8, 2021, 3:50:09 AM8/8/21
to YALMIP
You would have to supply a reproducible example

Roberto Tumolo

unread,
Aug 8, 2021, 5:29:34 AM8/8/21
to YALMIP
Dear professor  Löfberg, thanks for replying.

Please find attached two files, one for CVX one for yalmip (same optimization). In the latter there's the possibility  to use a switch case for the implementation of the constraint in "one shot" or with the for cycle (currently the for cycle is selected). On my PC the CVX implementation of the requirement takes about only 92 seconds. Please note I'm not interested (for now) in solving the problem, but only in understanding how to make yalmip take a reasonable time to get the constraint. Therefore I'd suggest to only look at the time-taking constraint.

Thank you so much.

Roberto
AESA_Sparso_2D_3lambda_0deg_steer_2021_yalmip.m
AESA_Sparso_2D_3lambda_0deg_steer_2021_CVX.m

Johan Löfberg

unread,
Aug 9, 2021, 2:34:27 AM8/9/21
to YALMIP
It's simply a extreme-case model which will be slow with the modelling strategy used internally to minimize the model size (which cvx does not do and thus saves time)

BTW, I think you are missing how massively large this model. the object MatPattT(vis,:)*x_log takes over 1Gb to store, and then that is juggled around

Your best bet is to avoid YALMIPs analysis of the elementwise abs operator and write everything using a vectorized cone 

z = MatPattT(vis,:)*x_log
r = 10^(SLL_th(1,i1)/20)
D = cone([r*ones(1,length(z));real(z)';imag(z)'])

and then you want to use a better solver, such as mosek or gurobi (you have binary variables so sedum is completely out of the picture). whether you actually can even dream of solving this huge MISOCP is another question though...)

Erling D. Andersen

unread,
Aug 9, 2021, 7:51:07 AM8/9/21
to YALMIP
Us at Mosek would be happy to take a look at the model.

Also you may want to contribute the model to


if you want advance the state-of-the-art for solving MISOCPs.



Reply all
Reply to author
Forward
0 new messages