I am trying to solve the following optimisation problem in MATLAB CVX. I think it is **Convex** but I can’t think of a way to implement it.

min {x_i} -{\sum_{i=1}^{N} \log(1+h_i x_i)} - \frac{K}{\sum_{i=1}^{N}x_i^{-1}}

s.t. \sum_{i=1}^{N} x_i =< P

x_i>0, for all i in {1,…,N}

So far I had implemented the above expression in terms of diagonal matrices where the second term of the obj. function was represented with the harmonic mean function as follows:

K = constant;

**A**_diag is positive-real diagonal matrix

cvx_begin

variable **x**_diag(N,1)

min {**x**_diag} -log_det (I_N + **A**_diag diag(**x**_diag)) - K*harm_mean(**x**_diag)

s.t. \sum **x**_diag =< P

**x**_diag > 0, for all i in {1,…,N}

cvx_end

The two terms in the above implementation seem disjoint. Any suggestions on implementing this in the first format?