help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

question about complex sparse linear algebra


From: c.
Subject: question about complex sparse linear algebra
Date: Mon, 13 Nov 2017 02:34:54 +0100

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]