# A simple problem

Why x = 0, y = 0 is not a valid solution to this problem but only x=1, y=1:
(theoretically not technically)

max whatever
s.t.
x^2 = y
x = y

i.e.

max whatever
s.t.
x^2y^-1 = 1
x^1y^-1 = 1

I have no idea what the 2nd problem is.

`x = 0, y = 0` is a feasible solution to the 1st problem. As to whether it is a(n optimal) solution, that depends on what `whatever` is.

And what does this have to do with CVX or convex optimization?

I solved the following problem with cvxpy but got 1 as the answer. Why didn’t I get 0?

import cvxpy as cp

x = cp.Variable(pos=True, name=“x”)
y = cp.Variable(pos=True, name=“y”)

constraints = [
x*x / y == 1,
x / y == 1
]

problem = cp.Problem(cp.Maximize(1/x), constraints)
problem.solve(gp=True)
problem.value

x = y = objective = 1 is feasible and optimal,. It provides better objective value than 0, why should that be the optimal objective value?

In any event, this forum is for CVX, not for CVXPY. CVXXPY questions should be asked at https://groups.google.com/forum/#!forum/cvxpy

How can you have nonlinear equalities even in GP mode I wonder.

The program is accepted by CVX, and solved itself (without calling solver) analytically (as homogeneous).

``````cvx_begin gp
variables x y
maximize(1/x)
x*x / y == 1
x / y == 1
cvx_end
``````

If the RHS’ are changed, then CVX calls a solver, but is “willing” to call Gurobi (without use of Successive Approximation method or CVXQUAD), so it is not really being solved as a GP.

GP section of CVX Users’ Guide has this extract:

Three types of constraints may be specified in geometric programs:
• An equality constraint, constructed using ==, where both sides are monomials.

And this:
valid monomial is
• a declared variable;
• the product of two or more monomials;
• the ratio of two monomials;
• a monomial raised to a real power; or
• a call to one of the following functions with monomial arguments: prod, cumprod, geo_mean,sqrt.

So it appears to satisfy these rules.

Maybe they write

x^2 / y = 1

as

x^2/y <=1
y/x^2 <= 1

Perhaps that is a mystery only @mcg can answer.