Multivariate polynomial in YALMIP

141 views
Skip to first unread message

Adkitta

unread,
Mar 6, 2013, 11:37:22 PM3/6/13
to yal...@googlegroups.com
Dear Prof. Löfberg,

I am trying to define a polynomial optimization problem in YALMIP (using sparsePOP/SeDuMi). 

My first question is a clarification on how to define a multivariate polynomial. For example, I have my vector variable

n=50;
x=sdpvar(n,1);

Now, I want to define constraints which are function of x(1)^3, x(2)^3 and so on. This I define by defining p=x.^3. A sample constraint would be p'Qp where Q is square matrix. I am not sure if this is the right way to proceed speacially if I want to maintain the sparse nature of the problem (Q in this case). Lot of examples on the website deal with only univariate polynomials. I see that there is a polynomial function but not sure how it to use it in this case here. 

And my second question was in way sparsePOP is interfaced with YALMIP. If one has a sparse objective e.g., defined as a summation involving only a few terms of x, how does one define it in YALMIP? It looks to me that the callsparsepop.m does not take this into account.

Thank you.

Johan Löfberg

unread,
Mar 7, 2013, 2:14:56 AM3/7/13
to yal...@googlegroups.com
I don't see wherein your problem lies. You define sparse polynomials just as you would define any polynomial. If the polynomial is sparse, well, so be it.

For example, this is a quartic polynomial in R^50 with only 148 monomials, i.e., very sparse
x=sdpvar(50,1);
f
=sum(x.^4)+sum((x(1:49).*x(2:50)-1).^2)

Regarding sparsepop, I don't understand why you think YALMIP does not send a sparse polynomial to sparsepop. For instance, line 38-42 in callsparsepop sets up a structure with the sparse support required by sparsepop.

Adkitta

unread,
Mar 7, 2013, 5:03:38 PM3/7/13
to yal...@googlegroups.com
Thank you for the clarification on the first point.

Regarding the second point, I should have been clearer. If the objective is expressed as summation of sparse polynomials (e.g. multidimensional Rosenbrock function shown in sparsepop manual), is there a way to express the polynomial without expanding it in terms of x in R^n?. Sparsepop allows to define the supports for the objective function in a for loop. I was wondering if there is way for to do this in YALMIP interface for sparsepop.

Johan Löfberg

unread,
Mar 8, 2013, 2:26:31 AM3/8/13
to yal...@googlegroups.com
Are you talking about the specialized code they have for *defining* least-squares type of problems, i.e. Rosenbrock vs RosenbrockLS.

If so, it has no use if you use YALMIP. The LS version in sparsePOP is just syntactic sugar to avoid manually expanding the squares when defining the numerical data defining the problems (the vectors of monomial support and coefficients). Inside, they expand the polynomial anyway

You can see this if you run the following code. It shows exactly the same diagnostics (SDP solved by SeDuMi) on all models

param.relaxOrder = 2;
sparsePOP('RosenbrockLS(100)',param);

sparsePOP('Rosenbrock(100)',param);

x = sdpvar(100,1);
f = 1 + sum(100*(x(2:end)-x(1:end-1).^2).^2 + (1-x(2:end)).^2);
solvesdp([],f,sdpsettings('solver','sparsepop'))

Adkitta

unread,
Mar 8, 2013, 9:54:45 PM3/8/13
to yal...@googlegroups.com
Yes, my question was about defining the problem in YALMIP. This make complete sense now. Thank you for the example.
Reply all
Reply to author
Forward
0 new messages