You are on page 1of 6

Question

Apply theorem 7.11 on Exercise 5.2

7.11 Theorem
Given nXn matrix A, if M and Q are symmetric, positive definite, nXn matrices satisfying
QA + ATQ = -M, then all eigenvalues of A have negative real parts. Conversely if all
eigenvalues of A have negative real parts, then for each symmetric nXn matrix M there exist
a unique solution of QA + ATQ = -M given by

Furthermore if M is positive definite, then Q is positive definite.

Exercise 5.2

Solution

Implementing the converse part of the theorem first:


1.

If all eigenvalues of A have negative real parts, then for each symmetric
nXn matrix M there exist a unique solution of QA + ATQ = -M given by

Answer:
Lets generate a random symmetric Matrix M and check whether Q has a unique
solution.
Symmetric matrix would be generated by exploiting the property M+MT is always a
symmetric matrix.

MATLAB Code
syms t
A=[0 1; -1 -2];
E=eig(A);
if real(E(1,1))<0&&real(E(2,1)<0)
display('All eigenvalues have negative real parts ');
% Implementing expression for Q
B=A.';
C=expm((A*t));
D=expm((B*t));
M=rand(2);
M=M+M.'; % M+ trM is always a symmetric Matrix
X=D*M*C;
Q=int(X,0,inf);

%Check if the Q matrix is symmetric


[m,n]=size(Q);
if m==n,
display('Q is a Symmetric Matrix ');
end
else display('All eigenvalues donot have negetive real parts ');

end

Output
All eigenvalues have negative real parts
Q is a Symmetric Matrix

2. Furthermore if M is positive definite, then Q is positive definite.


Let M=[1 ]
[ ]

MATLAB Code:
syms t
A=[0 1; -1 -2];
E=eig(A);
if real(E(1,1))<0&&real(E(2,1)<0)
display('All eigenvalues have negative real parts ');

B=A.';
C=expm((A*t));
D=expm((B*t));
M=[1 .5; .5 .5];
%Check if the matrix is symmetric
[m,n]=size(M);
if m~=n,
error('M is not Symmetric');
end
%Test for positive definiteness
x=1; %Flag to check for positiveness
for i=1:m
subM=M(1:i,1:i); %Extract upper left kxk submatrix
if(det(subM)<=0); %Check if the determinent of the kxk submatrix is
+ve
x=0;
break;
end
end
if x
display('M Matrix is Positive definite');
else
display('M Matrix is NOT positive definite');
end
X=D*M*C;
Q=int(X,0,inf)
M=Q;
%Check if the matrix is symmetric
[m,n]=size(M);
if m~=n,
error('Q is not Symmetric');
end
%Test for positive definiteness
x=1; %Flag to check for positiveness
for i=1:m
subM=M(1:i,1:i); %Extract upper left kxk submatrix
if(det(subM)<=0); %Check if the determinent of the kxk submatrix is
+ve
x=0;
break;
end
end
if x

display('Q Matrix is also Positive definite');


else
display('Q Matrix is NOT positive definite');
end
else display('All eigenvalues donot have negative real parts ');
end

Output
All eigenvalues have negative real parts
M Matrix is Positive definite
Q=
[ 7/8, 1/2]
[ 1/2, 3/8]
Q Matrix is also Positive definite

Implementing : Given nXn matrix A, if M and Q are symmetric,


positive definite, nXn matrices satisfying QA + ATQ = -M, then
all eigenvalues of A have negative real parts
MATLAB Code
Q=[7/8 1/2; 1/2 3/8];
M=[1 1/2 ; 1/2 1/2];
A=[0 1; -1 -2];
X=(Q*A)+((A.')*Q);
Y=-M;
if X==Y
display('Equation QA+ATQ=-M holds');
else display('Equation QA+ATQ=-M does not hold');
end

Output
Equation QA+ATQ=-M holds

The same codes will be used for this question also. Just the values of A and M would
be changed. So outputs would be shown.

Output 1:
All eigenvalues have negative real parts
Q is a Symmetric Matrix

Choose M=[ 2 -1
[-1 2
[0 -1

0]
-1]
2]

Output 2:
All eigenvalues have negative real parts
M Matrix is Positive definite
Q=
[ 3/2, -3/4, 1/2]
[ -3/4, 1, -1/2]
[ 1/2, -1/2, 1]
Q Matrix is also Positive definite

Output 3
Equation QA+ATQ=-M holds

Output1
All eigenvalues have negative real parts

Q is a Symmetric Matrix

Choose
M=
2
1
1
3

1
2
2
1

1
2
9
1

3
1
1
7

Output2
All eigenvalues have negative real parts
M Matrix is Positive definite
Q=
[ 1, 1/3, 1/2, 7/4]
[ 1/3, 1/2, 2/3, 5/9]
[ 1/2, 2/3, 9/2, 11/4]
[ 7/4, 5/9, 11/4, 25/4]
Q Matrix is also Positive definite

Output 3
Equation QA+ATQ=-M holds

You might also like