Error using filter_eliminatation - Cannot get rid of nonlinear uncertainty in uncertain constraint

226 views
Skip to first unread message

Marc Wijnand

unread,
May 15, 2015, 12:02:35 PM5/15/15
to yal...@googlegroups.com
I obtained following error message:
Error using filter_eliminatation (line 15)
Cannot get rid of nonlinear uncertainty in uncertain constraint

Error in robustify (line 141)
[UncertainModel.F_xw,F_elimination] = filter_eliminatation(UncertainModel.F_xw,w,1,ops);

Error in solverobust (line 64)
[F,h,failure] = robustify(varargin{:});

Error in solvesdp (line 177)
        diagnostic
= solverobust(F(find(~unc_declarations)),h,options,recover(getvariables(sdpvar(F(find(unc_declarations))))));

Error in optimize (line 31)
varargout
{:} = solvesdp(varargin{:});

This is a sketch (for copyright reasons) of the code that produced it:
vvect=sdpvar(nu,N);
xvect=sdpvar(nx,N+1);
constraints=[];
objective=0;
constraints=[constraints, xvect(:,1)==xnom0];
w=sdpvar(2,1); %for Minkowski difference
ww=sdpvar; %for Minkowski difference
for i=1:N
    constraints=[constraints, ismember(xvect(:,i+1)+w,X), uncertain(w),ismember(w,X), ...];
end
for i=1:N
    objective= objective + xvect(:,i)'*Q*xvect(:,i) + R*(vvect(i))^2;
end
objective = objective + xvect(:,N+1)'*P*xvect(:,N+1)
optimize(constraints,objective);

I would like to ask if someone can tell me the meaning of this error message. If needed, I will provide a MWE.

Johan Löfberg

unread,
May 15, 2015, 2:31:59 PM5/15/15
to yal...@googlegroups.com
What is X? Unless it is a polytope, YALMIP will not be able to derive a robust counterpart (and ismember only returns a simple enough set for robust optimization if X is a polytope)

MWE is always recommended

Marc Wijnand

unread,
May 18, 2015, 5:05:58 AM5/18/15
to yal...@googlegroups.com
Yes, X is a polytope. The code implements a tube MPC algorithm.

Here is a MWE. I found that commenting out the 'Section *' part, this error message does not appear. However, Yalmip tells me 'Run into numerical problems' and 'Failed: no sensible solution/direction found'.
close all
clear all
clc
%preliminaries
A=[1 1;0 1]; B=[0.5;1];
f=@(x,u) A*x+B*u;
K=[-0.4345 -1.0285];
N=6;
Q=eye(2); R=1;
P=[4.7342 2.2361; 2.236 5.1750];
Pi=[3.4309 1.4534; 1.4534 3.3298];
nu=1; nx=2;
xnom0=[4;2];
bstar=0.02;
alpha=50.3583;
CLF=@(x,y)(x-y)'*P*(x-y);
XA=[eye(2);-eye(2)]; Xb=5*[1;1;1;1]; X=Polyhedron(XA,Xb);
UA=[1;-1]; Ub=4*[1;1]; U=Polyhedron(UA,Ub);
%MPC
yalmip('clear')
vvect=sdpvar(nu,N); %index 0 .. N-1
xvect=sdpvar(nx,N+1); %index 0 .. N
constraints=[];
objective=0;
constraints=[constraints, xvect(:,1)==xnom0];
w=sdpvar(nx,N+1); %for Minkowski difference with x
ww=sdpvar(nu,N); %for Minkowski difference with v
myx=sdpvar(2,1);
for i=1:N %0:(N-1)
    constraints=[constraints, xvect(:,i+1)==f(xvect(:,i),K*xvect(:,i)+vvect(i))]
    constraints=[constraints,
        ismember(xvect(:,i+1)+w(:,i+1),X), uncertain(w(:,i+1)), %:ismember(x(:,i+1),X-E),
            ismember(w(:,i+1),X), CLF(w(:,i+1),xnom0)<=bstar, %:(contains) ismember(w,E)
        ismember(vvect(i)+ww(i),U), uncertain(ww(i)), %:ismember(vvect(i),U-KX)
            ww(i)==K*myx, ismember(myx,X)%:(contains) ismember(w,K*X)
        ];
end
%% section *
constraints=[constraints,
    uncertain(w(:,N+1)), %: ismember(x(:,N+1),XF-E)
        (xvect(:,N+1)+w(:,N+1))'*Pi*(xvect(:,N+1)+w(:,N+1))<=alpha,%:(contains) ismember(xvect(:,N+1)+w,XF)
        ismember(w(:,N+1),X), CLF(w(:,N+1),xnom0)<=bstar]; %:(contains) ismember(w,E)
%% ctd
for i=1:N
    objective= objective + xvect(:,i)'*Q*xvect(:,i) + R*(vvect(i))^2;
end
objective = objective + xvect(:,N+1)'*P*xvect(:,N+1);
optimize(constraints,objective);
[(c) Marc Wijnand et al.]
I tried to validate this MWE. Let me know if you miss any variable declarations.

Johan Löfberg

unread,
May 18, 2015, 5:26:49 AM5/18/15
to yal...@googlegroups.com
You have a case of quadratic inequalities with uncertainties also defined by quadratic inequalities. This is an intractable problem in genreal and there is no general way to convert that to a problem without uncertainty.

However, your model is infeasible already before you add that constraint. One obvious problem is that you are saying that ww is an uncertain variable, but then you say that it has to satisfy an equality. An uncertain variable can never satisfy an equality. You are probably mixing up an assignment with an equality constraint. There is a huge difference between x=w (assign x to be w) and sdpvar x, x==w (find a value of x, such that x is equal to w, which is impossible if w is uncertain)
Reply all
Reply to author
Forward
0 new messages