lcs assignment 03

Upload: umair-zulfiqar

Post on 05-Oct-2015

7 views

Category:

Documents


0 download

DESCRIPTION

Rugh

TRANSCRIPT

  • 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))

  • MATLAB Code:

    syms t A=[0 1; -1 -2]; E=eig(A); if real(E(1,1))

  • 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 0]

    [-1 2 -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