help-octave
[Top][All Lists]

## Re: matrix close to singular

 From: A S Hodel Subject: Re: matrix close to singular Date: Thu, 16 Nov 2000 10:07:43 -0600 User-agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022

```You're likely already aware of this, but just in case here it is anyway:

Ward's generalized eigenvalue problem scaling procedure (reference below) is
implemented in both MATLAB and Octave (the balance command).  That may help
some.  I think that both qz and MATLAB are using the same LAPACK code
underneath, so the results should be similar between the two.  Neither
octave's qz nor MATLAB's eig automatically perform GEP scaling.

@article{war81,
author    = {Robert C. Ward},
title     = {Balancing the Generalized Eigenvalue Problem},
journal   = {Siam J. Sci. Stat. Comput.},
pages     = {141--152},
year      = {1981},
month     = {June},
volume    = {2},
number    = {2}
}

> on 11/16/00 9:24 AM, Gerald Marewo at address@hidden wrote:

> hi all.
>
> i am working on a problem which involves the generalized eigenvalue
> problem:
>
> given any two square matrices A and B, find matrices X and
> D that satisfy the following equation:
>
> A*X = B*X*D
>
> where D is a diagonal matrix of generalized eigenvalues and
> X is a matrix whose columns are the generalized
> eigenvectors.
>
> on the octave prompt if i type the following
>
> [X,D] = geig(A,B)
>
> where geig.m is a user-defined function (below) that uses the qz
> function
>
> function [V,D] = geig(A,B)
> [AA, BB, Q, Z, V, W, lambda] = qz (A, B);
> D = diag(lambda);
> endfunction
>
> this should be equivalent to the matlab `eig' function.
>
> for certain matrices i get the following warning:
>
> warning: inverse: matrix singular to machine precision, rcond =
> 3.93295e-19
>
> in matlab i get a similar message:
>
> matrix is close to singular or badly scaled. results may be
> inaccurate. rcond = 5.678709e-018
>
> is there a way of going round the problem of getting inaccurate
> results. if there is a way of rescaling the matrix appropriately
>
> any help will be greatly appreciated.

--
A S Hodel Assoc. Prof. Dept Elec. Comp. Eng.  Auburn Univ, AL 36849-5201
(334) 844-1854 Fax -1809 http://www.eng.auburn.edu/þscotte

-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

```