Non-linear semi-definite programming using Yalmip

186 views
Skip to first unread message

Himanshu Nagpal

unread,
Mar 20, 2017, 1:43:20 PM3/20/17
to YALMIP
Hello Johan,

I asked you previously about how to handle asymmetric constraint in Robust optimization ( https://groups.google.com/forum/#!topic/yalmip/d8l25LyZ_Nk ). Well, I found a paper which explains that I can find an invariant polytope which can handle asymmetric constraints. 

I am using Algorithm 4.1 (page 346) in the attached paper to find the invariant polytope, which is a non-linear semi-definite program but I am not able to solve it using the standard solvers like SeDumi and Mosek. I tried to download PENLAB also but their webpage is not responding.  Is their any other way to handle such non-linearity in YALMIP?

Below is my code which gives an output that 'SeDumi/Mosek is not applicable'.

clc
close all
clear all

%%%% System matrices
A = [1.540, -1.067;
     -1.067 -0.485];
B = [0.390, 0.088]';
F = [3.932, -2.025];
phi = (A-B*F);
[W,D] = eig(phi);
V = inv(W);
n = size(A,2);
umin = 1;
umax = 2;

%%% Define the polytope 
x = sdpvar(n,1);
alpha1 = sdpvar(n,1);
alpha2 = sdpvar(n,1);
G = [V, -V]'; 
alpha = [alpha2, alpha1]';
z = G*x;

%%% Offline compuation of Invariant Set
D = V*phi*W;
F_tilda = F*W;
F_tildaplus = max(F_tilda,0);
F_tildaminus = min(F_tilda,0);
D_plus = max(D,0);
D_minus = min(D,0);
Pf = [F_tildaplus, -F_tildaminus;
     -F_tildaminus, F_tildaplus];
Pi = [D_plus - eye(size(D_plus)), -D_minus;
       -D_minus, D_plus - eye(size(D_plus))];
pf = [umin, umax]';
P = [Pf; Pi];
p = [pf; zeros(2*n,1)];

%%% Optimization to find alpha
% obj = 0;
% cvx_begin sdp
%     variable x(n,1)
%     z = G*x;
%     for i = 1 : length(z)
%         obj = obj + log(z(i));
%     end
%     maximize(obj)
%     subject to
%         z >= 0
%         P*z <= p
% %     cvx_solver SeDuMi
% cvx_end

objective = -log(prod(z));
constraints = [z >=0, P*z <= p];

ops = sdpsettings('solver','SeDumi');
diagnostics = optimize(constraints, objective,ops);



Thank you,

Himanshu

Kouvaritakis_et_al-2004-International_Journal_of_Robust_and_Nonlinear_Control.pdf

Johan Löfberg

unread,
Mar 20, 2017, 1:54:44 PM3/20/17
to YALMIP
If you absolutely must an SDP solver (which is overkill), you write the objective as -sum(log(z)) = -log(det(diag(z))

diagnostics = optimize(constraints,-logdet(diag(z)))

and yalmip will automatically convert it to a suitable socp/sdp problem to model the geometric mean model of the logdet...Massive overkill though, could just as well solve it as the convex nonlinear elementwise problem it is, using e.g. fmincon

diagnostics = optimize(constraints,-sum(log(z)))

What ever you do though, you will get z=0 though as the only feasible point is z=0

[~,L,U] = boundingbox(constraints)







Reply all
Reply to author
Forward
0 new messages