Solution for a homogeneous equation using null space
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Sean de Wolski
el 22 de Feb. de 2012
post it as a full matrix so Wayne can copy and paste it:
full(A)
Wayne King
el 22 de Feb. de 2012
Oh, thank you Sean!! sorry I don't why it didn't occur to me that was sparse(A)
Respuestas (6)
John D'Errico
el 22 de Feb. de 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 comentarios
John D'Errico
el 23 de Feb. de 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
el 23 de Feb. de 2012
1 comentario
Dipendra Subedi
el 21 de Mzo. de 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).
Wayne King
el 22 de Feb. de 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
harry wang
el 22 de Feb. de 2012
1 comentario
Wayne King
el 23 de Feb. de 2012
I see what you mean, but do you really need this kind of precision in your matrix?
Ver también
Categorías
Más información sobre Linear Algebra en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!