Quasiconvex programming trouble with addition operator

Consider the two rather standard quasi-convex programs in cvxpy:

import cvxpy as cp

The following QCP solves without any trouble:

x1 = cp.Variable()
x2 = cp.Variable()
obj = cp.sqrt(x1) * cp.sqrt(x2)
BC = [ 3 * x1 + x2 <= 100]
prob = cp.problem(cp.Maximize(obj), BC)
prob.solve(scp = True, verbose = True)

Whereas the following fails:

x1 = cp.Variable()
x2 = cp.Variable()
obj = (cp.sqrt(x1) + cp.sqrt(x2)) ** 2
BC = [ 3 * x1 + x2 <= 100]
prob = cp.problem(cp.Maximize(obj), BC)
prob.solve(scp = True, verbose = True)

CVXPY is a different tool than CVX ans is not addressed on this forum.

Please post CVXPY questions at


or
1 Like