Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Yalmip HELP PLEASE

Subject: Yalmip HELP PLEASE

From: tho

Date: 30 Jun, 2011 21:27:10

Message: 1 of 16

A=[0 1 0; 0 -3 -1; 0 0 -6;];
B=[0 0 0.1]';
E1=[1 0 0; 0 2 0; 0 0 1];
E2=[0 0 1]';
D=[0 0 1]';
n=size(A,1);
T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
Y=sdpvar(1,3);
gamma=sdpvar(1); % scalar
M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gamma^2*eye(3);];
% set up all constraints
Objective = gamma;
ineq_constr = set(M<0) + set(T>0);
% Minimize gamma^2
yalmipdiagnostics=solvesdp(ineq_constr,Objective)
T=double(T)
Y=double(Y)

This is the problem I have. I have to minimize gamma, and to find the matrices T and Y. PLEASE help me. I am getting error in this code. I have to solve it by tomorrow night. So, any help would be perfect as soon as possible.Thanks in advance!!

Subject: Yalmip HELP PLEASE

From: Johan Lofberg

Date: 1 Jul, 2011 05:49:10

Message: 2 of 16

When you square gamma, you leave the convex world...However, it is trivial to fix here. Use gamma^2 as the decision variable

gammasquared=sdpvar(1); % scalar
M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gammasquared*eye(3);];
Objective = gammasquared;

BTW, the SET operator is obsolete, simply use brackets instead
ineq_constr = [M<0, T>0];

"tho" wrote in message <iuipnd$c1a$1@newscl01ah.mathworks.com>...
> A=[0 1 0; 0 -3 -1; 0 0 -6;];
> B=[0 0 0.1]';
> E1=[1 0 0; 0 2 0; 0 0 1];
> E2=[0 0 1]';
> D=[0 0 1]';
> n=size(A,1);
> T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
> Y=sdpvar(1,3);
> gamma=sdpvar(1); % scalar
> M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gamma^2*eye(3);];
> % set up all constraints
> Objective = gamma;
> ineq_constr = set(M<0) + set(T>0);
> % Minimize gamma^2
> yalmipdiagnostics=solvesdp(ineq_constr,Objective)
> T=double(T)
> Y=double(Y)
>
> This is the problem I have. I have to minimize gamma, and to find the matrices T and Y. PLEASE help me. I am getting error in this code. I have to solve it by tomorrow night. So, any help would be perfect as soon as possible.Thanks in advance!!

Subject: Yalmip HELP PLEASE

From: tho

Date: 1 Jul, 2011 11:19:10

Message: 3 of 16

"Johan Löfberg" wrote in message <iujn4m$lsg$1@newscl01ah.mathworks.com>...

Basically, i used in some tests I was doing the gamma^2 as the decision variable, I was getting results, but M and T were not satisfying the conditions, i.e. I was not getting the desired results. Thats why I want to solve the problem using matlab toolbox, in order to compare the results. Thanks a lot by the way!
> When you square gamma, you leave the convex world...However, it is trivial to fix here. Use gamma^2 as the decision variable
>
> gammasquared=sdpvar(1); % scalar
> M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gammasquared*eye(3);];
> Objective = gammasquared;
>
> BTW, the SET operator is obsolete, simply use brackets instead
> ineq_constr = [M<0, T>0];
>
> "tho" wrote in message <iuipnd$c1a$1@newscl01ah.mathworks.com>...
> > A=[0 1 0; 0 -3 -1; 0 0 -6;];
> > B=[0 0 0.1]';
> > E1=[1 0 0; 0 2 0; 0 0 1];
> > E2=[0 0 1]';
> > D=[0 0 1]';
> > n=size(A,1);
> > T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
> > Y=sdpvar(1,3);
> > gamma=sdpvar(1); % scalar
> > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gamma^2*eye(3);];
> > % set up all constraints
> > Objective = gamma;
> > ineq_constr = set(M<0) + set(T>0);
> > % Minimize gamma^2
> > yalmipdiagnostics=solvesdp(ineq_constr,Objective)
> > T=double(T)
> > Y=double(Y)
> >
> > This is the problem I have. I have to minimize gamma, and to find the matrices T and Y. PLEASE help me. I am getting error in this code. I have to solve it by tomorrow night. So, any help would be perfect as soon as possible.Thanks in advance!!

Subject: Yalmip HELP PLEASE

From: tho

Date: 1 Jul, 2011 11:36:09

Message: 4 of 16

"Johan Löfberg" wrote in message <iujn4m$lsg$1@newscl01ah.mathworks.com>...

I made the changes, and I am getting results, but not the desired. Can you help in apply the same problem using the matlab toolbox?Thanks in advance.!!!

> When you square gamma, you leave the convex world...However, it is trivial to fix here. Use gamma^2 as the decision variable
>
> gammasquared=sdpvar(1); % scalar
> M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gammasquared*eye(3);];
> Objective = gammasquared;
>
> BTW, the SET operator is obsolete, simply use brackets instead
> ineq_constr = [M<0, T>0];
>
> "tho" wrote in message <iuipnd$c1a$1@newscl01ah.mathworks.com>...
> > A=[0 1 0; 0 -3 -1; 0 0 -6;];
> > B=[0 0 0.1]';
> > E1=[1 0 0; 0 2 0; 0 0 1];
> > E2=[0 0 1]';
> > D=[0 0 1]';
> > n=size(A,1);
> > T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
> > Y=sdpvar(1,3);
> > gamma=sdpvar(1); % scalar
> > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gamma^2*eye(3);];
> > % set up all constraints
> > Objective = gamma;
> > ineq_constr = set(M<0) + set(T>0);
> > % Minimize gamma^2
> > yalmipdiagnostics=solvesdp(ineq_constr,Objective)
> > T=double(T)
> > Y=double(Y)
> >
> > This is the problem I have. I have to minimize gamma, and to find the matrices T and Y. PLEASE help me. I am getting error in this code. I have to solve it by tomorrow night. So, any help would be perfect as soon as possible.Thanks in advance!!

Subject: Yalmip HELP PLEASE

From: Johan Löfberg

Date: 1 Jul, 2011 11:45:25

Message: 5 of 16

What do you mean with "not satisfying conditions". In the limit, if you use an interior-point solver such as sdpt3 or sedumi, the solution will typically approach a singular solution, and approach it from outside, i.e. slightly infeasible.

This can be fixed by using various tricks. One way is to explicitly ask for a strictly feasible solution

ineq_constr = set(M<-eye(length(M))*1e-5) + set(T>eye(length(T))*1e-5);

Another way is to compute the optimal value (looks like it is 100) and then solve a feasibility problem for a slightly sub-optimal solution, which typically will be in the interior
solvesdp([gamma == 100.001,ineq_constr]);


"tho" wrote in message <iukafe$7p9$1@newscl01ah.mathworks.com>...
> "Johan Löfberg" wrote in message <iujn4m$lsg$1@newscl01ah.mathworks.com>...
>
> Basically, i used in some tests I was doing the gamma^2 as the decision variable, I was getting results, but M and T were not satisfying the conditions, i.e. I was not getting the desired results. Thats why I want to solve the problem using matlab toolbox, in order to compare the results. Thanks a lot by the way!
> > When you square gamma, you leave the convex world...However, it is trivial to fix here. Use gamma^2 as the decision variable
> >
> > gammasquared=sdpvar(1); % scalar
> > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gammasquared*eye(3);];
> > Objective = gammasquared;
> >
> > BTW, the SET operator is obsolete, simply use brackets instead
> > ineq_constr = [M<0, T>0];
> >
> > "tho" wrote in message <iuipnd$c1a$1@newscl01ah.mathworks.com>...
> > > A=[0 1 0; 0 -3 -1; 0 0 -6;];
> > > B=[0 0 0.1]';
> > > E1=[1 0 0; 0 2 0; 0 0 1];
> > > E2=[0 0 1]';
> > > D=[0 0 1]';
> > > n=size(A,1);
> > > T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
> > > Y=sdpvar(1,3);
> > > gamma=sdpvar(1); % scalar
> > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gamma^2*eye(3);];
> > > % set up all constraints
> > > Objective = gamma;
> > > ineq_constr = set(M<0) + set(T>0);
> > > % Minimize gamma^2
> > > yalmipdiagnostics=solvesdp(ineq_constr,Objective)
> > > T=double(T)
> > > Y=double(Y)
> > >
> > > This is the problem I have. I have to minimize gamma, and to find the matrices T and Y. PLEASE help me. I am getting error in this code. I have to solve it by tomorrow night. So, any help would be perfect as soon as possible.Thanks in advance!!

Subject: Yalmip HELP PLEASE

From: Johan Löfberg

Date: 1 Jul, 2011 11:49:09

Message: 6 of 16

No, I don't work with the LMI toolbox

"tho" wrote in message <iukbf9$ab3$1@newscl01ah.mathworks.com>...
> "Johan Löfberg" wrote in message <iujn4m$lsg$1@newscl01ah.mathworks.com>...
>
> I made the changes, and I am getting results, but not the desired. Can you help in apply the same problem using the matlab toolbox?Thanks in advance.!!!
>
> > When you square gamma, you leave the convex world...However, it is trivial to fix here. Use gamma^2 as the decision variable
> >
> > gammasquared=sdpvar(1); % scalar
> > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gammasquared*eye(3);];
> > Objective = gammasquared;
> >
> > BTW, the SET operator is obsolete, simply use brackets instead
> > ineq_constr = [M<0, T>0];
> >
> > "tho" wrote in message <iuipnd$c1a$1@newscl01ah.mathworks.com>...
> > > A=[0 1 0; 0 -3 -1; 0 0 -6;];
> > > B=[0 0 0.1]';
> > > E1=[1 0 0; 0 2 0; 0 0 1];
> > > E2=[0 0 1]';
> > > D=[0 0 1]';
> > > n=size(A,1);
> > > T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
> > > Y=sdpvar(1,3);
> > > gamma=sdpvar(1); % scalar
> > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gamma^2*eye(3);];
> > > % set up all constraints
> > > Objective = gamma;
> > > ineq_constr = set(M<0) + set(T>0);
> > > % Minimize gamma^2
> > > yalmipdiagnostics=solvesdp(ineq_constr,Objective)
> > > T=double(T)
> > > Y=double(Y)
> > >
> > > This is the problem I have. I have to minimize gamma, and to find the matrices T and Y. PLEASE help me. I am getting error in this code. I have to solve it by tomorrow night. So, any help would be perfect as soon as possible.Thanks in advance!!

Subject: Yalmip HELP PLEASE

From: tho

Date: 1 Jul, 2011 11:53:09

Message: 7 of 16

"Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukc0l$bqd$1@newscl01ah.mathworks.com>...

I mean that M<0 and Q>0 are not satisfied, because I am finding the eigenvalues of M and Q. Eigenvaules of M should all be negative, but I am getting 5 negative and one equal to zero. I.e. M<0 is not satisfied. The same is happening for Q.

> What do you mean with "not satisfying conditions". In the limit, if you use an interior-point solver such as sdpt3 or sedumi, the solution will typically approach a singular solution, and approach it from outside, i.e. slightly infeasible.
>
> This can be fixed by using various tricks. One way is to explicitly ask for a strictly feasible solution
>
> ineq_constr = set(M<-eye(length(M))*1e-5) + set(T>eye(length(T))*1e-5);
>
> Another way is to compute the optimal value (looks like it is 100) and then solve a feasibility problem for a slightly sub-optimal solution, which typically will be in the interior
> solvesdp([gamma == 100.001,ineq_constr]);
>
>
> "tho" wrote in message <iukafe$7p9$1@newscl01ah.mathworks.com>...
> > "Johan Löfberg" wrote in message <iujn4m$lsg$1@newscl01ah.mathworks.com>...
> >
> > Basically, i used in some tests I was doing the gamma^2 as the decision variable, I was getting results, but M and T were not satisfying the conditions, i.e. I was not getting the desired results. Thats why I want to solve the problem using matlab toolbox, in order to compare the results. Thanks a lot by the way!
> > > When you square gamma, you leave the convex world...However, it is trivial to fix here. Use gamma^2 as the decision variable
> > >
> > > gammasquared=sdpvar(1); % scalar
> > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gammasquared*eye(3);];
> > > Objective = gammasquared;
> > >
> > > BTW, the SET operator is obsolete, simply use brackets instead
> > > ineq_constr = [M<0, T>0];
> > >
> > > "tho" wrote in message <iuipnd$c1a$1@newscl01ah.mathworks.com>...
> > > > A=[0 1 0; 0 -3 -1; 0 0 -6;];
> > > > B=[0 0 0.1]';
> > > > E1=[1 0 0; 0 2 0; 0 0 1];
> > > > E2=[0 0 1]';
> > > > D=[0 0 1]';
> > > > n=size(A,1);
> > > > T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
> > > > Y=sdpvar(1,3);
> > > > gamma=sdpvar(1); % scalar
> > > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gamma^2*eye(3);];
> > > > % set up all constraints
> > > > Objective = gamma;
> > > > ineq_constr = set(M<0) + set(T>0);
> > > > % Minimize gamma^2
> > > > yalmipdiagnostics=solvesdp(ineq_constr,Objective)
> > > > T=double(T)
> > > > Y=double(Y)
> > > >
> > > > This is the problem I have. I have to minimize gamma, and to find the matrices T and Y. PLEASE help me. I am getting error in this code. I have to solve it by tomorrow night. So, any help would be perfect as soon as possible.Thanks in advance!!

Subject: Yalmip HELP PLEASE

From: tho

Date: 1 Jul, 2011 11:54:09

Message: 8 of 16

"Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukc0l$bqd$1@newscl01ah.mathworks.com>...

Sorry, I wrote Q. I meant T.

> What do you mean with "not satisfying conditions". In the limit, if you use an interior-point solver such as sdpt3 or sedumi, the solution will typically approach a singular solution, and approach it from outside, i.e. slightly infeasible.
>
> This can be fixed by using various tricks. One way is to explicitly ask for a strictly feasible solution
>
> ineq_constr = set(M<-eye(length(M))*1e-5) + set(T>eye(length(T))*1e-5);
>
> Another way is to compute the optimal value (looks like it is 100) and then solve a feasibility problem for a slightly sub-optimal solution, which typically will be in the interior
> solvesdp([gamma == 100.001,ineq_constr]);
>
>
> "tho" wrote in message <iukafe$7p9$1@newscl01ah.mathworks.com>...
> > "Johan Löfberg" wrote in message <iujn4m$lsg$1@newscl01ah.mathworks.com>...
> >
> > Basically, i used in some tests I was doing the gamma^2 as the decision variable, I was getting results, but M and T were not satisfying the conditions, i.e. I was not getting the desired results. Thats why I want to solve the problem using matlab toolbox, in order to compare the results. Thanks a lot by the way!
> > > When you square gamma, you leave the convex world...However, it is trivial to fix here. Use gamma^2 as the decision variable
> > >
> > > gammasquared=sdpvar(1); % scalar
> > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gammasquared*eye(3);];
> > > Objective = gammasquared;
> > >
> > > BTW, the SET operator is obsolete, simply use brackets instead
> > > ineq_constr = [M<0, T>0];
> > >
> > > "tho" wrote in message <iuipnd$c1a$1@newscl01ah.mathworks.com>...
> > > > A=[0 1 0; 0 -3 -1; 0 0 -6;];
> > > > B=[0 0 0.1]';
> > > > E1=[1 0 0; 0 2 0; 0 0 1];
> > > > E2=[0 0 1]';
> > > > D=[0 0 1]';
> > > > n=size(A,1);
> > > > T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
> > > > Y=sdpvar(1,3);
> > > > gamma=sdpvar(1); % scalar
> > > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gamma^2*eye(3);];
> > > > % set up all constraints
> > > > Objective = gamma;
> > > > ineq_constr = set(M<0) + set(T>0);
> > > > % Minimize gamma^2
> > > > yalmipdiagnostics=solvesdp(ineq_constr,Objective)
> > > > T=double(T)
> > > > Y=double(Y)
> > > >
> > > > This is the problem I have. I have to minimize gamma, and to find the matrices T and Y. PLEASE help me. I am getting error in this code. I have to solve it by tomorrow night. So, any help would be perfect as soon as possible.Thanks in advance!!

Subject: Yalmip HELP PLEASE

From: Johan Löfberg

Date: 1 Jul, 2011 12:31:07

Message: 9 of 16

OK, so then you use the methods I described above.

"tho" wrote in message <iukcf5$cql$1@newscl01ah.mathworks.com>...
> "Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukc0l$bqd$1@newscl01ah.mathworks.com>...
>
> I mean that M<0 and Q>0 are not satisfied, because I am finding the eigenvalues of M and Q. Eigenvaules of M should all be negative, but I am getting 5 negative and one equal to zero. I.e. M<0 is not satisfied. The same is happening for Q.
>
> > What do you mean with "not satisfying conditions". In the limit, if you use an interior-point solver such as sdpt3 or sedumi, the solution will typically approach a singular solution, and approach it from outside, i.e. slightly infeasible.
> >
> > This can be fixed by using various tricks. One way is to explicitly ask for a strictly feasible solution
> >
> > ineq_constr = set(M<-eye(length(M))*1e-5) + set(T>eye(length(T))*1e-5);
> >
> > Another way is to compute the optimal value (looks like it is 100) and then solve a feasibility problem for a slightly sub-optimal solution, which typically will be in the interior
> > solvesdp([gamma == 100.001,ineq_constr]);
> >
> >
> > "tho" wrote in message <iukafe$7p9$1@newscl01ah.mathworks.com>...
> > > "Johan Löfberg" wrote in message <iujn4m$lsg$1@newscl01ah.mathworks.com>...
> > >
> > > Basically, i used in some tests I was doing the gamma^2 as the decision variable, I was getting results, but M and T were not satisfying the conditions, i.e. I was not getting the desired results. Thats why I want to solve the problem using matlab toolbox, in order to compare the results. Thanks a lot by the way!
> > > > When you square gamma, you leave the convex world...However, it is trivial to fix here. Use gamma^2 as the decision variable
> > > >
> > > > gammasquared=sdpvar(1); % scalar
> > > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gammasquared*eye(3);];
> > > > Objective = gammasquared;
> > > >
> > > > BTW, the SET operator is obsolete, simply use brackets instead
> > > > ineq_constr = [M<0, T>0];
> > > >
> > > > "tho" wrote in message <iuipnd$c1a$1@newscl01ah.mathworks.com>...
> > > > > A=[0 1 0; 0 -3 -1; 0 0 -6;];
> > > > > B=[0 0 0.1]';
> > > > > E1=[1 0 0; 0 2 0; 0 0 1];
> > > > > E2=[0 0 1]';
> > > > > D=[0 0 1]';
> > > > > n=size(A,1);
> > > > > T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
> > > > > Y=sdpvar(1,3);
> > > > > gamma=sdpvar(1); % scalar
> > > > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gamma^2*eye(3);];
> > > > > % set up all constraints
> > > > > Objective = gamma;
> > > > > ineq_constr = set(M<0) + set(T>0);
> > > > > % Minimize gamma^2
> > > > > yalmipdiagnostics=solvesdp(ineq_constr,Objective)
> > > > > T=double(T)
> > > > > Y=double(Y)
> > > > >
> > > > > This is the problem I have. I have to minimize gamma, and to find the matrices T and Y. PLEASE help me. I am getting error in this code. I have to solve it by tomorrow night. So, any help would be perfect as soon as possible.Thanks in advance!!

Subject: Yalmip HELP PLEASE

From: tho

Date: 1 Jul, 2011 12:39:09

Message: 10 of 16

"Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukemb$ikf$1@newscl01ah.mathworks.com>...

I used the methods you suggested and the conditions are satisfied. But there is a problem. I have to use matrices Y and T in order to obtain a 1x3 matrix(i.e. a vector of 3 elements). So, I have to do: q=Y*inv(Q) to get the vector. But when i am doing this, I get very high values (like 0.0256*10^5 etc), but I should get something between 10 and 100 in the vector in order to have a stable q. Why is that happening?

> OK, so then you use the methods I described above.
>
> "tho" wrote in message <iukcf5$cql$1@newscl01ah.mathworks.com>...
> > "Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukc0l$bqd$1@newscl01ah.mathworks.com>...
> >
> > I mean that M<0 and Q>0 are not satisfied, because I am finding the eigenvalues of M and Q. Eigenvaules of M should all be negative, but I am getting 5 negative and one equal to zero. I.e. M<0 is not satisfied. The same is happening for Q.
> >
> > > What do you mean with "not satisfying conditions". In the limit, if you use an interior-point solver such as sdpt3 or sedumi, the solution will typically approach a singular solution, and approach it from outside, i.e. slightly infeasible.
> > >
> > > This can be fixed by using various tricks. One way is to explicitly ask for a strictly feasible solution
> > >
> > > ineq_constr = set(M<-eye(length(M))*1e-5) + set(T>eye(length(T))*1e-5);
> > >
> > > Another way is to compute the optimal value (looks like it is 100) and then solve a feasibility problem for a slightly sub-optimal solution, which typically will be in the interior
> > > solvesdp([gamma == 100.001,ineq_constr]);
> > >
> > >
> > > "tho" wrote in message <iukafe$7p9$1@newscl01ah.mathworks.com>...
> > > > "Johan Löfberg" wrote in message <iujn4m$lsg$1@newscl01ah.mathworks.com>...
> > > >
> > > > Basically, i used in some tests I was doing the gamma^2 as the decision variable, I was getting results, but M and T were not satisfying the conditions, i.e. I was not getting the desired results. Thats why I want to solve the problem using matlab toolbox, in order to compare the results. Thanks a lot by the way!
> > > > > When you square gamma, you leave the convex world...However, it is trivial to fix here. Use gamma^2 as the decision variable
> > > > >
> > > > > gammasquared=sdpvar(1); % scalar
> > > > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gammasquared*eye(3);];
> > > > > Objective = gammasquared;
> > > > >
> > > > > BTW, the SET operator is obsolete, simply use brackets instead
> > > > > ineq_constr = [M<0, T>0];
> > > > >
> > > > > "tho" wrote in message <iuipnd$c1a$1@newscl01ah.mathworks.com>...
> > > > > > A=[0 1 0; 0 -3 -1; 0 0 -6;];
> > > > > > B=[0 0 0.1]';
> > > > > > E1=[1 0 0; 0 2 0; 0 0 1];
> > > > > > E2=[0 0 1]';
> > > > > > D=[0 0 1]';
> > > > > > n=size(A,1);
> > > > > > T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
> > > > > > Y=sdpvar(1,3);
> > > > > > gamma=sdpvar(1); % scalar
> > > > > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gamma^2*eye(3);];
> > > > > > % set up all constraints
> > > > > > Objective = gamma;
> > > > > > ineq_constr = set(M<0) + set(T>0);
> > > > > > % Minimize gamma^2
> > > > > > yalmipdiagnostics=solvesdp(ineq_constr,Objective)
> > > > > > T=double(T)
> > > > > > Y=double(Y)
> > > > > >
> > > > > > This is the problem I have. I have to minimize gamma, and to find the matrices T and Y. PLEASE help me. I am getting error in this code. I have to solve it by tomorrow night. So, any help would be perfect as soon as possible.Thanks in advance!!

Subject: Yalmip HELP PLEASE

From: Johan Löfberg

Date: 1 Jul, 2011 12:49:10

Message: 11 of 16

The solution is stabilizing (as it satisfies the original LMI)

>> eig(double(T))

ans =

  1.0e+003 *

    0.0000
    0.1101
    1.1532

>> eig(A-B*double(Y)*inv(double(T)))

ans =

  -76.7556
   -3.0000
   -6.0999

If this is a bad solution, then you haven't posed the problem fully. Note though, finding a stabilizing solution with bounds on the feedback matrix is extremely hard (complexity-wise intractable if memory serves me right)

The heuristic approach is to simply add a more conservative lower bound on the eigenvalue on T, and perhaps bound the norm of Y


"tho" wrote in message <iukf5d$jqg$1@newscl01ah.mathworks.com>...
> "Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukemb$ikf$1@newscl01ah.mathworks.com>...
>
> I used the methods you suggested and the conditions are satisfied. But there is a problem. I have to use matrices Y and T in order to obtain a 1x3 matrix(i.e. a vector of 3 elements). So, I have to do: q=Y*inv(Q) to get the vector. But when i am doing this, I get very high values (like 0.0256*10^5 etc), but I should get something between 10 and 100 in the vector in order to have a stable q. Why is that happening?
>
> > OK, so then you use the methods I described above.
> >
> > "tho" wrote in message <iukcf5$cql$1@newscl01ah.mathworks.com>...
> > > "Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukc0l$bqd$1@newscl01ah.mathworks.com>...
> > >
> > > I mean that M<0 and Q>0 are not satisfied, because I am finding the eigenvalues of M and Q. Eigenvaules of M should all be negative, but I am getting 5 negative and one equal to zero. I.e. M<0 is not satisfied. The same is happening for Q.
> > >
> > > > What do you mean with "not satisfying conditions". In the limit, if you use an interior-point solver such as sdpt3 or sedumi, the solution will typically approach a singular solution, and approach it from outside, i.e. slightly infeasible.
> > > >
> > > > This can be fixed by using various tricks. One way is to explicitly ask for a strictly feasible solution
> > > >
> > > > ineq_constr = set(M<-eye(length(M))*1e-5) + set(T>eye(length(T))*1e-5);
> > > >
> > > > Another way is to compute the optimal value (looks like it is 100) and then solve a feasibility problem for a slightly sub-optimal solution, which typically will be in the interior
> > > > solvesdp([gamma == 100.001,ineq_constr]);
> > > >
> > > >
> > > > "tho" wrote in message <iukafe$7p9$1@newscl01ah.mathworks.com>...
> > > > > "Johan Löfberg" wrote in message <iujn4m$lsg$1@newscl01ah.mathworks.com>...
> > > > >
> > > > > Basically, i used in some tests I was doing the gamma^2 as the decision variable, I was getting results, but M and T were not satisfying the conditions, i.e. I was not getting the desired results. Thats why I want to solve the problem using matlab toolbox, in order to compare the results. Thanks a lot by the way!
> > > > > > When you square gamma, you leave the convex world...However, it is trivial to fix here. Use gamma^2 as the decision variable
> > > > > >
> > > > > > gammasquared=sdpvar(1); % scalar
> > > > > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gammasquared*eye(3);];
> > > > > > Objective = gammasquared;
> > > > > >
> > > > > > BTW, the SET operator is obsolete, simply use brackets instead
> > > > > > ineq_constr = [M<0, T>0];
> > > > > >
> > > > > > "tho" wrote in message <iuipnd$c1a$1@newscl01ah.mathworks.com>...
> > > > > > > A=[0 1 0; 0 -3 -1; 0 0 -6;];
> > > > > > > B=[0 0 0.1]';
> > > > > > > E1=[1 0 0; 0 2 0; 0 0 1];
> > > > > > > E2=[0 0 1]';
> > > > > > > D=[0 0 1]';
> > > > > > > n=size(A,1);
> > > > > > > T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
> > > > > > > Y=sdpvar(1,3);
> > > > > > > gamma=sdpvar(1); % scalar
> > > > > > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gamma^2*eye(3);];
> > > > > > > % set up all constraints
> > > > > > > Objective = gamma;
> > > > > > > ineq_constr = set(M<0) + set(T>0);
> > > > > > > % Minimize gamma^2
> > > > > > > yalmipdiagnostics=solvesdp(ineq_constr,Objective)
> > > > > > > T=double(T)
> > > > > > > Y=double(Y)
> > > > > > >
> > > > > > > This is the problem I have. I have to minimize gamma, and to find the matrices T and Y. PLEASE help me. I am getting error in this code. I have to solve it by tomorrow night. So, any help would be perfect as soon as possible.Thanks in advance!!

Subject: Yalmip HELP PLEASE

From: tho

Date: 1 Jul, 2011 12:57:25

Message: 12 of 16

"Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukfo6$lhp$1@newscl01ah.mathworks.com>...

I am not getting these results.
This is the code I run:
A=[0 1 0; 0 -3 -1; 0 0 -6;];
B=[0 0 0.1]';
E1=[1 0 0; 0 2 0; 0 0 1];
E2=[0 0 1]';
D=[0 0 1]';
n=size(A,1);
T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
Y=sdpvar(1,3);
gammasquared=sdpvar(1); % scalar
M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gammasquared*eye(3);];
% set up all constraints
Objective = gammasquared;
ineq_constr = set(M<-eye(length(M))*1e-5) + set(T>eye(length(T))*1e-5);
% Minimize gamma^2
yalmipdiagnostics=solvesdp(ineq_constr,Objective)
T=double(T)
Y=double(Y)
 I am running this code, and I get different results. Are you using the same?

> The solution is stabilizing (as it satisfies the original LMI)
>
> >> eig(double(T))
>
> ans =
>
> 1.0e+003 *
>
> 0.0000
> 0.1101
> 1.1532
>
> >> eig(A-B*double(Y)*inv(double(T)))
>
> ans =
>
> -76.7556
> -3.0000
> -6.0999
>
> If this is a bad solution, then you haven't posed the problem fully. Note though, finding a stabilizing solution with bounds on the feedback matrix is extremely hard (complexity-wise intractable if memory serves me right)
>
> The heuristic approach is to simply add a more conservative lower bound on the eigenvalue on T, and perhaps bound the norm of Y
>
>
> "tho" wrote in message <iukf5d$jqg$1@newscl01ah.mathworks.com>...
> > "Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukemb$ikf$1@newscl01ah.mathworks.com>...
> >
> > I used the methods you suggested and the conditions are satisfied. But there is a problem. I have to use matrices Y and T in order to obtain a 1x3 matrix(i.e. a vector of 3 elements). So, I have to do: q=Y*inv(Q) to get the vector. But when i am doing this, I get very high values (like 0.0256*10^5 etc), but I should get something between 10 and 100 in the vector in order to have a stable q. Why is that happening?
> >
> > > OK, so then you use the methods I described above.
> > >
> > > "tho" wrote in message <iukcf5$cql$1@newscl01ah.mathworks.com>...
> > > > "Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukc0l$bqd$1@newscl01ah.mathworks.com>...
> > > >
> > > > I mean that M<0 and Q>0 are not satisfied, because I am finding the eigenvalues of M and Q. Eigenvaules of M should all be negative, but I am getting 5 negative and one equal to zero. I.e. M<0 is not satisfied. The same is happening for Q.
> > > >
> > > > > What do you mean with "not satisfying conditions". In the limit, if you use an interior-point solver such as sdpt3 or sedumi, the solution will typically approach a singular solution, and approach it from outside, i.e. slightly infeasible.
> > > > >
> > > > > This can be fixed by using various tricks. One way is to explicitly ask for a strictly feasible solution
> > > > >
> > > > > ineq_constr = set(M<-eye(length(M))*1e-5) + set(T>eye(length(T))*1e-5);
> > > > >
> > > > > Another way is to compute the optimal value (looks like it is 100) and then solve a feasibility problem for a slightly sub-optimal solution, which typically will be in the interior
> > > > > solvesdp([gamma == 100.001,ineq_constr]);
> > > > >
> > > > >
> > > > > "tho" wrote in message <iukafe$7p9$1@newscl01ah.mathworks.com>...
> > > > > > "Johan Löfberg" wrote in message <iujn4m$lsg$1@newscl01ah.mathworks.com>...
> > > > > >
> > > > > > Basically, i used in some tests I was doing the gamma^2 as the decision variable, I was getting results, but M and T were not satisfying the conditions, i.e. I was not getting the desired results. Thats why I want to solve the problem using matlab toolbox, in order to compare the results. Thanks a lot by the way!
> > > > > > > When you square gamma, you leave the convex world...However, it is trivial to fix here. Use gamma^2 as the decision variable
> > > > > > >
> > > > > > > gammasquared=sdpvar(1); % scalar
> > > > > > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gammasquared*eye(3);];
> > > > > > > Objective = gammasquared;
> > > > > > >
> > > > > > > BTW, the SET operator is obsolete, simply use brackets instead
> > > > > > > ineq_constr = [M<0, T>0];
> > > > > > >
> > > > > > > "tho" wrote in message <iuipnd$c1a$1@newscl01ah.mathworks.com>...
> > > > > > > > A=[0 1 0; 0 -3 -1; 0 0 -6;];
> > > > > > > > B=[0 0 0.1]';
> > > > > > > > E1=[1 0 0; 0 2 0; 0 0 1];
> > > > > > > > E2=[0 0 1]';
> > > > > > > > D=[0 0 1]';
> > > > > > > > n=size(A,1);
> > > > > > > > T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
> > > > > > > > Y=sdpvar(1,3);
> > > > > > > > gamma=sdpvar(1); % scalar
> > > > > > > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gamma^2*eye(3);];
> > > > > > > > % set up all constraints
> > > > > > > > Objective = gamma;
> > > > > > > > ineq_constr = set(M<0) + set(T>0);
> > > > > > > > % Minimize gamma^2
> > > > > > > > yalmipdiagnostics=solvesdp(ineq_constr,Objective)
> > > > > > > > T=double(T)
> > > > > > > > Y=double(Y)
> > > > > > > >
> > > > > > > > This is the problem I have. I have to minimize gamma, and to find the matrices T and Y. PLEASE help me. I am getting error in this code. I have to solve it by tomorrow night. So, any help would be perfect as soon as possible.Thanks in advance!!

Subject: Yalmip HELP PLEASE

From: Johan Löfberg

Date: 1 Jul, 2011 13:17:12

Message: 13 of 16

Which solver are you using? I get roughly the same results, using both SeDuMi and SDPT3

"tho" wrote in message <iukg7l$mqh$1@newscl01ah.mathworks.com>...
> "Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukfo6$lhp$1@newscl01ah.mathworks.com>...
>
> I am not getting these results.
> This is the code I run:
> A=[0 1 0; 0 -3 -1; 0 0 -6;];
> B=[0 0 0.1]';
> E1=[1 0 0; 0 2 0; 0 0 1];
> E2=[0 0 1]';
> D=[0 0 1]';
> n=size(A,1);
> T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
> Y=sdpvar(1,3);
> gammasquared=sdpvar(1); % scalar
> M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gammasquared*eye(3);];
> % set up all constraints
> Objective = gammasquared;
> ineq_constr = set(M<-eye(length(M))*1e-5) + set(T>eye(length(T))*1e-5);
> % Minimize gamma^2
> yalmipdiagnostics=solvesdp(ineq_constr,Objective)
> T=double(T)
> Y=double(Y)
> I am running this code, and I get different results. Are you using the same?
>
> > The solution is stabilizing (as it satisfies the original LMI)
> >
> > >> eig(double(T))
> >
> > ans =
> >
> > 1.0e+003 *
> >
> > 0.0000
> > 0.1101
> > 1.1532
> >
> > >> eig(A-B*double(Y)*inv(double(T)))
> >
> > ans =
> >
> > -76.7556
> > -3.0000
> > -6.0999
> >
> > If this is a bad solution, then you haven't posed the problem fully. Note though, finding a stabilizing solution with bounds on the feedback matrix is extremely hard (complexity-wise intractable if memory serves me right)
> >
> > The heuristic approach is to simply add a more conservative lower bound on the eigenvalue on T, and perhaps bound the norm of Y
> >
> >
> > "tho" wrote in message <iukf5d$jqg$1@newscl01ah.mathworks.com>...
> > > "Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukemb$ikf$1@newscl01ah.mathworks.com>...
> > >
> > > I used the methods you suggested and the conditions are satisfied. But there is a problem. I have to use matrices Y and T in order to obtain a 1x3 matrix(i.e. a vector of 3 elements). So, I have to do: q=Y*inv(Q) to get the vector. But when i am doing this, I get very high values (like 0.0256*10^5 etc), but I should get something between 10 and 100 in the vector in order to have a stable q. Why is that happening?
> > >
> > > > OK, so then you use the methods I described above.
> > > >
> > > > "tho" wrote in message <iukcf5$cql$1@newscl01ah.mathworks.com>...
> > > > > "Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukc0l$bqd$1@newscl01ah.mathworks.com>...
> > > > >
> > > > > I mean that M<0 and Q>0 are not satisfied, because I am finding the eigenvalues of M and Q. Eigenvaules of M should all be negative, but I am getting 5 negative and one equal to zero. I.e. M<0 is not satisfied. The same is happening for Q.
> > > > >
> > > > > > What do you mean with "not satisfying conditions". In the limit, if you use an interior-point solver such as sdpt3 or sedumi, the solution will typically approach a singular solution, and approach it from outside, i.e. slightly infeasible.
> > > > > >
> > > > > > This can be fixed by using various tricks. One way is to explicitly ask for a strictly feasible solution
> > > > > >
> > > > > > ineq_constr = set(M<-eye(length(M))*1e-5) + set(T>eye(length(T))*1e-5);
> > > > > >
> > > > > > Another way is to compute the optimal value (looks like it is 100) and then solve a feasibility problem for a slightly sub-optimal solution, which typically will be in the interior
> > > > > > solvesdp([gamma == 100.001,ineq_constr]);
> > > > > >
> > > > > >
> > > > > > "tho" wrote in message <iukafe$7p9$1@newscl01ah.mathworks.com>...
> > > > > > > "Johan Löfberg" wrote in message <iujn4m$lsg$1@newscl01ah.mathworks.com>...
> > > > > > >
> > > > > > > Basically, i used in some tests I was doing the gamma^2 as the decision variable, I was getting results, but M and T were not satisfying the conditions, i.e. I was not getting the desired results. Thats why I want to solve the problem using matlab toolbox, in order to compare the results. Thanks a lot by the way!
> > > > > > > > When you square gamma, you leave the convex world...However, it is trivial to fix here. Use gamma^2 as the decision variable
> > > > > > > >
> > > > > > > > gammasquared=sdpvar(1); % scalar
> > > > > > > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gammasquared*eye(3);];
> > > > > > > > Objective = gammasquared;
> > > > > > > >
> > > > > > > > BTW, the SET operator is obsolete, simply use brackets instead
> > > > > > > > ineq_constr = [M<0, T>0];
> > > > > > > >
> > > > > > > > "tho" wrote in message <iuipnd$c1a$1@newscl01ah.mathworks.com>...
> > > > > > > > > A=[0 1 0; 0 -3 -1; 0 0 -6;];
> > > > > > > > > B=[0 0 0.1]';
> > > > > > > > > E1=[1 0 0; 0 2 0; 0 0 1];
> > > > > > > > > E2=[0 0 1]';
> > > > > > > > > D=[0 0 1]';
> > > > > > > > > n=size(A,1);
> > > > > > > > > T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
> > > > > > > > > Y=sdpvar(1,3);
> > > > > > > > > gamma=sdpvar(1); % scalar
> > > > > > > > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gamma^2*eye(3);];
> > > > > > > > > % set up all constraints
> > > > > > > > > Objective = gamma;
> > > > > > > > > ineq_constr = set(M<0) + set(T>0);
> > > > > > > > > % Minimize gamma^2
> > > > > > > > > yalmipdiagnostics=solvesdp(ineq_constr,Objective)
> > > > > > > > > T=double(T)
> > > > > > > > > Y=double(Y)
> > > > > > > > >
> > > > > > > > > This is the problem I have. I have to minimize gamma, and to find the matrices T and Y. PLEASE help me. I am getting error in this code. I have to solve it by tomorrow night. So, any help would be perfect as soon as possible.Thanks in advance!!

Subject: Yalmip HELP PLEASE

From: tho

Date: 1 Jul, 2011 13:24:10

Message: 14 of 16

"Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukhco$q4u$1@newscl01ah.mathworks.com>...

I am using Sedumi 1.3! The eig(A-B*double(Y)*inv(double(T))) is roughly the same as yours. But for eig(double(T)) I get:
  0.0000
  105.6610
  685.7060
which is not the same as yours. These results are not the ones I want. When I am doing:

q=double(Y)*inv(double(T))
 I must get something like this (it is just an example):q=[-5 -15 80] but decimal numbers. Now I get huge values which are not the ones I want. Can you figure out what is happening?


> Which solver are you using? I get roughly the same results, using both SeDuMi and SDPT3
>
> "tho" wrote in message <iukg7l$mqh$1@newscl01ah.mathworks.com>...
> > "Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukfo6$lhp$1@newscl01ah.mathworks.com>...
> >
> > I am not getting these results.
> > This is the code I run:
> > A=[0 1 0; 0 -3 -1; 0 0 -6;];
> > B=[0 0 0.1]';
> > E1=[1 0 0; 0 2 0; 0 0 1];
> > E2=[0 0 1]';
> > D=[0 0 1]';
> > n=size(A,1);
> > T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
> > Y=sdpvar(1,3);
> > gammasquared=sdpvar(1); % scalar
> > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gammasquared*eye(3);];
> > % set up all constraints
> > Objective = gammasquared;
> > ineq_constr = set(M<-eye(length(M))*1e-5) + set(T>eye(length(T))*1e-5);
> > % Minimize gamma^2
> > yalmipdiagnostics=solvesdp(ineq_constr,Objective)
> > T=double(T)
> > Y=double(Y)
> > I am running this code, and I get different results. Are you using the same?
> >
> > > The solution is stabilizing (as it satisfies the original LMI)
> > >
> > > >> eig(double(T))
> > >
> > > ans =
> > >
> > > 1.0e+003 *
> > >
> > > 0.0000
> > > 0.1101
> > > 1.1532
> > >
> > > >> eig(A-B*double(Y)*inv(double(T)))
> > >
> > > ans =
> > >
> > > -76.7556
> > > -3.0000
> > > -6.0999
> > >
> > > If this is a bad solution, then you haven't posed the problem fully. Note though, finding a stabilizing solution with bounds on the feedback matrix is extremely hard (complexity-wise intractable if memory serves me right)
> > >
> > > The heuristic approach is to simply add a more conservative lower bound on the eigenvalue on T, and perhaps bound the norm of Y
> > >
> > >
> > > "tho" wrote in message <iukf5d$jqg$1@newscl01ah.mathworks.com>...
> > > > "Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukemb$ikf$1@newscl01ah.mathworks.com>...
> > > >
> > > > I used the methods you suggested and the conditions are satisfied. But there is a problem. I have to use matrices Y and T in order to obtain a 1x3 matrix(i.e. a vector of 3 elements). So, I have to do: q=Y*inv(Q) to get the vector. But when i am doing this, I get very high values (like 0.0256*10^5 etc), but I should get something between 10 and 100 in the vector in order to have a stable q. Why is that happening?
> > > >
> > > > > OK, so then you use the methods I described above.
> > > > >
> > > > > "tho" wrote in message <iukcf5$cql$1@newscl01ah.mathworks.com>...
> > > > > > "Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukc0l$bqd$1@newscl01ah.mathworks.com>...
> > > > > >
> > > > > > I mean that M<0 and Q>0 are not satisfied, because I am finding the eigenvalues of M and Q. Eigenvaules of M should all be negative, but I am getting 5 negative and one equal to zero. I.e. M<0 is not satisfied. The same is happening for Q.
> > > > > >
> > > > > > > What do you mean with "not satisfying conditions". In the limit, if you use an interior-point solver such as sdpt3 or sedumi, the solution will typically approach a singular solution, and approach it from outside, i.e. slightly infeasible.
> > > > > > >
> > > > > > > This can be fixed by using various tricks. One way is to explicitly ask for a strictly feasible solution
> > > > > > >
> > > > > > > ineq_constr = set(M<-eye(length(M))*1e-5) + set(T>eye(length(T))*1e-5);
> > > > > > >
> > > > > > > Another way is to compute the optimal value (looks like it is 100) and then solve a feasibility problem for a slightly sub-optimal solution, which typically will be in the interior
> > > > > > > solvesdp([gamma == 100.001,ineq_constr]);
> > > > > > >
> > > > > > >
> > > > > > > "tho" wrote in message <iukafe$7p9$1@newscl01ah.mathworks.com>...
> > > > > > > > "Johan Löfberg" wrote in message <iujn4m$lsg$1@newscl01ah.mathworks.com>...
> > > > > > > >
> > > > > > > > Basically, i used in some tests I was doing the gamma^2 as the decision variable, I was getting results, but M and T were not satisfying the conditions, i.e. I was not getting the desired results. Thats why I want to solve the problem using matlab toolbox, in order to compare the results. Thanks a lot by the way!
> > > > > > > > > When you square gamma, you leave the convex world...However, it is trivial to fix here. Use gamma^2 as the decision variable
> > > > > > > > >
> > > > > > > > > gammasquared=sdpvar(1); % scalar
> > > > > > > > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gammasquared*eye(3);];
> > > > > > > > > Objective = gammasquared;
> > > > > > > > >
> > > > > > > > > BTW, the SET operator is obsolete, simply use brackets instead
> > > > > > > > > ineq_constr = [M<0, T>0];
> > > > > > > > >
> > > > > > > > > "tho" wrote in message <iuipnd$c1a$1@newscl01ah.mathworks.com>...
> > > > > > > > > > A=[0 1 0; 0 -3 -1; 0 0 -6;];
> > > > > > > > > > B=[0 0 0.1]';
> > > > > > > > > > E1=[1 0 0; 0 2 0; 0 0 1];
> > > > > > > > > > E2=[0 0 1]';
> > > > > > > > > > D=[0 0 1]';
> > > > > > > > > > n=size(A,1);
> > > > > > > > > > T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
> > > > > > > > > > Y=sdpvar(1,3);
> > > > > > > > > > gamma=sdpvar(1); % scalar
> > > > > > > > > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gamma^2*eye(3);];
> > > > > > > > > > % set up all constraints
> > > > > > > > > > Objective = gamma;
> > > > > > > > > > ineq_constr = set(M<0) + set(T>0);
> > > > > > > > > > % Minimize gamma^2
> > > > > > > > > > yalmipdiagnostics=solvesdp(ineq_constr,Objective)
> > > > > > > > > > T=double(T)
> > > > > > > > > > Y=double(Y)
> > > > > > > > > >
> > > > > > > > > > This is the problem I have. I have to minimize gamma, and to find the matrices T and Y. PLEASE help me. I am getting error in this code. I have to solve it by tomorrow night. So, any help would be perfect as soon as possible.Thanks in advance!!

Subject: Yalmip HELP PLEASE

From: Johan Löfberg

Date: 1 Jul, 2011 13:43:07

Message: 15 of 16

Not exactly the same, but almost. We are running different solver versions etc.

But as I said, finding feedback with bound constraints is inherently hard.

Even worse in your case, I suspect the optimal solution has infinite gain (very common on this kind of problems, it is optimal to send one eigenvalue to -infinity)

You want Y*inv(T) to be "small". Hence you have to enforce Y and inv(T) to be "small". You have to solve that using heuristics.

for instance

ineq_constr = set(M<-eye(length(M))*1e-5) + set(T>.1*eye(length(T)));
yalmipdiagnostics=solvesdp(ineq_constr,Objective+norm(Y))
double(Y)*inv(double(T))


or

sdpvar t
ineq_constr = [M<-eye(length(M))*1e-5,T>t*eye(length(T)), t>1e-5];
yalmipdiagnostics=solvesdp(ineq_constr,Objective+norm(Y)-10*t)
double(Y)*inv(double(T))

etc etc


"tho" wrote in message <iukhpq$r95$1@newscl01ah.mathworks.com>...
> "Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukhco$q4u$1@newscl01ah.mathworks.com>...
>
> I am using Sedumi 1.3! The eig(A-B*double(Y)*inv(double(T))) is roughly the same as yours. But for eig(double(T)) I get:
> 0.0000
> 105.6610
> 685.7060
> which is not the same as yours. These results are not the ones I want. When I am doing:
>
> q=double(Y)*inv(double(T))
> I must get something like this (it is just an example):q=[-5 -15 80] but decimal numbers. Now I get huge values which are not the ones I want. Can you figure out what is happening?
>
>
> > Which solver are you using? I get roughly the same results, using both SeDuMi and SDPT3
> >
> > "tho" wrote in message <iukg7l$mqh$1@newscl01ah.mathworks.com>...
> > > "Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukfo6$lhp$1@newscl01ah.mathworks.com>...
> > >
> > > I am not getting these results.
> > > This is the code I run:
> > > A=[0 1 0; 0 -3 -1; 0 0 -6;];
> > > B=[0 0 0.1]';
> > > E1=[1 0 0; 0 2 0; 0 0 1];
> > > E2=[0 0 1]';
> > > D=[0 0 1]';
> > > n=size(A,1);
> > > T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
> > > Y=sdpvar(1,3);
> > > gammasquared=sdpvar(1); % scalar
> > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gammasquared*eye(3);];
> > > % set up all constraints
> > > Objective = gammasquared;
> > > ineq_constr = set(M<-eye(length(M))*1e-5) + set(T>eye(length(T))*1e-5);
> > > % Minimize gamma^2
> > > yalmipdiagnostics=solvesdp(ineq_constr,Objective)
> > > T=double(T)
> > > Y=double(Y)
> > > I am running this code, and I get different results. Are you using the same?
> > >
> > > > The solution is stabilizing (as it satisfies the original LMI)
> > > >
> > > > >> eig(double(T))
> > > >
> > > > ans =
> > > >
> > > > 1.0e+003 *
> > > >
> > > > 0.0000
> > > > 0.1101
> > > > 1.1532
> > > >
> > > > >> eig(A-B*double(Y)*inv(double(T)))
> > > >
> > > > ans =
> > > >
> > > > -76.7556
> > > > -3.0000
> > > > -6.0999
> > > >
> > > > If this is a bad solution, then you haven't posed the problem fully. Note though, finding a stabilizing solution with bounds on the feedback matrix is extremely hard (complexity-wise intractable if memory serves me right)
> > > >
> > > > The heuristic approach is to simply add a more conservative lower bound on the eigenvalue on T, and perhaps bound the norm of Y
> > > >
> > > >
> > > > "tho" wrote in message <iukf5d$jqg$1@newscl01ah.mathworks.com>...
> > > > > "Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukemb$ikf$1@newscl01ah.mathworks.com>...
> > > > >
> > > > > I used the methods you suggested and the conditions are satisfied. But there is a problem. I have to use matrices Y and T in order to obtain a 1x3 matrix(i.e. a vector of 3 elements). So, I have to do: q=Y*inv(Q) to get the vector. But when i am doing this, I get very high values (like 0.0256*10^5 etc), but I should get something between 10 and 100 in the vector in order to have a stable q. Why is that happening?
> > > > >
> > > > > > OK, so then you use the methods I described above.
> > > > > >
> > > > > > "tho" wrote in message <iukcf5$cql$1@newscl01ah.mathworks.com>...
> > > > > > > "Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukc0l$bqd$1@newscl01ah.mathworks.com>...
> > > > > > >
> > > > > > > I mean that M<0 and Q>0 are not satisfied, because I am finding the eigenvalues of M and Q. Eigenvaules of M should all be negative, but I am getting 5 negative and one equal to zero. I.e. M<0 is not satisfied. The same is happening for Q.
> > > > > > >
> > > > > > > > What do you mean with "not satisfying conditions". In the limit, if you use an interior-point solver such as sdpt3 or sedumi, the solution will typically approach a singular solution, and approach it from outside, i.e. slightly infeasible.
> > > > > > > >
> > > > > > > > This can be fixed by using various tricks. One way is to explicitly ask for a strictly feasible solution
> > > > > > > >
> > > > > > > > ineq_constr = set(M<-eye(length(M))*1e-5) + set(T>eye(length(T))*1e-5);
> > > > > > > >
> > > > > > > > Another way is to compute the optimal value (looks like it is 100) and then solve a feasibility problem for a slightly sub-optimal solution, which typically will be in the interior
> > > > > > > > solvesdp([gamma == 100.001,ineq_constr]);
> > > > > > > >
> > > > > > > >
> > > > > > > > "tho" wrote in message <iukafe$7p9$1@newscl01ah.mathworks.com>...
> > > > > > > > > "Johan Löfberg" wrote in message <iujn4m$lsg$1@newscl01ah.mathworks.com>...
> > > > > > > > >
> > > > > > > > > Basically, i used in some tests I was doing the gamma^2 as the decision variable, I was getting results, but M and T were not satisfying the conditions, i.e. I was not getting the desired results. Thats why I want to solve the problem using matlab toolbox, in order to compare the results. Thanks a lot by the way!
> > > > > > > > > > When you square gamma, you leave the convex world...However, it is trivial to fix here. Use gamma^2 as the decision variable
> > > > > > > > > >
> > > > > > > > > > gammasquared=sdpvar(1); % scalar
> > > > > > > > > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gammasquared*eye(3);];
> > > > > > > > > > Objective = gammasquared;
> > > > > > > > > >
> > > > > > > > > > BTW, the SET operator is obsolete, simply use brackets instead
> > > > > > > > > > ineq_constr = [M<0, T>0];
> > > > > > > > > >
> > > > > > > > > > "tho" wrote in message <iuipnd$c1a$1@newscl01ah.mathworks.com>...
> > > > > > > > > > > A=[0 1 0; 0 -3 -1; 0 0 -6;];
> > > > > > > > > > > B=[0 0 0.1]';
> > > > > > > > > > > E1=[1 0 0; 0 2 0; 0 0 1];
> > > > > > > > > > > E2=[0 0 1]';
> > > > > > > > > > > D=[0 0 1]';
> > > > > > > > > > > n=size(A,1);
> > > > > > > > > > > T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
> > > > > > > > > > > Y=sdpvar(1,3);
> > > > > > > > > > > gamma=sdpvar(1); % scalar
> > > > > > > > > > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gamma^2*eye(3);];
> > > > > > > > > > > % set up all constraints
> > > > > > > > > > > Objective = gamma;
> > > > > > > > > > > ineq_constr = set(M<0) + set(T>0);
> > > > > > > > > > > % Minimize gamma^2
> > > > > > > > > > > yalmipdiagnostics=solvesdp(ineq_constr,Objective)
> > > > > > > > > > > T=double(T)
> > > > > > > > > > > Y=double(Y)
> > > > > > > > > > >
> > > > > > > > > > > This is the problem I have. I have to minimize gamma, and to find the matrices T and Y. PLEASE help me. I am getting error in this code. I have to solve it by tomorrow night. So, any help would be perfect as soon as possible.Thanks in advance!!

Subject: Yalmip HELP PLEASE

From: tho

Date: 1 Jul, 2011 13:59:10

Message: 16 of 16

"Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukitb$1dv$1@newscl01ah.mathworks.com>...

I tried both suggestions you said. The second one it does not give me the desired results. The first one, it gives some good values, which they are in the bounds that I want, but still, they do not stabilize my system. I have a model in Simulink, having non-linear equations and a control law which is linearizing the equations. In the control law, I have to apply this robust state feedback Hinf controller, in order to stabilize my system. With the first suggestion you said,my system is stabilizing but not at the operating points as it should. I.e. it is not the perfect controller. It should stabilize the system at the operating point. I have a meeting right now, so, I will reply again in a couple of hours. Thanks for your help. I was getting high numbers before your help, and now I am getting natural values, but still not the ones I should. Thanks a lot!

