Error in prod function in GP


I have the following GP problem which I have to write it in recursive form. I use CVX to solve it (with Mosek solver). The simplified problem is as follows
cvx_begin gp
variable X(10,20)
expression obj(20)
for j=1:20
for i=1:10
obj(j)=obj(j)*X(i,j)^A(i,j); % A is a constant matrix, with some zero elements
minimize prod(obj)
subject to


after running the CVX, I get the following error:
Error using cvx/prod (line 89)
Shouldn’t be here.

Error in minimize (line 14)
x = evalin( ‘caller’, sprintf( '%s ', varargin{:} ) );

Error in main (line 71)
minimize prod(obj)

Does anybody have any idea why I get such a message? I appreciate any help.

1 Like


I have the similar structure(product of a multiplication to the power of a constant) in my GP model but in its constraints


where P_BS is my non negative matrix of optimization variables and all other parameters are matrix of non negative constants.
and I received the same error for that line:

“Error using cvx/prod (line 90)
Shouldn’t be here.”

Sorry I do not know how to solve it. this error sometimes does not occur so there should be something wrong with the data being used.

I appreciate if someone help us on this issue.


Upon further investigation, this error message only crops up when the product is being taken over strictly cvx positive constant expressions.