Recover coefficients of polynomial variable

70 views
Skip to first unread message

Marcio

unread,
Oct 23, 2015, 11:59:14 AM10/23/15
to YALMIP
Hello everyone,

I am having some problems to recover the coefficients of a polynomial variable in my optimization problem.
I have three polynomials with coefficients c, cg and cw. F are my constraints.

When I solve the problem as 

sol = optimize(F,[],sdpsettings('verbose',0,'solver','sedumi'),[c;cw]);

I can recover c and cw. However, when I try
 
sol = optimize(F,[],sdpsettings('verbose',0,'solver','sedumi'),[c;cg;cw]);

I have this message
Warning: Solver not applicable (sedumi)

The simplified code is attached. Someone has some idea of how to solve this problem? 
I wanna recover the coefficients cg.
Thank you. 
yalmip_question.m

Johan Löfberg

unread,
Oct 23, 2015, 1:16:23 PM10/23/15
to YALMIP
w*(1-g) is nonlinear in the coefficients cw and cg, hence it leads to a nonconvex SDP in parameters cw and cg. When you forget one of them, it is linear in the other parameters, but everything is wrong of course as you then try to perform sos in x and the forgotten parameters

Marcio

unread,
Oct 23, 2015, 1:23:03 PM10/23/15
to YALMIP
Do you mean that a different problem was solved when setting just [c;cg] in the optimize function?
So, the problem should be infeasible in the first problem as well?

Johan Löfberg

unread,
Oct 23, 2015, 2:03:12 PM10/23/15
to YALMIP
"just [c;cg]" I guess you mean [c;cw]

The first problem should be infeasible as it is linear in cg and thus cannot be SOS in [x;cg]

In am surprised YALMIP lets this through though. It appears that you are trying to do SOS programming on an expression involving norms. That should not work, as it is not polynomial

Johan Löfberg

unread,
Oct 23, 2015, 2:04:57 PM10/23/15
to YALMIP
Ok, now I see that the norms only involve parametric variables, so that's fine.

Marcio

unread,
Oct 23, 2015, 2:08:19 PM10/23/15
to YALMIP
Yes, you are right I mean [c;cw].

Yes it works if I give the polynomial g with known coefficients.
I was trying a way to solve the problem with a generic polynomial g. 
Anyway, I see the problem. Thank you.

Johan Löfberg

unread,
Oct 23, 2015, 2:11:43 PM10/23/15
to YALMIP
It is feasible, here is a solution using a global solver

>> sol = optimize([F,-100 <= [c;cw;cg] <= 100],[],sdpsettings('verbose',1,'solver','bmibnb','bmibnb.upper','none'),[c;cw;cg])
-------------------------------------------------------------------------
YALMIP SOS module started...
-------------------------------------------------------------------------
Detected 115 parametric variables and 1 independent variables.
Detected 0 linear inequalities, 0 equality constraints and 0 LMIs.
Using image representation (options.sos.model=2). Nonlinear parameterization found
Initially 2 monomials in R^1
Newton polytope (0 LPs).........Keeping 2 monomials (0sec)
Finding symmetries..............Found no symmetries (0sec)
Initially 4 monomials in R^1
Newton polytope (0 LPs).........Keeping 4 monomials (0sec)
Finding symmetries..............Found no symmetries (0sec)
Initially 5 monomials in R^1
Newton polytope (0 LPs).........Keeping 5 monomials (0sec)
Finding symmetries..............Found no symmetries (0sec)
 
* Starting YALMIP global branch & bound.
* Branch-variables : 10
* Upper solver     : none
* Lower solver     : SDPT3
* LP solver        : GUROBI
 Node       Upper      Gap(%)       Lower    Open
    1 :          Inf      NaN      0.000E+00   2  Numerical problems in lower bound solver  
    2 :          Inf      NaN      0.000E+00   3  Numerical problems in lower bound solver  
    3 :          Inf      NaN      0.000E+00   4  Numerical problems in lower bound solver  
    4 :          Inf      NaN      0.000E+00   5  Numerical problems in lower bound solver  
    5 :          Inf      NaN      0.000E+00   4  Infeasible  
    6 :          Inf      NaN      0.000E+00   5  Numerical problems in lower bound solver  
    7 :          Inf      NaN      0.000E+00   4  Infeasible  
    8 :          Inf      NaN      0.000E+00   5  Numerical problems in lower bound solver  
    9 :          Inf      NaN      0.000E+00   4  Infeasible  
   10 :          Inf      NaN      0.000E+00   5  Numerical problems in lower bound solver  
   11 :          Inf      NaN      0.000E+00   4  Infeasible  
   12 :    0.000E+00     0.00     -1.000E-10   5  Numerical problems in lower bound solver | Improved solution  
* Finished.  Cost: 0 Gap: 1e-08
* Timing: 0% spent in upper solver (0 problems solved)
*         33% spent in lower solver (32 problems solved)
*         13% spent in LP-based domain reduction (2728 problems solved)

sol = 

    yalmiptime: 1.0430
    solvertime: 56.6000
          info: 'Successfully solved (BMIBNB)'
       problem: 0

>> value(c)

ans =

    0.0000
    0.0000
   55.0732
   -1.4548

>> value(cg)

ans =

   -2.5367
    4.9022
   -1.9647

>> value(cw)

ans =

   20.9232
    0.8694
   11.5864
    0.6389
   11.3103
    0.8951
   19.9451



Marcio

unread,
Oct 23, 2015, 3:17:01 PM10/23/15
to YALMIP
Great!

I tried to solve and I had this. Do I need a specific solver?
 I guess that is the problem.


-------------------------------------------------------------------------
YALMIP SOS module started...
-------------------------------------------------------------------------
Detected 115 parametric variables and 1 independent variables.
Detected 0 linear inequalities, 0 equality constraints and 0 LMIs.
Using image representation (options.sos.model=2). Nonlinear parameterization found
Initially 2 monomials in R^1
Newton polytope (0 LPs).........Keeping 2 monomials (0sec)
Finding symmetries..............Found no symmetries (0sec)
Initially 4 monomials in R^1
Newton polytope (0 LPs).........Keeping 4 monomials (0sec)
Finding symmetries..............Found no symmetries (0sec)
Initially 5 monomials in R^1
Newton polytope (0 LPs).........Keeping 5 monomials (0.03125sec)
Finding symmetries..............Found no symmetries (0sec)
 
* Starting YALMIP global branch & bound.
* Branch-variables : 10
* Upper solver     : none
* Lower solver     : SeDuMi
* LP solver        : LINPROG
 Node       Upper      Gap(%)       Lower    Open
    1 :          Inf      NaN      0.000E+00   2  Numerical problems in lower bound solver  
    2 :          Inf      NaN      0.000E+00   3  Numerical problems in lower bound solver  
    3 :          Inf      NaN      0.000E+00   4  Numerical problems in lower bound solver  

sol = 

    yalmiptime: NaN
    solvertime: NaN
          info: 'Unknown problem in solver (Turn on 'debug' in sdpsettings) (Error using builtin
Complex cas...'
       problem: 9

Johan Löfberg

unread,
Oct 23, 2015, 3:28:21 PM10/23/15
to YALMIP
sedumi doesn't seem to like the lower bond problems here. try sdpt3 instead (and install a real lp solver, you currently only have linprog)
Reply all
Reply to author
Forward
0 new messages