Vous êtes sur la page 1sur 7

15BCE0342

VAIBHAV KHANDELWAL FACULTY: PROF SUBRAMANYAM REDDY

EXPERIMENT 1a
Eigenvalues and Eigenvectors
THEORY:
Eigenvalues are special set of scalars associated with a linear system of equations (i.e., a matrix
equation) that are sometimes also known as characteristic roots, characteristic values, proper
values, or latent roots. They satisfy the following equation for a square matrix =
Where is the eigenvalue and is the eigenvector corresponding to it. This
is the characteristic equation( ) = 0
Properties of eigenvalues:

If is an eigenvector of , then is also an eigenvector.


= 0, only if determinant of is zero.
If is orthogonal, the eigenvalues are the diagonal elements.
and have the same eigenvalues.
Eigenvalues of a symmetric matrix are always real.
If is a triangular matrix, then the diagonal elements are the eigenvalues.
Sum of the eigenvalues is the trace of the matrix.
Product of the eigenvalues is the determinant of the matrix.

LIST OF COMMANDS:
1. eig(A)- returns a column vector containing the eigenvalues of square matrix A.
2. [V, D] = eig(A) returns diagonal matrix D of eigenvalues and matrix V whose columns are the
corresponding right eigenvectors, so that A*V = V*D.
3. r = roots(p) returns the roots of the polynomial represented by p as a column vector.

4. diag - Create diagonal matrix or get diagonal elements of matrix


5. d = size(X) returns the sizes of each dimension of array X in a vector, d, with ndims(X)
elements.

15BCE0342

VAIBHAV KHANDELWAL FACULTY: PROF SUBRAMANYAM REDDY


Problem 1- If =

a)
b)
c)
d)
e)
f)
g)

, find:

Characteristic polynomial of A
Roots of the characteristic polynomial of A
Eigenvalues of A
Eigenvectors of A
Eigenvalues of A-1
Eigenvalues of A
Eigenvalues of B = A2 + 3A + 2I

SOLUTION:
>> a = [3 0 -1; 0 1 0; 2 0 0] a
=

0 -1

>> poly(a) ans


=

1 -4

5 -2

>> roots(poly(a)) ans


=

2.0000 + 0.0000i
1.0000 + 0.0000i
1.0000 - 0.0000i

15BCE0342

VAIBHAV KHANDELWAL FACULTY: PROF SUBRAMANYAM REDDY

>> [v, d] = eig(a) v


=

0.7071 0.4472
0

0 1.0000
0.7071 0.8944

d=

>> [v, d] = eig(inv(a)) v


=

-0.7071 -0.4472
0

0 1.0000

-0.7071 -0.8944

d=

0.5000

0 1.0000

0 1.0000

>> [v, d] = eig(transpose(a)) v


=

0.8944 -0.7071
0

0 1.0000

15BCE0342

VAIBHAV KHANDELWAL FACULTY: PROF SUBRAMANYAM REDDY

-0.4472 0.7071

d=

>> b = a*a + 3*a + 2*eye(3) b


=

18

0 -6

12

>> [v, d] = eig(b) v


=

0.7071 0.4472
0

0 1.0000

0.7071 0.8944

d=

12

EXERCISE 2- If =
, find:

15BCE0342
a)
b)
c)
d)
e)
f)
g)

VAIBHAV KHANDELWAL FACULTY: PROF SUBRAMANYAM REDDY

Characteristic polynomial of A
Roots of the characteristic polynomial of A
Eigenvalues of A
Eigenvectors of A
Eigenvalues of A-1
Eigenvalues of A
Eigenvalues of B = A2 + 3A + 2I

SOLUTION
>> a = [1 2 1; 6 -1 0; -1 -2 -1]
a=

6 -1

-1 -2 -1

>> poly(a) ans


=

1.0000 1.0000 -12.0000 0.0000

>> roots(poly(a)) ans


=

-4.0000
3.0000
0.0000

>> [v, d] = eig(a) v


=

0.4082 -0.4851 -0.0697


-0.8165 -0.7276 -0.4180
-0.4082 0.4851 0.9058

15BCE0342

VAIBHAV KHANDELWAL FACULTY: PROF SUBRAMANYAM REDDY

d=

-4.0000

0 3.0000

0 0.0000

>> [v, d] = eig(inv(a))


Warning: Matrix is singular to working precision.
Error using eig
Input to EIG must not contain NaN or Inf.

>> [v, d] = eig(transpose(a)) v


=

-0.7252 0.9117 0.7071


0.6447 0.3419 0.0000
0.2417 0.2279 0.7071

d=

-4.0000

0 3.0000

0 -0.0000

>> b = a*a + 3*a + 2*eye(3) b


=

17

18

12

3
6

-15 -4 -1

15BCE0342

VAIBHAV KHANDELWAL FACULTY: PROF SUBRAMANYAM REDDY

>> [v, d] = eig(b) v


=

-0.4851 -0.4082 -0.0697


-0.7276 0.8165 -0.4180
0.4851 0.4082 0.9058

d=

20.0000

0 6.0000

0 2.0000

Vous aimerez peut-être aussi