Forcing real eigenvalues with 'eigs'?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Forcing real eigenvalues with 'eigs'?

Søren Hauberg
Hi All

Is it possible to force 'eigs' to produce real eigenvalues? I'm
computing eigenvalues of a real symmetric matrix, but I'm still getting
complex eigenvalues (numerical issues I guess), so it would be nice if I
could force them into being real.

Søren

_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Forcing real eigenvalues with 'eigs'?

Francesco Potortì
>Is it possible to force 'eigs' to produce real eigenvalues? I'm
>computing eigenvalues of a real symmetric matrix, but I'm still getting
>complex eigenvalues (numerical issues I guess), so it would be nice if I
>could force them into being real.

Have you looked at the numbers?  If the imaginary part is very small
compared to the real one, you can just discard it using real().  If not,
you may have stability problems.

--
Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa         Email: [hidden email]
(entrance 20, 1st floor, room C71)     Web:   http://fly.isti.cnr.it/
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Forcing real eigenvalues with 'eigs'?

Søren Hauberg
tor, 22 01 2009 kl. 13:35 +0100, skrev Francesco Potortì:
> >Is it possible to force 'eigs' to produce real eigenvalues? I'm
> >computing eigenvalues of a real symmetric matrix, but I'm still getting
> >complex eigenvalues (numerical issues I guess), so it would be nice if I
> >could force them into being real.
>
> Have you looked at the numbers?  If the imaginary part is very small
> compared to the real one, you can just discard it using real().  If not,
> you may have stability problems.

Yeah, I can just discard them using real (they are indeed quite small).
It just seems to me that it would be better if I could constraint 'eigs'
to working only with real values.

Søren

_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Forcing real eigenvalues with 'eigs'?

Jaroslav Hajek-2
On Thu, Jan 22, 2009 at 1:39 PM, Søren Hauberg <[hidden email]> wrote:

> tor, 22 01 2009 kl. 13:35 +0100, skrev Francesco Potortì:
>> >Is it possible to force 'eigs' to produce real eigenvalues? I'm
>> >computing eigenvalues of a real symmetric matrix, but I'm still getting
>> >complex eigenvalues (numerical issues I guess), so it would be nice if I
>> >could force them into being real.
>>
>> Have you looked at the numbers?  If the imaginary part is very small
>> compared to the real one, you can just discard it using real().  If not,
>> you may have stability problems.
>
> Yeah, I can just discard them using real (they are indeed quite small).
> It just seems to me that it would be better if I could constraint 'eigs'
> to working only with real values.
>

I think this is a bug - eigs should discover a symmetric case.


--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz

_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Forcing real eigenvalues with 'eigs'?

Søren Hauberg
tor, 22 01 2009 kl. 14:19 +0100, skrev Jaroslav Hajek:

> On Thu, Jan 22, 2009 at 1:39 PM, Søren Hauberg <[hidden email]> wrote:
> > tor, 22 01 2009 kl. 13:35 +0100, skrev Francesco Potortì:
> >> >Is it possible to force 'eigs' to produce real eigenvalues? I'm
> >> >computing eigenvalues of a real symmetric matrix, but I'm still getting
> >> >complex eigenvalues (numerical issues I guess), so it would be nice if I
> >> >could force them into being real.
> >>
> >> Have you looked at the numbers?  If the imaginary part is very small
> >> compared to the real one, you can just discard it using real().  If not,
> >> you may have stability problems.
> >
> > Yeah, I can just discard them using real (they are indeed quite small).
> > It just seems to me that it would be better if I could constraint 'eigs'
> > to working only with real values.
> >
>
> I think this is a bug - eigs should discover a symmetric case.

If I understand the documentation correctly it should even be possible
to force the problem to be treated as symmetric by passing

  struct ("issym", true)

as an option. This, however, still produced complex results.

Søren

_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Forcing real eigenvalues with 'eigs'?

David Bateman-2
Søren Hauberg wrote:

> tor, 22 01 2009 kl. 14:19 +0100, skrev Jaroslav Hajek:
>  
>> On Thu, Jan 22, 2009 at 1:39 PM, Søren Hauberg <[hidden email]> wrote:
>>    
>>> tor, 22 01 2009 kl. 13:35 +0100, skrev Francesco Potortì:
>>>      
>>>>> Is it possible to force 'eigs' to produce real eigenvalues? I'm
>>>>> computing eigenvalues of a real symmetric matrix, but I'm still getting
>>>>> complex eigenvalues (numerical issues I guess), so it would be nice if I
>>>>> could force them into being real.
>>>>>          
>>>> Have you looked at the numbers?  If the imaginary part is very small
>>>> compared to the real one, you can just discard it using real().  If not,
>>>> you may have stability problems.
>>>>        
>>> Yeah, I can just discard them using real (they are indeed quite small).
>>> It just seems to me that it would be better if I could constraint 'eigs'
>>> to working only with real values.
>>>
>>>      
>> I think this is a bug - eigs should discover a symmetric case.
>>    
>
> If I understand the documentation correctly it should even be possible
> to force the problem to be treated as symmetric by passing
>
>   struct ("issym", true)
>
> as an option. This, however, still produced complex results.
>
> Søren
>  
Is the matrix real or complex.. If the matrix is complex, as the code
stands the symmetry is ignored..

D.

--
David Bateman                                [hidden email]
35 rue Gambetta                              +33 1 46 04 02 18 (Home)
92100 Boulogne-Billancourt FRANCE            +33 6 72 01 06 33 (Mob)

_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Forcing real eigenvalues with 'eigs'?

Søren Hauberg
tor, 22 01 2009 kl. 22:37 +0100, skrev David Bateman:
> Is the matrix real or complex.. If the matrix is complex, as the code
> stands the symmetry is ignored..

It is real and symmetric.

Søren

_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave