[Numpy-discussion] Getting non-normalized eigenvectors from generalized eigenvalue solution?

Fahreddın Basegmez mangabasi at gmail.com
Tue Dec 20 21:14:11 EST 2011


If I can get the same response as Matlab I would be all set.


Octave results

>> STIFM
STIFM =

Diagonal Matrix

     1020        0        0        0        0        0
        0     1020        0        0        0        0
        0        0     1020        0        0        0
        0        0        0   102000        0        0
        0        0        0        0   102000        0
        0        0        0        0        0   204000

>> MASSM
MASSM =

Diagonal Matrix

    0.25907          0          0          0          0          0
          0    0.25907          0          0          0          0
          0          0    0.25907          0          0          0
          0          0          0   26.00000          0          0
          0          0          0          0   26.00000          0
          0          0          0          0          0   26.00000

>> [a, b] = eig(STIFM, MASSM)
a =

   0.00000   0.00000   0.00000   1.96468   0.00000   0.00000
   0.00000   0.00000   0.00000   0.00000   1.96468   0.00000
   0.00000   0.00000   1.96468   0.00000   0.00000   0.00000
   0.19612   0.00000   0.00000   0.00000   0.00000   0.00000
   0.00000   0.19612   0.00000   0.00000   0.00000   0.00000
   0.00000   0.00000   0.00000   0.00000   0.00000   0.19612

b =

Diagonal Matrix

   3923.1        0        0        0        0        0
        0   3923.1        0        0        0        0
        0        0   3937.2        0        0        0
        0        0        0   3937.2        0        0
        0        0        0        0   3937.2        0
        0        0        0        0        0   7846.2


Numpy Results

>>> STIFM
array([[   1020.,       0.,       0.,       0.,       0.,       0.],
       [      0.,    1020.,       0.,       0.,       0.,       0.],
       [      0.,       0.,    1020.,       0.,       0.,       0.],
       [      0.,       0.,       0.,  102000.,       0.,       0.],
       [      0.,       0.,       0.,       0.,  102000.,       0.],
       [      0.,       0.,       0.,       0.,       0.,  204000.]])

>>> MASSM

array([[  0.25907,   0.     ,   0.     ,   0.     ,   0.     ,   0.     ],
       [  0.     ,   0.25907,   0.     ,   0.     ,   0.     ,   0.     ],
       [  0.     ,   0.     ,   0.25907,   0.     ,   0.     ,   0.     ],
       [  0.     ,   0.     ,   0.     ,  26.     ,   0.     ,   0.     ],
       [  0.     ,   0.     ,   0.     ,   0.     ,  26.     ,   0.     ],
       [  0.     ,   0.     ,   0.     ,   0.     ,   0.     ,  26.     ]])

>>> a, b = linalg.eig(dot( linalg.pinv(MASSM), STIFM))

>>> a

array([ 3937.15984097,  3937.15984097,  3937.15984097,  3923.07692308,
        3923.07692308,  7846.15384615])

>>> b

array([[ 1.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  1.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  1.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  1.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  1.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  1.]])

On Tue, Dec 20, 2011 at 8:40 PM, Olivier Delalleau <shish at keba.be> wrote:

> Hmm... ok ;) (sorry, I can't follow you there)
>
> Anyway, what kind of non-normalization are you after? I looked at the doc
> for Matlab and it just says eigenvectors are not normalized, without
> additional details... so it looks like it could be anything.
>
>
> -=- Olivier
>
> 2011/12/20 Fahreddın Basegmez <mangabasi at gmail.com>
>
>> I am computing normal-mode frequency response of a mass-spring system.
>>  The algorithm I am using requires it.
>>
>> On Tue, Dec 20, 2011 at 8:10 PM, Olivier Delalleau <shish at keba.be> wrote:
>>
>>> I'm probably missing something, but... Why would you want non-normalized
>>> eigenvectors?
>>>
>>> -=- Olivier
>>>
>>>
>>> 2011/12/20 Fahreddın Basegmez <mangabasi at gmail.com>
>>>
>>>> Howdy,
>>>>
>>>> Is it possible to get non-normalized eigenvectors from
>>>> scipy.linalg.eig(a, b)?  Preferably just by using  numpy.
>>>>
>>>> BTW, Matlab/Octave provides this with its eig(a, b) function but I
>>>> would like to use numpy for obvious reasons.
>>>>
>>>> Regards,
>>>>
>>>> Fahri
>>>>
>>>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20111220/176f7ece/attachment.html>


More information about the NumPy-Discussion mailing list