LA.Ch8.Ex4.NEW.SC.Kim

2027 days ago by seongchan

A = matrix(5,5, [1,2,3,2,1,0,3,4,3,2,0,0,5,2,1,0,0,0,2,4,0,0,0,0,7]) print "A=",; print A print print "Eigenvalues of A" print A.eigenvalues() print print "Eigenvectors of A" print A.eigenvectors_right() print v1 = vector([1,144/113,78/113,48/113,60/113]) v2 = vector([1,8/7,4/7,0,0]) v3 = vector([1,1,0,0,0]) v4 = vector([1,1/2,1,-3/2,0]) v5 = vector([1,0,0,0,0]) P = column_matrix([v1, v2, v3, v4, v5]) print print P print print P^-1*A*P 
       
A= [1 2 3 2 1]
[0 3 4 3 2]
[0 0 5 2 1]
[0 0 0 2 4]
[0 0 0 0 7]

Eigenvalues of A
[7, 5, 3, 2, 1]

Eigenvectors of A
[(7, [
(1, 144/113, 78/113, 48/113, 60/113)
], 1), (5, [
(1, 8/7, 4/7, 0, 0)
], 1), (3, [
(1, 1, 0, 0, 0)
], 1), (2, [
(1, 1/2, 1, -3/2, 0)
], 1), (1, [
(1, 0, 0, 0, 0)
], 1)]


[      1       1       1       1       1]
[144/113     8/7       1     1/2       0]
[ 78/113     4/7       0       1       0]
[ 48/113       0       0    -3/2       0]
[ 60/113       0       0       0       0]

[7 0 0 0 0]
[0 5 0 0 0]
[0 0 3 0 0]
[0 0 0 2 0]
[0 0 0 0 1]
A= [1 2 3 2 1]
[0 3 4 3 2]
[0 0 5 2 1]
[0 0 0 2 4]
[0 0 0 0 7]

Eigenvalues of A
[7, 5, 3, 2, 1]

Eigenvectors of A
[(7, [
(1, 144/113, 78/113, 48/113, 60/113)
], 1), (5, [
(1, 8/7, 4/7, 0, 0)
], 1), (3, [
(1, 1, 0, 0, 0)
], 1), (2, [
(1, 1/2, 1, -3/2, 0)
], 1), (1, [
(1, 0, 0, 0, 0)
], 1)]


[      1       1       1       1       1]
[144/113     8/7       1     1/2       0]
[ 78/113     4/7       0       1       0]
[ 48/113       0       0    -3/2       0]
[ 60/113       0       0       0       0]

[7 0 0 0 0]
[0 5 0 0 0]
[0 0 3 0 0]
[0 0 0 2 0]
[0 0 0 0 1]