# Cannot perform the operation: {negative constant} .* {convex}

Hi
I do not know how to fix this problem about"Disciplined convex programming error:
Cannot perform the operation: {negative constant} .* {convex}".

`2-Pr(n,1)*inv_pos(Pr_vec(n,1))-drd_vec(n,k)*inv_pos(drd(n,k))`,which leads to this error.
Pr_vec and drd_vec are cvx variables.
thank u vvvvery much

Thanks.Recently I was faced with a new problem :I do not know if cvx variable can be the denominator in my constraint function.
If cvx variable must be a denominator,is there any other form of expression.
Thanks for attention.

You have to provide more context. You already know about `inv_pos`. There is also `quad_ovr_lin`. And gp mode has some provision for division, subject to the special gp rules.

And as you know from reading the link in my previous post, the first thing you must do is prove convexity of the constraint.

## pr,ps,drd,dre,drd1,drs,x[n],y[n] are cvx variables .I can prove these formulations are convex. But Status: Failed Optimal value (cvx_optval): NaN.I donâ€™t konw why.Here are the simulation results. Calling SDPT3 4.0: 7404 variables, 2749 equality constraints For improved efficiency, SDPT3 is solving the dual problem.

num. of constraints = 2749
dim. of sdp var = 3696, num. of sdp blk = 1848
dim. of linear var = 1858
dim. of free var = 2 *** convert ublk to lblk

SDPT3: Infeasible path-following algorithms

## number of iterations = 38 Total CPU time (secs) = 2.87 CPU time per iteration = 0.08 termination code = 3 DIMACS: 2.8e+07 0.0e+00 2.1e-04 0.0e+00 -1.0e+00 1.1e-02

Status: Failed
Optimal value (cvx_optval): NaN

CVX accepted the problem as convex, but the solver failed. Given the use of `log`, ut seems you must be using CVXQUAD. Try replacing the CVXQUAD exponential.m with the original version from CVX, and using Mosek 9.x instead. Also, perhaps the scaling of input data is bad?