213 - A10.5 - Eigensystems

1101 days ago by Professor213

John Travis

Mississippi College

A = matrix([[0, 4], [-1, 0]]) Values = A.eigenvalues() for value in Values: show(value) 
       

                                
                            

                                
A = matrix([[1, 3], [3, 1]]) Vectors = A.eigenvectors_left() for vector in Vectors: show(vector[1]) 
       

                                
                            

                                
D, V = A.eigenmatrix_right() print "D =" show(D) print "V =" show(V) print "VD =" show(V*D) print "AV =" show(A*V) print "Testing AV = VD" V*D == A*V 
       
D =
V =
VD =
AV =
Testing AV = VD
True
D =
V =
VD =
AV =
Testing AV = VD
True
# Eigenvalues with multiplicity > 1 still yields generalized eigenvector A = matrix(QQ,[[1, -3, 2, -1], [-3, 9, -6, 3], [2, -6, 4, -2], [-1, 3, -2, 1]]) D, V = A.eigenmatrix_right() print "D =" show(D) print "V =" show(V) print "VD =" show(V*D) print "AV =" show(A*V) print "Testing AV = VD" V*D == A*V 
       
D =
V =
VD =
AV =
Testing AV = VD
True
D =
V =
VD =
AV =
Testing AV = VD
True
# Canonical example of trouble if eps is close to machine roundoff. eps = 10^(-15) A = matrix(QQ,[[3, -2, -.9, 2*eps],[-2, 4, 1, -1*eps],[-1*eps/4, eps/2, -1, 0],[-.5, -.5, .1, 1]]) show(A) D, V = A.eigenmatrix_right() print "D =" show(D) print "V =" show(V) print "VD =" show(V*D) print "AV =" show(A*V) 
       
D =
V =
VD =
AV =
D =
V =
VD =
AV =
A = random_matrix(RDF,500) Values = A.eigenvalues() w = [(i, abs(Values[i])) for i in range(len(Values))] # magnitude of each eigenvalue only show(points(Values)) show(points(w)) 
       

show(Values)