I read cvx_ Guide, but it does not mention how to express equality constraints, but I now encounter a constraint: x-y ^ 2=0, and I do not know how to solve it with cvx.

pow_p(y,2)-x<=0，it meets the DCP rule set, but how should I express the other one to achieve the effect I want

Nonlinear equality constraints are, apart from “trivial” (vacuous) cases, non-convex. Nonlinear equality constraints, trivial or not, are not allowed in CVX.

However, assignment of a CVX expression follows different rules. A nonlinear expression can be assigned provided the expression is convex or concave (affine is a special case of both convex and concave).

The following is allowed in CVX:

```
variable y
x = y^2; % do not declare x as a variable
```

Now you can use `x`

anywhere in your CVX program where `y^2`

would have been allowed. Doing this, `x`

is just a shorthand for writing out `y^2`

.

i need your help DR mark

If you have a question, ask it clearly. I’m not a mind reader

Note that I only answer questions posted in the forum, not privately.

And I’m not a Dr., just a semi-random Joe Blow on the internet. And I’m semidefinite about that.

I want to use cvx to solve the nonlinear equations. One of the equality constraints is: x-v ^ 2=0. Handling equality constraints in cvx requires that the left and right sides of the equal sign are affine functions.

My objective function is

minimize rel_ entr(1-a,x)+rel_ entr(a,y)-[log(15)-[16+4*square(w*f)+(1/15)*quad_over_lin(w,c)+8*square(w)+(1/24)* quad_over_lin(v,g)]]

I tried your method to replace v ^ 2 with y, but I still reported an error. How can I solve this problem?

CVX is not a tool suitable for solving nonlinear equations.