# Why is the optimal value not equal to the objective function

The cvx_optval = 0.1880, but the object function value is 0.1212?
Status: Solved
Optimal value (cvx_optval): +0.188068

sum(zeta1.*pow_abs(l,3)+p.*T)+p_m(t)*T

ans =

``````0.1212
``````

Why does this happen？

If you show your complete program, and all solver and CVX output, perhaps we could say something. Otherwise, we have no idea what you’ve done.

After I changed the input parameters, I solved the problem. But, I encounter another problem.

Disciplined convex programming error: Invalid quadratic form: product is complex.

`c1(j) = p(j)*(real(e*R(:,:,j,k)*e'))+p(j)*(r_m(j,k));`

R(:,:,j,k) is a Hermitian Matrix

Try using `quad_form`.

when I use quad_form, there is still an error

The second argument must be positive or negative semidefinite.
c1(j) = p(j)*(quad_form(e’,R(:,:,j,k))+ r_m(j,k));

You told us that `R` is Hermitian. It actually needs to be Hermitian semidefinite. I should have pointed that out in my previous reply.

but I want to realize this formula, R_{k,t} is hermitain but not semidefinite, how to realize or convert?

Have you proven the optimization problem is convex?