Error: inner matrix dimension must agree in cvxprob/eliminate


(Suxin9999) #1

When I ran my program, the error occurred as followed:

Error using * Inner matrix dimensions must agree
in cvxprob/eliminate (line 137)
P = P * cvx_invert_structure( xR );

in cvxprob/solve (line 18)
[ At, cones, sgn, Q, P, dualized ] = eliminate( prob, true, shim.dualize );

in cvx_end (line 88)
solve( prob );

in F_DC_RS (line 73)
cvx_end
where “F_DC_RS” is my script.

Because the complete program is consist of my functions, I can only paste the part that calls CVX toolbox.

cvx_begin
variable Q(Nt,2Nt,N,K) complex
expressions g(1) Gf(1) Psum(N) gc(N,K) fc_s(N,K) ga(N,K) fa_s(N,K) gp(N,K) Gfc Gfa Gfp
[gc,fc_s,ga,fa_s,gp,~]=F_convave_fun(K,N,Nt,Nr,H,Q,sigma2,A);
g=cvx(0);
for i=1:N
for j=1:K
g=g+min([gc(i,j)+fa_s(i,j),ga(i,j)+fc_s(i,j)])+gp(i,j);
end
end
case 1
end
[Gfc,Gfa,Gfp]=F_gradientF(K,N,Nt,Nr,H,Qpc{iter},Q,sigma2,A);
Gf=Gfc+Gfa+Gfp;
for i=1:N
Psum(i)=cvx(0);
for j=1:K
Psum(i)=Psum(i)+real(trace(Q(:,1:Nt,i,j)+Q(:,Nt+1:2
Nt,i,j)));
end
end
maximize g-f-Gf
subject to
for i=1:N
for j=1:K
Q(:,1:Nt,i,j)==hermitian_semidefinite(Nt);
Q(:,Nt+1:2*Nt,i,j)==hermitian_semidefinite(Nt);
end
Psum(i)<=Pb;
end
cvx_end
where g is cvx concave expression (scalar), f=42.0508 and Gf is cvx real affine expression (scalar).

There is no error before “cvx_end”.


Why does error of convex problem below arise?
(Mark L. Stone) #2

Perhaps this is a CVX bug. See CVX_SDP Index exceeds matrix dimensions problem

Follow the instructions there and in Error in cvxprob/eliminate . Report at http://support.cvxr.com/support/tickets/new .


(Michael C. Grant) #3

I do think there’s a CVX bug here, but I won’t be able to fix it without a reproducible test case… I’ll see if that other issue Mark linked to offers one, but this one I’m afraid won’t work.


(Suxin9999) #4

I have solved my problem. When ‘log_det’ is called, the input argument is required to be real number. I added ‘log_det(real(HXH’+I))’, and then the matrix dimension problem didn’t occur.

Before that, I have tried the YALMIP+SDPT3. Although it didn’t happen to any problems, the solution is not accurate. I’d like to know the necessity
of function ‘eliminate’. Why doesn’t YALMIP have this step?