If $A$ is a matrix such that $\det(A)=0$, it is easy to get a basis of the kernel of $A$ with NullSpace[A].

Now let's consider a matrix $B$, function of a parameter p. Suppose there exists a $p_0$ such that $\det(B(p_0))=0$ but that in Mathematica, the p0 can only be estimated numerically and I get Det[B[p0]] equals to something small such as $10^{-10}$. Mathematically, B[p0] is invertible... and so NullSpace[B[p0]] yields the empty set.

Question: How could I find the kernel of $B(p_0)$?

  • 3
    $\begingroup$ Use the Tolerance option of NullSpace. $\endgroup$ Oct 8 '14 at 21:02
  • $\begingroup$ @DanielLichtblau TY for you efficient answer. I integrated it in the answer and then accepted it. $\endgroup$
    – anderstood
    Oct 8 '14 at 21:38

The magical words are Singular Value Decomposition. The singular vectors corresponding to small singular values form the kernel. Of course, Singular Value Decomposition is available in Mathematica as SingularValueDecomposition[]. As confirmed by Daniel Lichtblau, the built-in Tolerance option to NullSpace[] does it this exact way.

  • $\begingroup$ Hadn't thought about it... Good. If is OK for you if I edit your answer to include Daniel Lichtblau's comment, which really is a direct (in the sense that it just require to add an option) answer to my question? $\endgroup$
    – anderstood
    Oct 8 '14 at 21:24
  • $\begingroup$ @anderstood Of course, go ahead. $\endgroup$
    – Igor Rivin
    Oct 8 '14 at 21:30
  • $\begingroup$ @anderstood I am sure that is what Mathematica is doing with the Tolerance option. $\endgroup$
    – Igor Rivin
    Oct 8 '14 at 21:31
  • $\begingroup$ Correct. NullSpace uses SVD under the hood. $\endgroup$ Oct 8 '14 at 22:03
  • 1
    $\begingroup$ I am happy to edit my answer, though. $\endgroup$
    – Igor Rivin
    Oct 9 '14 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.