1
votes

In my case, I want to solve a underdetermined equation system, A*λ = b, with the JacobiSVD solver from Eigen (3.0.12).

The linear equation system has following structure in my C++ program:

Coefficient matrix (A):

       0.6           5.68434e-20      -0.2
       5.68434e-20   7.06819e-39      -4.26326e-20
       -0.2          -4.26326e-20     0.4

RHS (b):

       -1.962
       2.78817e-19
       -5.886

Lambda:

       -9.81
       3.94467e+19         <---------- error (Where does this come from?)
       -19.62
  • The rank of matrix A is - Rank(A) = 2
  • So the matrix has No Full rank. Therefore, A is singular and not invertible.
  • The condition is - cond(A) = Inf
  • For solving A*λ = b, I used the SVD decomposition method from Eigen (JacobiSVD)

I also verified this with MATLAB: http://www.pictureupload.us/image-172220092351c5ae0c1706e.htm

On begin, the first simulation steps are approximatley correct. But there is a very small numerical error, which is increasing during solving A*λ = b.

Then the system is crashing and my results are not anymore correct and I get NaN results.

Here the code:

/******** SVD ********/
JacobiSVD<TMatrixX> svd(A, ComputeThinU | ComputeThinV);
lambda = svd.solve(b);

What have I done wrong?

1

1 Answers

2
votes

JacobiSVD considers all non-zeros singular values for solving. I recommend using ColPivHouseholderQR.