Convex optimization problem does not follow DCP rules

时光总嘲笑我的痴心妄想 提交于 2021-02-10 19:55:51

问题


I am trying to solve the following optimization problem using cvxpy:

x and delta_x are (1,N) row vectors. A is a (N,N) symmetric matrix and b is a scalar. I am trying to find a y, such that it minimizes the sum of squares of (y - delta_x) with the constraint (x+y).A.(x+y).T - b = 0. Below is my attempt to solve it.

x = np.reshape(np.ravel(x_data.T), (1, -1))
delta_x = np.reshape(np.ravel(delta.T), (1, -1))
y = cp.Variable(delta_x.shape)
objective = cp.Minimize(cp.sum_squares(y - delta_x))
constraints = [cp.matmul(cp.matmul(x + y, A), (x + y).T) == (b*b)]
prob = cp.Problem(objective, constraints)
result = prob.solve()

I keep getting the error 'cvxpy.error.DCPError: Problem does not follow DCP rules'.

I followed the rules stated in the answer here, but I don't understand how to construct the proper cvxpy minimization Problem. Any help would be greatly appreciated. Thanks!

来源:https://stackoverflow.com/questions/52285474/convex-optimization-problem-does-not-follow-dcp-rules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!