Over the course of finite difference discretization of an elliptic equation and application of Neumann BCs on all sides of the 2D domain I have a large sparse matrix. I need to find null space of its transpose to enforce consistency condition on either side. For a computational domain of 50X50 and 100X100 I am able to do this with the available RAM of 32 GB in Mathematica and MATLAB with the available full matrix commands of NullSpace and null respectively.
If the computational domain is 500X250 (which is of the order of what I would have in general) the RAM required for the storage of the matrix of size (500X250)X(500X250) is 125 GB and is highly prohibitive. I use sparse matrices to store this super-matrix and I don't have have the space constraint anymore. But I can't use the 'null" command on this as it is for only full matrices. MATLAB suggests to use "SVDS" command on sparse matrices. SVDS(A) gives only the first 6 singular values and singular vectors. There is another command SVDS(A,k,sigma) which gives "k" singular values and vectors around the scalar singular value of "sigma". When I use sigma=0 so as to find the singular vector corresponding to the the "zero" value, which would be the vector from null space basis I get an error that the "sigma" is too close to the eigen value of the matrix.
My matrix is singular and hence one of its Eigen values is "zero". How do I circumvent this error? Or Is there a better way to do this with the tools at hand. I have both MATLAB and Mathematica at hand.
Thanks in advance for your help and suggestions.
Best Trinath