Hi,

I have a question about solving a sparse linear system with

a complex system matrix.

The system I am solving is of the form

A = (J + 1i * w * M)

A * x = b

where J and M are sparse real matrices, b is a real vector and

w is a (small) real number.

J is nonsingular, M is singular, A can be proven to be invertible

(in exact arithmetics) for any value of w.

What I am experiencing is the following: if I use mldivide I get

>> A = (J + 1i * w * M);

>> x1 = A \ res;

warning: matrix singular to machine precision, rcond = 1.49212e-27

and the contents of x1 are just garbage while, if I perform LU first, I get:

>> [L, U, P, Q, R] = lu (A);

>> x2 = Q * (U \ (L \ (P * (R \ res))));

and x2 is the physically expected result.

Can anyone comment about why the the two approaches differ?

What are the underlying library methods invoked in the two cases?

Thanks,

c.

P.S. In case anyone would like to try the above examples, the matirces are available here:

http://www1.mate.polimi.it/~carlo/out.mat_______________________________________________

Help-octave mailing list

[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave