> > sage: numpy.linalg.inv(a)
> >
> > array([[  2.25125019e+15,  -4.50250038e+15,   2.25125019e+15],
> >         [ -4.50250038e+15,   9.00500077e+15,  -4.50250038e+15],
> >         [  2.25125019e+15,  -4.50250038e+15,   2.25125019e+15]])
> 
> I get this:

> sage: scipy.linalg.inv(a)
> 
> array([[ -4.50359963e+15,   9.00719925e+15,  -4.50359963e+15],
>        [  9.00719925e+15,  -1.80143985e+16,   9.00719925e+15],
>        [ -4.50359963e+15,   9.00719925e+15,  -4.50359963e+15]])

Some notes:
Scipy uses numpy as its backend

The numerical noise problem is probably something deeper, because it
doesn't affect only the results of inv(), but others as well, like when
trying to get the autovalues matrix after obtaining the eigenvectors
matrix. In Ipython:

In [34]: from pylab import *

In [35]: k = array([[1,2,4],[4,7,5],[8,7,9]],dtype='float64')

In [36]: lambdas, P = eig(k)

In [37]: dot(P.T,dot(k,P))
Out[37]: 
array([[ 16.47731777,   0.48505536,  -0.12297265],
       [ -4.20177431,  -1.90215152,   0.03248141],
       [ -0.8356282 ,  -0.02547992,   2.42483375]])

In [38]: lambdas
Out[38]: array([ 16.47731777,  -1.90215152,   2.42483375])

One can see the main diagonal fits the autovalues right, but the other
elements should be zero, when one of them gets to a significant value
(-4 is even greater in modulus than two of the autovalues)

Ronan


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to