admin管理员组

文章数量:1122826

I am trying to solve an SOCP problem using mosek.

objective = cp.Minimize(cp.power(cp.norm(beta, 2), 2)/2 + cp.power(lambda_var, 2)/2 - beta @ y_train)


# Constraints

constraints = [
    cp.quad_form(beta, K_1) / cp.power(rho_g, 2) <= cp.power(lambda_var, 2),
    cp.quad_form(beta, K_2) / cp.power(rho_g, 2) <= cp.power(lambda_var, 2)
    ]

# Define the problem 

problem = cp.Problem(objective, constraints)
problem.solve(solver = cp.MOSEK)

I keep running into the issue that my problem is not DCP, even though I wrapped the K matrices as PSD using cp.psd_wrap and all my terms in the objective function are convex or linear, as well as the terms in my constraints.

I could really use some help as I have found nothing in hours of scouring the internet.

The error message shows:

DCPError: Problem does not follow DCP rules. Specifically:
The following constraints are not DCP:
QuadForm(var303, psd_wrap([[1.00 0.96 ... 0.94 0.91]
 [0.96 1.00 ... 0.92 0.85]
 ...
 [0.94 0.92 ... 1.00 0.98]
 [0.91 0.85 ... 0.98 1.00]])) / power(40.0, 2.0) <= power(var304, 2.0) , because the following subexpressions are not:
|--  QuadForm(var303, psd_wrap([[1.00 0.96 ... 0.94 0.91]
 [0.96 1.00 ... 0.92 0.85]
 ...
 [0.94 0.92 ... 1.00 0.98]
 [0.91 0.85 ... 0.98 1.00]])) / power(40.0, 2.0) <= power(var304, 2.0)
QuadForm(var303, psd_wrap([[6.61 0.37 ... 7.94 6.49]
 [0.37 1.93 ... 0.04 1.83]
 ...
 [7.94 0.04 ... 90.47 17.66]
 [6.49 1.83 ... 17.66 470.43]])) / power(40.0, 2.0) <= power(var304, 2.0) , because the following subexpressions are not:
|--  QuadForm(var303, psd_wrap([[6.61 0.37 ... 7.94 6.49]
 [0.37 1.93 ... 0.04 1.83]
 ...
 [7.94 0.04 ... 90.47 17.66]
 [6.49 1.83 ... 17.66 470.43]])) / power(40.0, 2.0) <= power(var304, 2.0)

本文标签: convex optimizationMy problem does not follow DCP rules in cvxpyStack Overflow