Actually I have found 12x12 stiffness matrix, which is a function of frequency, having 65 non-zero elements and rest are zero elements. I unable to solve this matrix., it shows an error having insufficient memory.
Activate your task manager and check your processes' memory allocation.You may have an issue with the memory used by other apps.Usually browsers that stay open for a long time allocate a lot of memory.You can also monitor the allocated memory of the software that is used to solve your numerical problem (matlab) and verify that the 12×12 matrix is not the problem in your case.
Try to check if your matrix has a determinate which is a function and not zero.You can do this easily by calculating detA.Maybe your det is not a function that can be solved.
In the case of large matrix, the best way is to define two function:
In the second function, define the matrix A. In the first function solve the matrix.
This method is efficient because the "syms' command occupies a lot of memory, and there will be times that you don't need your matrix at that moment. so if you have 2 functions, in any moment, only one of them occupies your memory.
2.
also there is another action to do:
try to increase the virtual memory of your system( it shares some part of hard disk on Ram).
3.
In MATLAB: go to preference>General> Java heap memory
Here you can increase the maximum size of java heap( this is the memory that MATLAB uses to keep the matrices).
Solve is only for symbolic calculations in matlab. If the functions inside the matrix are trigonometric, and 12x12 matrix, Man then for sure you end up with too complex function that is most likely will not admit any analytical solution. Two tricks i might do if i were you. Either to expand the matrix using some taylor series in the region where you would expect the roots to be and then try to find the roots of the polynomial numerically. Or, calculate the determinate of the matrix for different values of X and plot these determinates and then see if there is some trend or logic behind the plots.
The standard way of calculating the determinant of a matrix is to obtain a polynomial expression from the rows and columns of the matrix - this is the way we were all taught in linear algebra. For a full 12x12 matrix, this will results in a polynomial with ~479001600 terms. If these terms are symbolic... well it might be the first indication of MATLAB's memory issues.
However, MATLAB uses a different algorithm to calculate the determinant. In the help file, it gives the following (http://goo.gl/ptBkge):
" The determinant is computed from the triangular factors
obtained by Gaussian elimination:
[L,U] = lu(A)
s = det(L) % This is always +1 or -1
det(A) = s*prod(diag(U)) "
The determinant expression itself does not appear to be optimized for sparse matrices. However, the "lu" decomposition is optimized (http://goo.gl/RuwJcP):
" If S is a sparse matrix, the following command returns
three sparse matrices L, U, and P such that P*S = L*U.
[L,U,P] = lu(S)
lu obtains the factors by Gaussian elimination with partial pivoting. "
Further down:
" On the other hand, the four-output syntax:
[L,U,P,Q]=lu(S)
selects P via threshold partial pivoting, and
selects P and Q to improve sparsity in the LU factors.
...
Except for the four-output syntax, MATLAB does not use any
symbolic LU prefactorization to determine the memory requirements
and set up the data structures in advance."
This might indicate that if you use the four-output syntax, MATLAB will pre-allocate enough memory.
If this does not work, why not try and write a determinant function yourself using the basic method of row/column multiplication? It's very easy to do and you can be sure to make use of the sparsity of your matrix. Just remember, the basic method (Laplace's formula) uses O(n!) calculations for an nxn matrix, whereas LU decomposition uses O(n^3). However, LU decomposition might not always be able to take advantage of the sparsity of your matrix, especially if you have lots of fill-in, whereas Laplace's formula might. A lot depends on the structure of your matrix.
It is true that Matlab, Maple,and Mathematika software are capable of obtaining matrix expansions in symbolic form but in reality with limited effort you could obtain such formulas efficiently by manual means. In 2006 in the process of developing a finite element code for plate bending I succeeded in determining the symbolic inverse of a 12 by 12 matrix manually by taking advantage of the sparsity of the matrix, after the numerical routine for doing the inversion failed me. Also, in 2008 I developed the exact stiffness matrix of the 15-noded plane strain cubic element in compact form. An earlier researcher on the same subject developed very lengthy expressions for this inverse using Mathematika. Unfortunately, I don't work much in the Matlab environment for I use personally developed programs to do my computations in the C and C++ environment. My suggestion to Ranjan Behera is to proceed manually to invert the sparse 12 by 12 matrix if Matlab refuses to do it. I have done it before! He only needs to substitute more manageable symbols for the trigonometric terms say a1 = x*sin(x) + x* cos(x) etc