@@ -41,13 +41,13 @@ CachingOptimizer state: NO_OPTIMIZER
4141Solver name: No optimizer attached.
4242
4343julia> @variable(model, p, Poly(X))
44- (_[1]) + (_[2])x₃ + (_[3])x₂ + (_[4])x₁ + (_[5])x₃² + (_[6])x₂x₃ + (_[7])x₂² + (_[8])x₁x₃ + (_[9])x₁x₂ + (_[10])x₁²
44+ (_[1])·1 + (_[2])· x₃ + (_[3])· x₂ + (_[4])· x₁ + (_[5])· x₃² + (_[6])· x₂x₃ + (_[7])· x₂² + (_[8])· x₁x₃ + (_[9])· x₁x₂ + (_[10])· x₁²
4545
4646julia> @variable(model, q, Poly(X))
47- (_[11]) + (_[12])x₃ + (_[13])x₂ + (_[14])x₁ + (_[15])x₃² + (_[16])x₂x₃ + (_[17])x₂² + (_[18])x₁x₃ + (_[19])x₁x₂ + (_[20])x₁²
47+ (_[11])·1 + (_[12])· x₃ + (_[13])· x₂ + (_[14])· x₁ + (_[15])· x₃² + (_[16])· x₂x₃ + (_[17])· x₂² + (_[18])· x₁x₃ + (_[19])· x₁x₂ + (_[20])· x₁²
4848
4949julia> @constraint(model, p + q == 1)
50- (_[1] + _[11] - 1) + (_[2] + _[12])x₃ + (_[3] + _[13])x₂ + (_[4] + _[14])x₁ + (_[5] + _[15])x₃² + (_[6] + _[16])x₂x₃ + (_[7] + _[17])x₂² + (_[8] + _[18])x₁x₃ + (_[9] + _[19])x₁x₂ + (_[10] + _[20])x₁² ∈ PolyJuMP.ZeroPoly()
50+ (_[1] + _[11] - 1)·1 + (_[2] + _[12])· x₃ + (_[3] + _[13])· x₂ + (_[4] + _[14])· x₁ + (_[5] + _[15])· x₃² + (_[6] + _[16])· x₂x₃ + (_[7] + _[17])· x₂² + (_[8] + _[18])· x₁x₃ + (_[9] + _[19])· x₁x₂ + (_[10] + _[20])· x₁² ∈ PolyJuMP.ZeroPoly()
5151```
5252
5353Vectorized constraints can also be used as well as vector of constraints,
@@ -66,7 +66,7 @@ Polynomials can be constrained to be sum-of-squares with the `in` syntax.
6666For instance, to constrain a polynomial ` p ` to be sum-of-squares, do
6767``` jldoctest constraint-pq
6868julia> @constraint(model, p in SOSCone())
69- (_[1]) + (_[2])x₃ + (_[3])x₂ + (_[4])x₁ + (_[5])x₃² + (_[6])x₂x₃ + (_[7])x₂² + (_[8])x₁x₃ + (_[9])x₁x₂ + (_[10])x₁² is SOS
69+ (_[1])·1 + (_[2])· x₃ + (_[3])· x₂ + (_[4])· x₁ + (_[5])· x₃² + (_[6])· x₂x₃ + (_[7])· x₂² + (_[8])· x₁x₃ + (_[9])· x₁x₂ + (_[10])· x₁² is SOS
7070```
7171
7272### Automatically interpreting polynomial nonnegativity as a sum-of-squares constraint
@@ -147,13 +147,13 @@ julia> @variable(model, β)
147147β
148148
149149julia> @constraint(model, α * x^2 + β * y^2 ≥ (α - β) * x * y)
150- (β)y² + (-α + β)xy + (α)x² is SOS
150+ (β)· y² + (-α + β)· xy + (α)· x² is SOS
151151```
152152where ` α ` and ` β ` are JuMP decision variables and ` x ` and ` y ` are polynomial
153153variables. Since the polynomial is a quadratic form, the sum-of-squares
154154certificate is also a quadratic form (see [ Blekherman2012; Section~ 3.3.4] ( @cite ) ). Hence the
155155default polynomial basis used for the [ Nonnegative polynomial variables]
156- certificate is ` MonomialBasis ([x, y])` , that is, we search for a positive
156+ certificate is ` MultivariateBases.SubBasis{MultivariateBases.Monomial} ([x, y])` , that is, we search for a positive
157157semidefinite matrix ` Q ` such that
158158``` math
159159\alpha x^2 + \beta y^2 - (\alpha - \beta) x y = X^\top Q X
@@ -164,16 +164,16 @@ As the polynomial space is determined by the polynomial being constrained,
164164only the basis * type* needs to be given. For instance, to use the scaled monomial
165165basis in the example above, use
166166``` jldoctest constraint-xy
167- julia> @constraint(model, α * x^2 + β * y^2 ≥ (α - β) * x * y, basis = ScaledMonomialBasis )
168- (β)y² + (-α + β)xy + (α)x² is SOS
167+ julia> @constraint(model, α * x^2 + β * y^2 ≥ (α - β) * x * y, basis = ScaledMonomial )
168+ (β)·ScaledMonomial(y²) + (-0.7071067811865475 α + 0.7071067811865475 β)·ScaledMonomial(xy) + (α)·ScaledMonomial(x²) is SOS
169169```
170170
171171## Polynomial nonnegativity on a subset of the space
172172
173173By default, the constraint
174174``` jldoctest constraint-xy
175175julia> @constraint(model, x^3 - x^2 + 2x*y -y^2 + y^3 >= α)
176- (-α) + (-1)y² + (2)xy + (-1)x² + (1)y³ + (1)x³ is SOS
176+ (-α)·1 + (-1)· y² + (2)· xy + (-1)· x² + (1)· y³ + (1)· x³ is SOS
177177```
178178constrains the polynomial to be nonnegative for every real numbers ` x ` and ` y ` .
179179However, the set of points ` (x, y) ` for which the polynomial is constrained
@@ -182,7 +182,7 @@ to be nonnegative can be specified by the `domain` keyword:
182182julia> S = @set x >= 0 && y >= 0 && x + y >= 1;
183183
184184julia> @constraint(model, x^3 - x^2 + 2x*y -y^2 + y^3 >= α, domain = S)
185- (-α) + (-1)y² + (2)xy + (-1)x² + (1)y³ + (1)x³ is SOS
185+ (-α)·1 + (-1)· y² + (2)· xy + (-1)· x² + (1)· y³ + (1)· x³ is SOS
186186```
187187See [ this notebook] ( https://github.com/jump-dev/SumOfSquares.jl/blob/master/examples/Polynomial_Optimization.ipynb )
188188for a detailed example.
0 commit comments