sdpvar x1 x2 e1 e2
u = 4*(x1+e1)-4*(x2+e2)-4.5*(x1+e1)^2-1.5*(x1+e1)^3;f = [-x2-1.5*x1^2-.3*x1^3;u]
[alpha,ai] = polynomial([x1;x2],4);[gamma,gi] = polynomial([e1;e2],4);solvesos([sos(alpha),sos(gamma),sos(-alpha+gamma-(x1*f(1) + f(2)-3*f(1)))],[],[],[ai;gi]);sdisplay(replace(alpha,ai,value(ai)))sdisplay(replace(gamma,gi,value(gi)))The answer is:
options =
solver: 'sdpt3-3.02'
verbose: 1
debug: 0
usex0: 0
warning: 1
cachesolvers: 0
showprogress: 0
saveduals: 1
removeequalities: 0
savesolveroutput: 0
savesolverinput: 0
saveyalmipmodel: 0
convertconvexquad: 1
radius: Inf
relax: 0
dualize: 0
savedebug: 0
expand: 1
allowmilp: 1
allownonconvex: 1
shift: 0
dimacs: 0
beeponproblem: [-5 -4 -3 -2 -1]
bilevel: [1x1 struct]
bmibnb: [1x1 struct]
bnb: [1x1 struct]
cutsdp: [1x1 struct]
kkt: [1x1 struct]
moment: [1x1 struct]
mp: [1x1 struct]
mpcvx: [1x1 struct]
plot: [1x1 struct]
robust: [1x1 struct]
sos: [1x1 struct]
baron: []
bintprog: [1x1 struct]
bonmin: []
cdd: [1x1 struct]
cbc: [1x1 struct]
clp: [1x1 struct]
cplex: [1x1 struct]
csdp: [1x1 struct]
dsdp: [1x1 struct]
ecos: [1x1 struct]
filtersd: [1x1 struct]
fmincon: [1x1 struct]
fminsearch: [1x1 struct]
frlib: [1x1 struct]
glpk: [1x1 struct]
gurobi: [1x1 struct]
ipopt: [1x1 struct]
intlinprog: []
knitro: [1x1 struct]
linprog: [1x1 struct]
lmilab: [1x1 struct]
lmirank: [1x1 struct]
logdetppa: [1x1 struct]
lpsolve: [1x1 struct]
lsqnonneg: [1x1 struct]
lsqlin: [1x1 struct]
kypd: [1x1 struct]
nag: [1x1 struct]
mosek: [1x1 struct]
nomad: []
ooqp: []
penbmi: [1x1 struct]
penlab: []
pensdp: [1x1 struct]
qpoases: []
qsopt: [1x1 struct]
quadprog: [1x1 struct]
quadprogbb: [1x1 struct]
scip: []
scs: [1x1 struct]
sdpa: [1x1 struct]
sdplr: [1x1 struct]
sdpt3: [1x1 struct]
sdpnal: [1x1 struct]
sedumi: [1x1 struct]
sparsepop: [1x1 struct]
sparsecolo: [1x1 struct]
vsdp: [1x1 struct]
xpress: []
-------------------------------------------------------------------------
YALMIP SOS module started...
-------------------------------------------------------------------------
Detected 9 parametric variables and 2 independent variables.
Detected 0 linear inequalities, 0 equality constraints and 1 LMIs.
Using image representation (options.sos.model=2). Nonlinear parameterization found
Initially 7 monomials in R^2
Newton polytope (1 LPs).........Keeping 4 monomials (0.3432sec)
Finding symmetries..............Found no symmetries (0.0312sec)
sol =
solvertime: 0
info: 'No suitable solver'
problem: -2
yalmiptime: 2.1210
v =
[]
Q =
[]
ans =
NaN NaN NaN
NaN NaN NaN
NaN NaN NaN
ans =
NaN NaN NaN
2.
And the code you sent me:
sdpvar x1 x2 e1 e2
u = 4*(x1+e1)-4*(x2+e2)-4.5*(x1+e1)^2-1.5*(x1+e1)^3;
f = [-x2-1.5*x1^2-.3*x1^3;u]
[alpha,ai] = polynomial([x1;x2],4);
[gamma,gi] = polynomial([e1;e2],4);
solvesos([sos(alpha),sos(gamma),sos(-alpha+gamma-(x1*f(1) + f(2)-3*f(1)))],[],[],[ai;gi]);
sdisplay(replace(alpha,ai,value(ai)))
sdisplay(replace(gamma,gi,value(gi)))
The answer is:
Polynomial matrix variable 2x1 (full, real, 4 variables)
-------------------------------------------------------------------------
YALMIP SOS module started...
-------------------------------------------------------------------------
Detected 30 parametric variables and 4 independent variables.
Detected 0 linear inequalities, 0 equality constraints and 0 LMIs.
Using kernel representation (options.sos.model=1).
Initially 6 monomials in R^2
Newton polytope (0 LPs).........Keeping 6 monomials (0sec)
Finding symmetries..............Found no symmetries (0sec)
Initially 15 monomials in R^4
Newton polytope (4 LPs).........Keeping 15 monomials (0.093601sec)
Finding symmetries..............Found no symmetries (0sec)
*******************************************************************
Infeasible path-following algorithms
*******************************************************************
version predcorr gam expon scale_data
HKM 1 0.000 1 0
it pstep dstep p_infeas d_infeas gap obj cputime
-------------------------------------------------------------------
0 0.000 0.000 1.8e+001 1.7e+001 1.1e+003 0.000000e+000
0
0
Answer is:
sol =
yalmiptime: NaN
solvertime: NaN
info: 'Unknown problem in solver (try using 'debug'-flag in sdpsettings) (Reference to non-existent field 'barx'.)'
problem: 9
v =
[]
Q =
[]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
Running the codes:
clc
clear all
x1 = sdpvar(1,1);x2 = sdpvar(1,1);
x=[x1;x2];
z = [x1;x2;x1^2]
K = sdpvar(1,3);
P = sdpvar(3,3);
V = z'*P*z
u = K*z;
f = [-1.5*x1^2-0.5*x1^3-x2;u];
Vdot = jacobian(V,x)*f;
F = (P>0) + (-25<K<25);
F = F + (sos(-Vdot));
options = sdpsettings('solver','sdpt3-4','sos.model',2,'sos.newton',1,'sos.congruence',0)
[sol,v,Q] = solvesos(F,[],options)
double(P)
double(K)
The answer is:
-------------------------------------------------------------------------
YALMIP SOS module started...
-------------------------------------------------------------------------
Detected 9 parametric variables and 2 independent variables.
Detected 0 linear inequalities, 0 equality constraints and 1 LMIs.
Initially 7 monomials in R^2
Newton polytope (1 LPs).........Keeping 4 monomials (0.093601sec)
sol =
solvertime: 0
info: 'Solver not applicable (sdpt3-4)'
problem: -4
yalmiptime: 1.9490
v =
[]
Q =
[]
ans =
NaN NaN NaN
NaN NaN NaN
NaN NaN NaN
ans =
NaN NaN NaN
%%%%%%%%%%%%
Running the codes:
sdpvar x1 x2 e1 e2
u = 4*(x1+e1)-4*(x2+e2)-4.5*(x1+e1)^2-1.5*(x1+e1)^3;
f = [-x2-1.5*x1^2-.3*x1^3;u]
[alpha,ai] = polynomial([x1;x2],4);
[gamma,gi] = polynomial([e1;e2],4);
options = sdpsettings('solver','sdpt3-4','sos.model',1,'sos.newton',1,'sos.congruence',0)
[sol,v,Q]=solvesos([sos(alpha),sos(gamma),sos(-alpha+gamma-(x1*f(1) + f(2)-3*f(1)))],[],[],[ai;gi]);
sdisplay(replace(alpha,ai,value(ai)))
sdisplay(replace(gamma,gi,value(gi)))
Q
v
double(gamma)
double(alpha)
the answer is:
Basic solution
Problem status : PRIMAL_INFEASIBLE
Solution status : PRIMAL_INFEASIBLE_CER
Primal - objective: 0.0000000000e+000 eq. inf.: 0.00e+000 max bound inf.: 0.00e+000
Dual - objective: 1.0288177305e+006 eq. inf.: 0.00e+000 max bound inf.: 0.00e+000
Optimizer summary
Optimizer - time: 0.25
Interior-point - iterations : 0 time: 0.08
Basis identification - time: 0.00
Primal - iterations : 0 time: 0.00
Dual - iterations : 0 time: 0.00
Clean primal - iterations : 0 time: 0.00
Clean dual - iterations : 0 time: 0.00
Clean primal-dual - iterations : 0 time: 0.00
Simplex - time: 0.00
Primal simplex - iterations : 0 time: 0.00
Dual simplex - iterations : 0 time: 0.00
Primal-dual simplex - iterations : 0 time: 0.00
Mixed integer - relaxations: 0 time: 0.00
0
0
Q =
[]
v =
[]
ans =
NaN
ans =
NaN