 # Writing (x(1)^2.5)*(x(2)^(-0.5))

(zhuzhu) #1

how to write (x(1)^2.5)*(x(2)^(-0.5)) as objective function with cvx?

``````l=[1;1];
u=[4;4];
n=2;
cvx_begin
variable x(2)

minimize( x(1)^2.5)*(x(2)^(-0.5) )
subject to
x >= l;
x <= u;
cvx_end``````
(Mark L. Stone) #2

This is convex for x(1), x(2) > 0.

Edit; Straightforwardly solved using gp mode, as shown in my next post.

(zhuzhu) #3

can I use prod_inv to solve?

(Mark L. Stone) #4

This can be solved using gp mode

``````l=[1;1];
u=[4;4];
n=2;
cvx_begin gp
variable x(2)
minimize( x(1)^2.5*x(2)^(-0.5) )
subject to
x >= l;
x <= u;
cvx_end
``````

Optimal x(1) = 1, x(2) = 4.

(zhuzhu) #5

Thanks. But how to solve the following problem with CVX?

``````min  0.5*( x(6)^2.5*x(7)^(-0.5) )+0.4*( x(8)^2.7*x(7)^(-0.6) )
s.t.   0.5*(x(1)^(-0.1))*(x(2)^(-0.2))*(x(3)^(-0.3))*(x(4)^(-0.1))*(x(5)^(-0.2))-0.6*(x(1)^(0.01))*(x(2)^(0.03))*(x(3)^(0.02))*(x(4)^(0.05))*(x(5)^(0.01))<=0.5
0<=x(i)<=2,i=1,2,3,4,5
1<=x(6)<=11
1<=x(7)<=12
1<=x(8)<=13``````
(Mark L. Stone) #6

Addressed in other thread.