[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Octave hangs forever trying to invert singular matrix
From: |
Vic Norton |
Subject: |
Re: Octave hangs forever trying to invert singular matrix |
Date: |
Tue, 22 Dec 2009 16:11:57 -0500 |
A singular value decomposition,
[U, S, V] = svd(A, 1);
shows that your matrix has effective rank 478. For sig = diag(S),
sig(1) = 3.6494
...
sig(478) = 0.020490
sig(479) = 8.3016e-17
sig(480) = 3.5993e-17
Even worse, the vector
onev = ones(480, 1)
essentially lies in the 2-dimensional space corresponding to the two
small singular values. If
Z = U(:, [479, 480]);
onev = ones(480, 1);
onez = U(:, [479, 480]) * (U(:, [479, 480])' * onev);
Then
norm(onez - onev)/norm(onev) = 9.4929e-15.
I don't see how any numerical routine can give you a reasonable answer.
This is a 0/0 problem.
Regards,
Vic
On Dec 22, 2009, at 1:19 PM, Carlo de Falco wrote:
>
> On 22 Dec 2009, at 19:17, Carlo de Falco wrote:
>
>> Hi,
>>
>> I have a 480x480 sparse matrix of rank 479
>> trying to solve
>>
>> A\ones(480,1)
>>
>> makes matlab throw a warning and return garbage
>>
>>>> A\ones(480,1)
>> Warning: Matrix is close to singular or badly scaled.
>> Results may be inaccurate. RCOND = 3.815118e-20.
>>
>> ans =
>>
>> 1.0e+17 *
>>
>> -0.2637
>> -0.2637
>> -0.2637
>> -0.2637
>> -0.2637
>> -0.2637
>> -0.2637
>>
>> on the other hand Octave hangs forever.
>> Is there a way to check before-hand whether the system can be solved
>> to prevent Octave from going into "Guru meditation mode"?
>> Is this to be considered a bug?
>>
>> I am using Thomas' 3.2.3 binary on Mac OS X.
>> c.
>
> If anyone wants to try with the particular matrix that showed the
> problem for me, it can be found here:
> http://mox.polimi.it/~carlo/calnum/A.mat
>
> c.
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave