Discrete time bilinear system using sum of squares method

75 views
Skip to first unread message

Saad Hamayoon

unread,
Jun 8, 2020, 6:26:00 AM6/8/20
to YALMIP
Hello,

I am trying to solve the numerical example 1 of the following paper using YALMIP:


My implementation is as follows:

sdpvar x1 x2 gamma;
%System Matrices
A
=[1 0.01;0.01 1];B=[0.001 0;0 -0.004];b=[0.09;0.09];
P
=[1 0;0 1];x=[x1;x2];
% % =============================================
%sos polynomails
d
=2;%degree of sos functions
[c0x,c2] = polynomial([x1 x2],d);%controller denominator
[s1,c3] = polynomial([x1 x2],d);
[qx,c4] = polynomial([x1 x2],d);


[c1x,c5] = polynomial([x1 x2],d);%controller numerator
% % =============================================


%inequality constraints
alpha
=[(c0x+1)*x'*P*x-s1*(gamma-x'*P*x) 0;0 0];
beta
=[P*((c0x+1)*A*x+(B*x+b)*c1x),[0;0]];
ceta
=(c0x+1)*P;


G1
=[alpha beta;beta' ceta]; %equation 12 of the paper
G2=[(c0x+1)*4-qx*(gamma-x'
*P*x) c1x;c1x (c0x+1)]; %equation 16 of the paper


% % =============================================
%System Model
Model = [G1>=0 , G2>=0 , -2<=c1x/(c0x+1)<=2 , sos(c0x) , sos(qx) , sos(s1)];
solvesos
(Model,[],[],[c2;c3;c4;c5])
coeff
= value(c2);
coeff1
= value(c5);
value
(gamma)


However, I am getting the following error for solvesos command:

Error using compilesos (line 170)
No independent variables? Perhaps you added a constraint (p(x)) when you meant (sos(p(x))). It could also be that you added a
constraint directly
in the independents, such as p(x)>=0 or similarily.

When I change the constraint G1 and G2>=0 to sos(G1) and sos(G2) then I get the solution but its "NaN".

The goal is to find the controller which maximizes the region of convergence i.e. gamma. Can you please help in setting up the problem correctly using YALMIP.

Regards,

Saad

Johan Löfberg

unread,
Jun 8, 2020, 7:24:41 AM6/8/20
to YALMIP
All variables that are outside sos operators are assumed to be parametric variables

G1 and G2 involve x, hence x is declared parametric, and thus you have no variables over which you perform the sos

This
-2<=c1x/(c0x+1)<=2

is a nasty fractional nonlinear constraint. To begin with it has to non-rationalized

-2*(c0x+1)<=c1x <=2*(c0x+1)

and then those conditions have to be replaced with sos

Same with G1 and G2. Somehow you want to get an SOS from those. However, the tuff you have make no sense. alpha has a zero (2,2) diagonal, so why both with a 33 matrix which by construction is singular. You can just as well work with [(c0x+1)*x'*P*x-s1*(gamma-x'*P*x)   P*((c0x+1)*A*x+(B*x+b)*c1x); P*((c0x+1)*A*x+(B*x+b)*c1x) ceta]. I guess you mean you want that matrix to be matrix-sos However, you will not be able to solve this, as you have products between parametric variables (P and parameters in qx etc).

There is a lot more to solving this than simply stating the equations. Without a pretty detailed heuristic approach to attack this, you will not be able to solve this as it leads to a nonconvex SDP for which there are no solvers

Johan Löfberg

unread,
Jun 8, 2020, 7:33:06 AM6/8/20
to YALMIP
noticed now P is constant, then those matrix-sos would be linear and fine I guess (for *fixed gamma* as clearly stated in the paper)

Saad Hamayoon

unread,
Jun 8, 2020, 8:33:03 AM6/8/20
to YALMIP
Thank you for the prompt and detailed response. Simply working with this  [(c0x+1)*x'*P*x-s1*(gamma-x'*P*x)   P*((c0x+1)*A*x+(B*x+b)*c1x); P*((c0x+1)*A*x+(B*x+b)*c1x) ceta] was resulting in error "All matrices on a row in the bracketed expression must have the same number of rows". However, I understand your point and have realized I had to fix gamma as well.

Johan Löfberg

unread,
Jun 8, 2020, 8:47:22 AM6/8/20
to YALMIP
No problems concatenating as in paper

>> [(c0x+1)*x'*P*x-s1*(gamma-x'*P*x) (P*((c0x+1)*A*x+(B*x+b)*c1x))';P*((c0x+1)*A*x+(B*x+b)*c1x) (c0x+1)*P]
Polynomial matrix variable 3x3 (symmetric, real, 21 variables)
Coeffiecient range: 0.001 to 1

(I didn't mean 2x2, I mean 2x2 blocks)

Saad Hamayoon

unread,
Jun 8, 2020, 8:57:40 AM6/8/20
to YALMIP
Yes, correct. Actually, I was receiving the error because of putting the transposed term at 2 x 1 instead of 1 x 2.
Reply all
Reply to author
Forward
0 new messages