Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can this library solve any convex-concave problem? #77

Open
zhumingpassional opened this issue Mar 24, 2022 · 9 comments
Open

Can this library solve any convex-concave problem? #77

zhumingpassional opened this issue Mar 24, 2022 · 9 comments

Comments

@zhumingpassional
Copy link

zhumingpassional commented Mar 24, 2022

Good work.

Can this library solve any convex-concave problem? For example, there are non-convex constraints:

(x + y)^2 -x^2 - y^2 - (x^2 + y^2) ^ (3/2) <= 0, where (x + y)^2 is convex, and -x^2 - y^2 - (x^2 + y^2) ^ (3/2) is concave

-x^2 - y^2 + 100 <= 0

Is obtained solution globally optimal?

Is there any paper to describe the algorithm/method?

Thank you very much.

@stephenpboyd
Copy link

stephenpboyd commented Mar 24, 2022 via email

@xinyueshen
Copy link
Member

Hi @zhumingpassional, for the specific constraints that you mentioned, DCCP can handle them as long as you write them as
(x + y)^2 <= x^2 + y^2 + (x^2 + y^2) ^ (3/2)
and
100 <= x^2 + y^2.

@zhumingpassional
Copy link
Author

@stephenpboyd @xinyueshen

Thanks for your reply and valuable suggestions.

Can CVXPYgen generate C code for embedded applications when using cvxpy and dccp?

Is the generated C code faster than the python code?

@xinyueshen
Copy link
Member

Hi @zhumingpassional, thanks for the questions, but DCCP currently does not work with CVXPYgen.

@zhumingpassional
Copy link
Author

Will CVXPYgen support DCCP in the near future? I really hope it can.

Thanks.

@zhumingpassional
Copy link
Author

zhumingpassional commented Apr 1, 2022

  1. Does DCCP support all models?

I use DCCP to solve a convex-concave problem, whose constraint is:
(x + y)^2 <= x^2 + y^2 + (x^2 + y^2) ^ (3/2) # I used cvxpy.power(, 3/2)
It does not work. It raise errors:
" cvxpy.error.DCPError: Problem does not follow DCP rules. Specifically:
The following constraints are not DCP:
0.0 <= power(var4[0], 2.0) + power(var5[0], 2.0) , because the following subexpressions are not:
|-- 0.0 <= power(var4[0], 2.0) + power(var5[0], 2.0)"

However, if I revise the constraint as
(x + y)^2 <= x^2 + y^2 + (x^2 + y^2) ^ (2), # I used cvxpy.power(, 2)
It works.

Does this library only support the power function where the parameter should be integer? I am not sure.

  1. Initialize a feasible solution by users.

If I used the second model so that it works. Sometimes, DCCP cannot obtain a solution. Is it because it cannot obtain a feasible solution using the method in your paper? If I use other methods to get an initial solution, does DCCP provide the interface to support it?

Hope to get your reply. Thanks very much.

@stephenpboyd
Copy link

stephenpboyd commented Apr 1, 2022 via email

@xinyueshen
Copy link
Member

@zhumingpassional For the first question, the following code should work.

[(x + y) ** 2 <= x ** 2 + y ** 2 + cp.power(z, 3), z == cp.norm(cp.vstack([x, y]))]

For the second question, yes, you can initialize the variables by setting their values before calling DCCP to solve, and then DCCP will use the initialization that you provide. The code is simply like the following.

x.value = 1
y.value = 2
z.value = 3
prob.solve(method="dccp")

@zhumingpassional
Copy link
Author

@stephenpboyd @xinyueshen Thank you very much for your valuable reply. Excellent work! I will read the document carefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants