MATLAB Newsgroup

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!!

(Johan Lofberg)

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!!

"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!!

"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!!

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!!

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!!

"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!!

"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!!

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!!

"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!!

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!!

"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!!

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!!

"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!!

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!!

"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!!

You can think of your watch list as threads that you have bookmarked.

You can add tags, authors, threads, and even search results to your watch list. This way you can easily keep track of topics that you're interested in. To view your watch list, click on the "My Newsreader" link.

To add items to your watch list, click the "add to watch list" link at the bottom of any page.

To add search criteria to your watch list, search for the desired term in the search box. Click on the "Add this search to my watch list" link on the search results page.

You can also add a tag to your watch list by searching for the tag with the directive "tag:tag_name" where tag_name is the name of the tag you would like to watch.

To add an author to your watch list, go to the author's profile page and click on the "Add this author to my watch list" link at the top of the page. You can also add an author to your watch list by going to a thread that the author has posted to and clicking on the "Add this author to my watch list" link. You will be notified whenever the author makes a post.

To add a thread to your watch list, go to the thread page and click the "Add this thread to my watch list" link at the top of the page.

*No tags are associated with this thread.*

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.

Got questions?

Get answers.

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

Learn moreDiscover what MATLAB ^{®} can do for your career.

Opportunities for recent engineering grads.

Apply TodayThe newsgroups are a worldwide forum that is open to everyone. Newsgroups are used to discuss a huge range of topics, make announcements, and trade files.

Discussions are threaded, or grouped in a way that allows you to read a posted message and all of its replies in chronological order. This makes it easy to follow the thread of the conversation, and to see what’s already been said before you post your own reply or make a new posting.

Newsgroup content is distributed by servers hosted by various organizations on the Internet. Messages are exchanged and managed using open-standard protocols. No single entity “owns” the newsgroups.

There are thousands of newsgroups, each addressing a single topic or area of interest. The MATLAB Central Newsreader posts and displays messages in the comp.soft-sys.matlab newsgroup.

**MATLAB Central**

You can use the integrated newsreader at the MATLAB Central website to read and post messages in this newsgroup. MATLAB Central is hosted by MathWorks.

Messages posted through the MATLAB Central Newsreader are seen by everyone using the newsgroups, regardless of how they access the newsgroups. There are several advantages to using MATLAB Central.

**One Account**

Your MATLAB Central account is tied to your MathWorks Account for easy access.

**Use the Email Address of Your Choice**

The MATLAB Central Newsreader allows you to define an alternative email address as your posting address, avoiding clutter in your primary mailbox and reducing spam.

**Spam Control**

Most newsgroup spam is filtered out by the MATLAB Central Newsreader.

**Tagging**

Messages can be tagged with a relevant label by any signed-in user. Tags can be used as keywords to find particular files of interest, or as a way to categorize your bookmarked postings. You may choose to allow others to view your tags, and you can view or search others’ tags as well as those of the community at large. Tagging provides a way to see both the big trends and the smaller, more obscure ideas and applications.

**Watch lists**

Setting up watch lists allows you to be notified of updates made to postings selected by author, thread, or any search variable. Your watch list notifications can be sent by email (daily digest or immediate), displayed in My Newsreader, or sent via RSS feed.

- Use a newsreader through your school, employer, or internet service provider
- Pay for newsgroup access from a commercial provider
- Use Google Groups
- Mathforum.org provides a newsreader with access to the comp.soft sys.matlab newsgroup
- Run your own server. For typical instructions, see: http://www.slyck.com/ng.php?page=2