reset()
var('a,b,c,theta')
A = matrix([[0,1,0],[0,0,1],[a,b,c]])
print "matrix A :"
show(A)
I = identity_matrix(3)
show(A-theta*I)
new = det(A-theta*I)
print "characteristic polynomial:"
show(expand(new))
print "given charecteristic polynomial"
show(-theta^3+4*theta^2+5*theta+6)
print "comparing the coefficients a = %d b = %d c = %d"%(6,5,4)

Strang-5.1-13-U (last edited 2010-12-17 09:23:00 by tonylijo)