Solution for a homogeneous equation using null space
Afficher commentaires plus anciens
I have a homogeneous equation group as follows
A*b=0;where A is a 8 by 8 matrix, b is a 8 by 1 vector.
I have calculated that det(A)=5.141078303798737e-010, close to zero, so i use null(A) to find out the solution b, however i got a result like "Empty matrix: 8-by-0", I have checked the rank of the matrix A and got Rank(A)=8, since the determinant of A is close to zero, i thought that rank(A) should be smaller than 8 and I should be able to use null space to solve b. Any one can suggest a way to solve b?
Thanks.
Mike
5 commentaires
Wayne King
le 22 Fév 2012
Can you please post your matrix since it is only 8x8
harry wang
le 22 Fév 2012
Wayne King
le 22 Fév 2012
Why can't you post this as MATLAB code??? Just use format short.
Sean de Wolski
le 22 Fév 2012
post it as a full matrix so Wayne can copy and paste it:
full(A)
Wayne King
le 22 Fév 2012
Oh, thank you Sean!! sorry I don't why it didn't occur to me that was sparse(A)
Réponses (6)
John D'Errico
le 22 Fév 2012
Sigh. The determinant is a TERRRRRRRRRRRIBLE way to check for singularity. Godawful. A miserable computational tool, good only for homework problems. Did I say it was bad? Three times I've said it, so this must be true.
Do you need an example? Compute the determinant of
A = eye(8);
det(A)
ans =
1
Yes, it is clearly nonsingular, and det predicted that. Since you used 1e-10 as a measure that a matrix must be singular, can we modify A just so subtly and get a determinant that small? How about this?
det(A*.05)
ans =
3.9063e-11
Oops. I could have sworn that this matrix is also diagonal, just with 0.05 elements down the diagonal. Surely this is just as nonsingular as the original identity matrix was.
Gosh. I wonder why I should think it is singular just because det says so? I suppose if I go to extremes I can get a true underflow zero.
det(A*1e-50)
ans =
0
Is that matrix any more singular than the others?
Why do people insist on using det?
3 commentaires
harry wang
le 22 Fév 2012
Walter Roberson
le 23 Fév 2012
John, I guess nobody ever expects the det() to be a boojum.
John D'Errico
le 23 Fév 2012
Don't use det. Period. PERIOD. PERIOD! Need I repeat myself? Under NO circumstances would I EVER advise that someone use det to test for singularity.
Rank is a good choice. An svd is a good choice, but of course rank is based on the svd.
harry wang
le 23 Fév 2012
1 commentaire
Dipendra Subedi
le 21 Mar 2021
I have the same issue. The null(A) returns empty matrix (specially when used inside a loop which is very strange) but the above implementation works fine (in and out of the loop).
harry wang
le 22 Fév 2012
Wayne King
le 22 Fév 2012
Hi Harry, I get a rank of 6 for this matrix and therefore expect the nullspace to have dimension 2. I get the following ONB for the nullspace:
-0.000000000000020 -0.756171511092082
0.000000000000013 0.434311342718816
0.339775797713826 -0.065890507565062
-0.339775797713829 -0.065890507565044
-0.756171511092085 0.000000000000021
0.434311342718811 -0.000000000000010
-0.065890507565062 -0.339775797713825
-0.065890507565044 0.339775797713829
1 commentaire
harry wang
le 22 Fév 2012
harry wang
le 22 Fév 2012
0 votes
1 commentaire
Wayne King
le 23 Fév 2012
I see what you mean, but do you really need this kind of precision in your matrix?
harry wang
le 22 Fév 2012
0 votes
Catégories
En savoir plus sur Linear Algebra dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!