Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Student Name: Pawar Sakshi Sanjay

Class: S.Y.BCS
Roll number: 5039 batch :B
Practical Number:-8.
Practical name:- Eigen value & Eigen vector -I

Q.1 Find Eigen values of following matrices.


(i)
from sympy import*
A=Matrix([[1,2,2],[2,1,2],[2,2,1]])
A.eigenvals()
#Output:-{5: 1, -1: 2}
(ii)
from sympy import*
A=Matrix([[1,1,1],[0,1,1],[0,0,1]])
A.eigenvals()
#Output:-{1: 3}
(iii)
from sympy import*
P=Matrix([[0,1],[-1,0]])
P.eigenvals()
#Output:-{-I: 1, I: 1}
Q.2 Find Eigen values & Eigen vectors of following matrices
(i)
from sympy import*
C=Matrix([[5,6,2],[0,-1,-8],[1,0,-2]])
C.eigenvals()
#Output:-{-4: 1, 3: 2}
C.eigenvects()
#Output:-
[(-4, 1, [Matrix([
[ -2],
[8/3],
[ 1]])]), (3, 2, [Matrix([
[ 5],
[-2],
[ 1]])])]

(ii)
from sympy import*
D=Matrix([[3,0],[8,-1]])
D.eigenvals()
#Output:-{3: 1, -1: 1}
D.eigenvects()
#Output:-[(-1, 1, [Matrix([
[0],
[1]])]), (3, 1, [Matrix([
[1/2],
[ 1]])])]

(iii)
from sympy import*
S=Matrix([[3,0,-5],[(1/5),-1,0],[1,1,-2]])
S.eigenvals()
#Output:-{1.4142135623731 - 1.78029912598574e-63*I: 1, -
1.4142135623731 - 1.81065963053672e-63*I: 1, 2.77555756156289e-
17 + 9.98388914520459e-64*I: 1}

S.eigenvects()
#Output:-
[(1.4142135623731 - 1.78029912598574e-63*I, 1, [Matrix([
[ -0.198184320337892 - 0.929352960538497*I],
[-0.0164181266667297 - 0.0769901200973266*I],
[ -0.0628556014684269 - 0.294751064118072*I]])]), (-
1.4142135623731 - 1.81065963053672e-63*I, 1, [Matrix([
[ 0.478232331810331 - 0.701099674876074*I],
[-0.230910996284362 + 0.338520868732237*I],
[0.422203929008495 - 0.618960738682667*I]])]),
(2.77555756156289e-17 + 9.98388914520459e-64*I, 1, [Matrix([
[ -0.80698794036204 + 0.330321527927652*I],
[-0.161397588072408 + 0.0660643055855303*I],
[ -0.484192764217224 + 0.198192916756591*I]])])]

You might also like