--------  --------
Тема: Re: [sympy] Problem calculating eigenvectors
Дата: Sat, 24 Mar 2012 13:33:30 -0500
От: Alan Macdonald <[email protected]>
Кому: Alexey U. Gudchenko <[email protected]>

So it is a bug in Sympy. Doesn't seem very fixable. My matrix example
shows that even simple calculations can go wrong if numbers are
calculated symbolically. (I realize that my example is not GA, but the
point still stands.) Thus it seems to me that you must provide, if at
all possible, a way to tell your module to calculate numbers as floating
points with a specified precision.

On 12/03/24 1:11 PM, Alexey U. Gudchenko wrote:
>
> 24.03.2012 18:13, Alan Bromborsky пишет:
>> If I run this -
>>
>> from sympy import *
>>
>>
>> M = Matrix([ [1, .6, .6], [.6, 1, .9], [.6, .9, 1] ]) print 'M =',
>> M print 'eig values =',M.eigenvals() print 'eig vectors
>> =',M.eigenvects()
>>
>> I get -
>>
>> M = [  1, 0.6, 0.6] [0.6,   1, 0.9] [0.6, 0.9,   1] eig values =
>> {0.489531364385073: 1, 2.41046863561493: 1, 0.100000000000000: 1}
>> eig vectors = Traceback (most recent call last): File
>> "EigenTest.py", line 8, in<module> print 'eig vectors
>> =',M.eigenvects() File
>>
"/usr/local/lib/python2.7/dist-packages/sympy-0.7.1_git-py2.7.egg/sympy/matrices/matrices.py",
>>
>>
>>
line 2969, in eigenvects
>> raise NotImplementedError("Can't evaluate eigenvector for
>> eigenvalue %s" % r) NotImplementedError: Can't evaluate
>> eigenvector for eigenvalue 0.489531364385073
>>
>> It runs right away (no delay) and gets the correct eigenvalues, but
>> cannot calculate the eigenvectors.  Any suggestions?
>>
>> The answer from Maple is -
>>
>> [2.410468637, 1, {vector([.5154991337, .6059127988,
>> .6059128004])}], [.4895313645, 1, {vector([-.8568900997,
>> .3645129341, .3645129324])}], [.999999991e-1, 1,
>> {vector([.1078e-8, .7071067798, -.7071067815])}]
>>
>>
>
> It is related with this open issue:
>
> http://code.google.com/p/sympy/issues/detail?id=2193
>
> Alexey.
>
>


-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
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/sympy?hl=en.

Reply via email to