# Warm start Mosek in a linear polynomial optimization problem

Hi,

I have a polynomial optimization which is a linear programming (DSOS programming) and I want to use Mosek with warm start. In the following, I have two optimizations “m” and “m1”. I want to use the answer of Optimization m to warm start Optimization m1.

``````using DynamicPolynomials
using SumOfSquares
using LinearAlgebra
using MosekTools
using Plots

@polyvar x[1:2]
fx=[x[2];(1-9*x[1]^2)*x[2]-x[1]]
phix=9*(x[1]^2 +x[2]^2)

m = Model(Mosek.Optimizer)
PolyJuMP.setdefault!(m, PolyJuMP.NonNegPoly, DSOSCone)
@variable m V0 Poly(monomials(x,0:2:8))
@variable m ub
LHSupper= ub- dot(gradV0, fx) - phix
con_ref=@constraint m LHSupper>=0
@objective m Min ub
optimize!(m)

Xopt=collect(gram_matrix(con_ref).Q+0.01*I(size(gram_matrix(con_ref).Q)[1]))
z1=(cholesky(Xopt).U)*gram_matrix(con_ref).basis.monomials

# Iter1

m1 = Model(Mosek.Optimizer)
set_optimizer_attribute(m1, "MSK_IPAR_OPTIMIZER",
Mosek.MSK_OPTIMIZER_FREE_SIMPLEX)
PolyJuMP.setdefault!(m1, PolyJuMP.NonNegPoly, DSOSCone)
@variable m1 V1 Poly(monomials(x,0:2:8))
@variable m1 ub1
LHSupper1= ub1- dot(gradV1, fx) - phix
con_ref1=@constraint m1 LHSupper1>=0 basis=FixedPolynomialBasis(z1)
@objective m1 Min ub1
#set_start_value(con_ref1, value(LHSupper))
#set_start_value(V1, value(V0))
set_start_value(ub1, value(ub))
optimize!(m1)
``````

I can use

``````set_start_value(ub1, value(ub))
``````

to give an initial value to one of my variables. However, I cannot initialize the other variable “V1” with the following code:

``````set_start_value(V1, value(V0))
``````

or initialize my constraint “con_ref1” with the following code:

``````set_start_value(con_ref1, value(LHSupper))
``````

Would you tell me how I can overcome this problem?

I don’t know if PolyJuMP supports warmstarting variables. @blegat will know.

PolyJuMP does not support setting starting values yet but that should be easy to add, please open an issue!