[SciPy-user] det(A-\lambda B) is identically zero

Nils Wagner nwagner at mecha.uni-stuttgart.de
Fri Feb 13 07:30:36 EST 2004


Hi all,

Please find attached a small example for a singular pencil
A-\lambda B. det(A-\lambda B) is identically zero.
However linalg.eig(A,B) computes certain eigenvalues.
although \lambda can be chosen arbitrarely.

There should be at leat a warning in such a case.

Any comment or suggestion ?

Nils

from scipy import *
A = array((
[0,7,-1,1],
[4,2,3,1],
[2,0,0,2],
[6,9,2,4]))
B = array((
[3,4,1,2],
[-1,3,5,-6],
[1,0,0,1],
[15,7,6,9]))
print 'A'
print A
print 'B'
print B
#
# Eigenvalue problem
#
w,vr = linalg.eig(A,B)
for i in w:
 print i
#
# det(A-\lambda B) is identically zero
#
for l in arange(0,10.,0.1):
  d = linalg.det(A-l*B)
  print l,d



More information about the SciPy-User mailing list