-
Notifications
You must be signed in to change notification settings - Fork 8
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
Unclear README.md #102
Comments
Thanks for trying out these new features. using JuMP, PolyJuMP, Gurobi, DynamicPolynomials
model = Model(() -> PolyJuMP.QCQP.Optimizer(Gurobi.Optimizer()))
a = 2
@variable(model, x)
@variable(model, y)
@constraint(model, a * x * y^2 + y^3 >= a * x)
@objective(model, Min, x + y)
optimize!(model) or try this one with For SAGE, it's indeed constraints with |
I tried the snippet, but it does not work work for me.
But this does, which is really promising: using JuMP, PolyJuMP, Gurobi, DynamicPolynomials
model = Model(() -> PolyJuMP.QCQP.Optimizer(Gurobi.Optimizer()))
@variable(model, x)
@variable(model, y)
@constraint(model, x + y == 1)
@constraint(model, x >= 0)
@constraint(model, y >= 0)
@objective(model, Min, x^3 + y)
optimize!(model) Unfortunately changing the objective to |
Another weird thing is the interaction with variables constrained on creation. If I formulate the problem manually, everything works. model = Model(Gurobi.Optimizer)
@variable(model, x >= 0)
@variable(model, y >= 0)
@variable(model, xx)
@constraint(model, xx == x*x)
@constraint(model, x + y == 1)
@objective(model, Min, xx*x + y)
optimize!(model) but the equivalent via QCQP, it fails with model = Model(() -> PolyJuMP.QCQP.Optimizer(Gurobi.Optimizer()))
@variable(model, x >= 0)
@variable(model, y >= 0)
@constraint(model, x + y == 1)
@objective(model, Min, x^3 + y)
optimize!(model) My gurobi version
|
I had no idea that it is now possible to formulate expressions such as x^3 in JuMP variables. That's brilliant! Since I'm already out of topic for this entire issue... sorry... here goes: The following example works as expected for SCS and SumOfSquares, but reports infeasible for ECOS with PolyJuMP.SAGE. using JuMP, PolyJuMP, DynamicPolynomials, ECOS, SumOfSquares
@polyvar x y
p = x^3 - x^2 + 2x*y -y^2 + y^3
S = @set x >= 0 && y >= 0 && x + y >= 1
model = Model(ECOS.Optimizer)
setpolymodule!(model, PolyJuMP.SAGE)
@variable(model, α)
@objective(model, Max, α)
@constraint(model, c3, p >= α, domain = S)
optimize!(model) |
Thanks! The goal now is to also add these solvers for SumOfSquares and SAGE that automatically rewrite it by moving the JuMP decision variables into DynamicPolynomials variables and then add the Thanks for reporting the bug, the |
Hello, I was trying to use the new functionality of PolyJuMP, but I have trouble getting anything to work.
I tried to guess how to use the module based on what the readme says and this was the my best guess
Apart from some typos in the snippets, it also fails with
So I thought, maybe the QCQP optimizer was not tested yet and tried the same with the HC using KKT.
but this fails with the same error.
So I tried switching from the PolyJuMP.SAGE to SumOfSquares
but this also fails with pretty much the same error
I tried to switching to the inline constraint set
same thing...
So, maybe I misunderstood what the package does and it only handles quadratic things without reformulations. Then I tried a sanity check, which Gurobi can handle on its own.
but that also fails
So maybe it strictly requires something non-convex, or maybe an objective function?
nope!
Ok, I'm out of ideas. Is it possible to give a minimal working example in the readme of how the package is to be used, please?
Thank you.
Versions
The text was updated successfully, but these errors were encountered: