Invalid quadratic forms: not a square

(buckley) #1

My codes are

variable B(n)
expression y(n-1)
for i = 1:(n-1)
X = (B(i)*B(n)+a)/(B(n)+b)
y(i) = entr(X)
maximize (sum(y))

it reminds me:
Invalid quadratic forms: not a square. How can I express the above objective function? Thanks!

(Mark L. Stone) #2

This looks non-convex to me. You will need to use a non-convex optimizer.

(buckley) #3

Thank you for the reply. For CVX, can I declare two variables, one vector variable and one scalar variable? Thanks.

(Mark L. Stone) #4

Yes, but that won;t let you get around a problem being non-convex.

(buckley) #5

Thank you. Indeed. I will optimize that problem by other techniques like genetic algorithm. Anyway, thank you.