ch.8 problem.11

330 days ago by g1.kjiwon

A=matrix(2, 2, [1, 2, 2, 4]) print A.eigenvalues() 
       
[5, 0]
[5, 0]
print A.eigenvectors_right() 
       
[(5, [
(1, 2)
], 1), (0, [
(1, -1/2)
], 1)]
[(5, [
(1, 2)
], 1), (0, [
(1, -1/2)
], 1)]
G=matrix([[1, 2], [1, -1/2]]) # Constructing a matrix whose columns are eigenvectors P=matrix([1/G.row(j).norm()*G.row(j) for j in range(0,2)]) # Normalizing the row vectors (The orthogonality follows from the # fact that the eigenvalues are distinct) P=P.transpose() # Constructing a matrix whose columns are # orthonormal eigenvectors print P 
       
[ 1/5*sqrt(5)  2/5*sqrt(5)]
[ 2/5*sqrt(5) -1/5*sqrt(5)]
[ 1/5*sqrt(5)  2/5*sqrt(5)]
[ 2/5*sqrt(5) -1/5*sqrt(5)]
var('x, y') f=x^2+4*x*y+4*y^2+6*x+2*y-25 implicit_plot(f==0, (x,-10,10), (y,-10,10))