LA Ch8 Exs Prob P3 by 김지윤

328 days ago by jykim

x1=vector([3, 0, 0]);x2=vector([0,3, 4]); x3=vector([0, 4, 3]) A=column_matrix([x1, x2, x3]) print "eigenvalue of A=", A.eigenvalues() print print "eigenvector of A=" print A.right_eigenvectors() z1= A.right_eigenvectors()[0][1][0]/A.right_eigenvectors()[0][1][0].norm() z2= A.right_eigenvectors()[1][1][0]/A.right_eigenvectors()[1][1][0].norm() z3= A.right_eigenvectors()[2][1][0]/A.right_eigenvectors()[2][1][0].norm() P=column_matrix([z1,z2,z3]) Q=P.inverse() D=diagonal_matrix(A.eigenvalues()) print "P=" print P print print "D=" print D print print "A=" print P*D*Q 
       
eigenvalue of A= [7, 3, -1]

eigenvector of A=
[(7, [
(0, 1, 1)
], 1), (3, [
(1, 0, 0)
], 1), (-1, [
(0, 1, -1)
], 1)]
P=
[           0            1            0]
[ 1/2*sqrt(2)            0  1/2*sqrt(2)]
[ 1/2*sqrt(2)            0 -1/2*sqrt(2)]

D=
[ 7  0  0]
[ 0  3  0]
[ 0  0 -1]

A=
[3 0 0]
[0 3 4]
[0 4 3]
eigenvalue of A= [7, 3, -1]

eigenvector of A=
[(7, [
(0, 1, 1)
], 1), (3, [
(1, 0, 0)
], 1), (-1, [
(0, 1, -1)
], 1)]
P=
[           0            1            0]
[ 1/2*sqrt(2)            0  1/2*sqrt(2)]
[ 1/2*sqrt(2)            0 -1/2*sqrt(2)]

D=
[ 7  0  0]
[ 0  3  0]
[ 0  0 -1]

A=
[3 0 0]
[0 3 4]
[0 4 3]