You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-18Lines changed: 37 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,24 +25,12 @@ Pkg.add("PolyJuMP")
25
25
26
26
## Use with JuMP
27
27
28
-
To use QCQP solver with JuMP, use a nonconvex QCQP solver, e.g., `Gurobi.Optimizer` and `PolyJuMP.QCQP.Optimizer`:
28
+
### Polynomial nonnegativity constraints
29
29
30
-
```julia
31
-
using JuMP, PolyJuMP, Gurobi
32
-
model =Model(() -> PolyJuMP.QCQP.Optimizer(Gurobi.Optimizer))
33
-
```
34
-
35
-
To use KKT solver with JuMP, use solver of algebraic systems of equations implementing the [SemialgebraicSets interface](https://github.com/JuliaAlgebra/SemialgebraicSets.jl), e.g., `HomotopyContinuation.SemialgebraicSetsHCSolver` and `PolyJuMP.KKT.Optimizer`:
For a nonnegativity constraint on a polynomial, e.g.,
30
+
`PolyJuMP` allows encoding a constraint that a polynomial should be nonnegative for all values of some
31
+
symbolic variables defined with `DynamicPolynomials.@polyvar` or `TypedPolynomials.@polyvar` as follows.
32
+
For instance, the following constrains the JuMP decision variable `a` to be such that
33
+
`a * x * y^2 + y^3 - a * x` is nonnegative for all real values of `x` and `y`:
46
34
```julia
47
35
using DynamicPolynomials
48
36
@polyvar x y
@@ -51,7 +39,10 @@ model = Model()
51
39
@variable(model, a)
52
40
@constraint(model, a * x * y^2+ y^3>= a * x)
53
41
```
54
-
you need to specify how to interpret this nonnegativity constraint. To use Sum-of-Arithmetic-Geometric-Exponentials (SAGE), use
42
+
Determining the nonnegativity of a multivariate polynomial is however NP-hard so sufficient conditions
43
+
are used instead.
44
+
You need to specify which sufficient condition is used explicitly.
45
+
To use Sum-of-Arithmetic-Geometric-Exponentials (SAGE), use
55
46
```julia
56
47
import PolyJuMP
57
48
PolyJuMP.setpolymodule!(model, PolyJuMP.SAGE)
@@ -70,6 +61,34 @@ Alternatively, the nonnegativity constraint can be explicit:
70
61
```
71
62
This allows mixing SAGE and SOS constraints in the same model.
72
63
64
+
### Polynomial optimization
65
+
66
+
PolyJuMP also allows solving polynomial optimization problems using the `QCQP` and `KKT` solvers.
67
+
Polynomial optimization problems do not involve any symbolic variables from DynamicPolynomials or TypedPolynomials,
68
+
instead all variables are JuMP decision variables.
69
+
70
+
The `QCQP` solver is parametrized by a nonconvex QCQP inner solver.
71
+
It reformulates the polynomial optimization problem into a nonconvex `QCQP`
72
+
and relies on the inner solver to solve it.
73
+
For instance, to use the `QCQP` solver with JuMP with `Gurobi.Optimizer` as inner solver, use:
74
+
```julia
75
+
using JuMP, PolyJuMP, Gurobi
76
+
model =Model(() -> PolyJuMP.QCQP.Optimizer(Gurobi.Optimizer))
77
+
```
78
+
79
+
The `KKT` solver is parametrized by an inner solver of algebraic systems of equations implementing the [SemialgebraicSets interface](https://github.com/JuliaAlgebra/SemialgebraicSets.jl).
80
+
It reformulates the polynomial optimization problem into a system of polynomial equations
81
+
and relies on the inner solver to solve it.
82
+
For instance, to use the `QCQP` solver with JuMP with
83
+
`HomotopyContinuation.SemialgebraicSetsHCSolver` as inner solver, use:
0 commit comments