Strange behavior with the switch quantifier error

21 views
Skip to first unread message

JackJack

unread,
May 17, 2020, 9:51:07 PM5/17/20
to YALMIP
I have a strange  switch quantifier error. I am currently using the SCIP solver

Not enough input arguments.
Error in constraint 
switch quantifier

when I write the program in this manner, the error message will keep popping up

clc; clear all; %Number of Antena at BS L = 2; h11 = [2+2i;2+2i]; h21 = [1+1i;1+1i]; %Noise Power calculation NoisePowerLinearBW = 3; %Transmit Power PbsMaxdb = 22; %dbM PbsMaxLinear = 10.^(PbsMaxdb/10); w11 = sdpvar(L,1,'full','complex'); w21 = sdpvar(L,1,'full','complex'); alpha = sdpvar(1,1,'full','real'); tau = sdpvar(1,1,'full','real'); beta = sdpvar(1,1,'full','real'); w = [w11' w21']'; objective = 0 ; option = sdpsettings('verbose','0','solver','scip','cachesolvers','1'); contraint = [(norm(w)^2) <= PbsMaxLinear ... 0 <= alpha <= 1 ... norm(h11'*w21)^2 <= tau ... (1-alpha)*tau + NoisePowerLinearBW <= (norm(h11'*w11)^2)*beta ... (norm(h21'*w11)^2) + NoisePowerLinearBW <= (norm(h21'*w21)^2)*beta ... (norm(h11'*w11)^2) + NoisePowerLinearBW <= (norm(h21'*w21)^2)*beta/alpha ... tau >= 0 ... beta >= 0]; sol = optimize(constraint,objective,option); But when I fix the constraint part a little bit. That is declaring the last two constraints through concatenation instead of putting it directly inside the constraint part
contraint = [(norm(w)^2) <= PbsMaxLinear ... 0 <= alpha <= 1 ... norm(h11'*w21)^2 <= tau ... (1-alpha)*tau + NoisePowerLinearBW <= (norm(h11'*w11)^2)*beta ... (norm(h21'*w11)^2) + NoisePowerLinearBW <= (norm(h21'*w21)^2)*beta ... (norm(h11'*w11)^2) + NoisePowerLinearBW <= (norm(h21'*w21)^2)*beta/alpha]; constraint = [contraint tau >= 0 beta >= 0]; sol = optimize(constraint,objective,option);
It run fine, and now I cannot understand the reason behind this fix 😂? Could you kindly explain this behavior for me ? Thank you very much

Johan Löfberg

unread,
May 18, 2020, 12:56:20 AM5/18/20
to YALMIP
you have a typo, contraint
Reply all
Reply to author
Forward
0 new messages