> Not exactly the same, but almost. We are running different solver versions etc.
>
> But as I said, finding feedback with bound constraints is inherently hard.
>
> Even worse in your case, I suspect the optimal solution has infinite gain (very common on this kind of problems, it is optimal to send one eigenvalue to -infinity)
>
> You want Y*inv(T) to be "small". Hence you have to enforce Y and inv(T) to be "small". You have to solve that using heuristics.
>
> for instance
>
> ineq_constr = set(M<-eye(length(M))*1e-5) + set(T>.1*eye(length(T)));
> yalmipdiagnostics=solvesdp(ineq_constr,Objective+norm(Y))
> double(Y)*inv(double(T))
>
>
> or
>
> sdpvar t
> ineq_constr = [M<-eye(length(M))*1e-5,T>t*eye(length(T)), t>1e-5];
> yalmipdiagnostics=solvesdp(ineq_constr,Objective+norm(Y)-10*t)
> double(Y)*inv(double(T))
>
> etc etc
>
>
> "tho" wrote in message <iukhpq$r95$1@newscl01ah.mathworks.com>...
> > "Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukhco$q4u$1@newscl01ah.mathworks.com>...
> >
> > I am using Sedumi 1.3! The eig(A-B*double(Y)*inv(double(T))) is roughly the same as yours. But for eig(double(T)) I get:
> > 0.0000
> > 105.6610
> > 685.7060
> > which is not the same as yours. These results are not the ones I want. When I am doing:
> >
> > q=double(Y)*inv(double(T))
> > I must get something like this (it is just an example):q=[-5 -15 80] but decimal numbers. Now I get huge values which are not the ones I want. Can you figure out what is happening?
> >
> >
> > > Which solver are you using? I get roughly the same results, using both SeDuMi and SDPT3
> > >
> > > "tho" wrote in message <iukg7l$mqh$1@newscl01ah.mathworks.com>...
> > > > "Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukfo6$lhp$1@newscl01ah.mathworks.com>...
> > > >
> > > > I am not getting these results.
> > > > This is the code I run:
> > > > A=[0 1 0; 0 -3 -1; 0 0 -6;];
> > > > B=[0 0 0.1]';
> > > > E1=[1 0 0; 0 2 0; 0 0 1];
> > > > E2=[0 0 1]';
> > > > D=[0 0 1]';
> > > > n=size(A,1);
> > > > T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
> > > > Y=sdpvar(1,3);
> > > > gammasquared=sdpvar(1); % scalar
> > > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gammasquared*eye(3);];
> > > > % set up all constraints
> > > > Objective = gammasquared;
> > > > ineq_constr = set(M<-eye(length(M))*1e-5) + set(T>eye(length(T))*1e-5);
> > > > % Minimize gamma^2
> > > > yalmipdiagnostics=solvesdp(ineq_constr,Objective)
> > > > T=double(T)
> > > > Y=double(Y)
> > > > I am running this code, and I get different results. Are you using the same?
> > > >
> > > > > The solution is stabilizing (as it satisfies the original LMI)
> > > > >
> > > > > >> eig(double(T))
> > > > >
> > > > > ans =
> > > > >
> > > > > 1.0e+003 *
> > > > >
> > > > > 0.0000
> > > > > 0.1101
> > > > > 1.1532
> > > > >
> > > > > >> eig(A-B*double(Y)*inv(double(T)))
> > > > >
> > > > > ans =
> > > > >
> > > > > -76.7556
> > > > > -3.0000
> > > > > -6.0999
> > > > >
> > > > > If this is a bad solution, then you haven't posed the problem fully. Note though, finding a stabilizing solution with bounds on the feedback matrix is extremely hard (complexity-wise intractable if memory serves me right)
> > > > >
> > > > > The heuristic approach is to simply add a more conservative lower bound on the eigenvalue on T, and perhaps bound the norm of Y
> > > > >
> > > > >
> > > > > "tho" wrote in message <iukf5d$jqg$1@newscl01ah.mathworks.com>...
> > > > > > "Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukemb$ikf$1@newscl01ah.mathworks.com>...
> > > > > >
> > > > > > I used the methods you suggested and the conditions are satisfied. But there is a problem. I have to use matrices Y and T in order to obtain a 1x3 matrix(i.e. a vector of 3 elements). So, I have to do: q=Y*inv(Q) to get the vector. But when i am doing this, I get very high values (like 0.0256*10^5 etc), but I should get something between 10 and 100 in the vector in order to have a stable q. Why is that happening?
> > > > > >
> > > > > > > OK, so then you use the methods I described above.
> > > > > > >
> > > > > > > "tho" wrote in message <iukcf5$cql$1@newscl01ah.mathworks.com>...
> > > > > > > > "Johan Löfberg" <loefberg@control.ee.ethz.ch> wrote in message <iukc0l$bqd$1@newscl01ah.mathworks.com>...
> > > > > > > >
> > > > > > > > I mean that M<0 and Q>0 are not satisfied, because I am finding the eigenvalues of M and Q. Eigenvaules of M should all be negative, but I am getting 5 negative and one equal to zero. I.e. M<0 is not satisfied. The same is happening for Q.
> > > > > > > >
> > > > > > > > > What do you mean with "not satisfying conditions". In the limit, if you use an interior-point solver such as sdpt3 or sedumi, the solution will typically approach a singular solution, and approach it from outside, i.e. slightly infeasible.
> > > > > > > > >
> > > > > > > > > This can be fixed by using various tricks. One way is to explicitly ask for a strictly feasible solution
> > > > > > > > >
> > > > > > > > > ineq_constr = set(M<-eye(length(M))*1e-5) + set(T>eye(length(T))*1e-5);
> > > > > > > > >
> > > > > > > > > Another way is to compute the optimal value (looks like it is 100) and then solve a feasibility problem for a slightly sub-optimal solution, which typically will be in the interior
> > > > > > > > > solvesdp([gamma == 100.001,ineq_constr]);
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > "tho" wrote in message <iukafe$7p9$1@newscl01ah.mathworks.com>...
> > > > > > > > > > "Johan Löfberg" wrote in message <iujn4m$lsg$1@newscl01ah.mathworks.com>...
> > > > > > > > > >
> > > > > > > > > > Basically, i used in some tests I was doing the gamma^2 as the decision variable, I was getting results, but M and T were not satisfying the conditions, i.e. I was not getting the desired results. Thats why I want to solve the problem using matlab toolbox, in order to compare the results. Thanks a lot by the way!
> > > > > > > > > > > When you square gamma, you leave the convex world...However, it is trivial to fix here. Use gamma^2 as the decision variable
> > > > > > > > > > >
> > > > > > > > > > > gammasquared=sdpvar(1); % scalar
> > > > > > > > > > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gammasquared*eye(3);];
> > > > > > > > > > > Objective = gammasquared;
> > > > > > > > > > >
> > > > > > > > > > > BTW, the SET operator is obsolete, simply use brackets instead
> > > > > > > > > > > ineq_constr = [M<0, T>0];
> > > > > > > > > > >
> > > > > > > > > > > "tho" wrote in message <iuipnd$c1a$1@newscl01ah.mathworks.com>...
> > > > > > > > > > > > A=[0 1 0; 0 -3 -1; 0 0 -6;];
> > > > > > > > > > > > B=[0 0 0.1]';
> > > > > > > > > > > > E1=[1 0 0; 0 2 0; 0 0 1];
> > > > > > > > > > > > E2=[0 0 1]';
> > > > > > > > > > > > D=[0 0 1]';
> > > > > > > > > > > > n=size(A,1);
> > > > > > > > > > > > T=sdpvar(n,n,'symmetric'); % symmetric n-x-n
> > > > > > > > > > > > Y=sdpvar(1,3);
> > > > > > > > > > > > gamma=sdpvar(1); % scalar
> > > > > > > > > > > > M=[A*T+T*A'-B*Y-Y'*B'+D*D' (E1*T-E2*Y)'; E1*T-E2*Y -gamma^2*eye(3);];
> > > > > > > > > > > > % set up all constraints
> > > > > > > > > > > > Objective = gamma;
> > > > > > > > > > > > ineq_constr = set(M<0) + set(T>0);
> > > > > > > > > > > > % Minimize gamma^2
> > > > > > > > > > > > yalmipdiagnostics=solvesdp(ineq_constr,Objective)
> > > > > > > > > > > > T=double(T)
> > > > > > > > > > > > Y=double(Y)
> > > > > > > > > > > >
> > > > > > > > > > > > This is the problem I have. I have to minimize gamma, and to find the matrices T and Y. PLEASE help me. I am getting error in this code. I have to solve it by tomorrow night. So, any help would be perfect as soon as possible.Thanks in advance!!

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us