My original problem is : \underset{\alpha}{minimize} \frac{ R^2 +G^2 \sum_{i=1}^k {\alpha_i}^2 }{ 2 \sum_{i=1}^k \alpha_i }
R, G, k are known constants.
Although I know I can solve this in closed form by symmetry but I need to solve some other generalizations of this problem and so need to solve this with CVX.
I am trying to solve this problem with epi-graph trick
cvx_begin
variable alphaS(K)
variable t
minimize t
subject to
( R^2 + G^2 * sum_square( alphaS ) ) - t * (2*sum(alphaS) ) < 0
alphaS >= 0
cvx_end
CVX throws the following error
Disciplined convex programming error:
Invalid quadratic form(s): not a square.
Error in cvx/mtimes (line 36)
z = feval( oper, x, y );
Error in lowest_upper_bound (line 21)
( R^2 + G^2 * sum_square( alphaS ) ) - t * (2*sum(alphaS) ) < 0
Is it possible to fix this and solve my problem with CVX?
Now Erling, CVX users aren’t supposed to need to know those tricks, they’re just supposed to go to the function reference where most of them are implemented for you!
And before you proceed to go further with your problem, please read the user guide, in particular the DCP ruleset section. You should not have even tried your “epigraph trick” because it violates those rules. To use CVX effectively you must understand those rules in advance.