What is the largest allowable size of matrices and vectors to pass to mldivide?
Show older comments
I am using mldivide to solve a sparse matrix problem within a finite element code. The matrices are defined as sparse from the begining by
A = sparse(nGdof,nGdof)
For a system of size around 16000x16000, the code works well. For larger matrices I get strange results. What brings me to the question, is there a limit of size on mldivide? or more generally, for sparse matrices in general?
3 Comments
Sean de Wolski
on 14 Jun 2011
What do you mean by "strange" results? Please clarify; are your results: wrong values, wrong sizes, not being attained etc?
Andrew Newell
on 14 Jun 2011
It would also help to know how many nonzero elements there are.
gabriel villalobos
on 23 Jun 2011
Accepted Answer
More Answers (1)
Sean de Wolski
on 23 Jun 2011
No, there is no limit. Does your stiffness matrix have boundary conditions applied?
EDIT example for clarification
K = [1 2 3;4 5 6;7 8 9];
Kbc = [1 0 0;0 5 0;0 0 1]; %DOFs 1,3 fixed
5 Comments
gabriel villalobos
on 23 Jun 2011
Sean de Wolski
on 23 Jun 2011
And thus your system is unstable!!!
If everything can move and you apply a force, will it ever stop? Infinite displacements!! (well in theory)
Sean de Wolski
on 23 Jun 2011
Instead, apply the BCs to your stiffness matrix before hand by zeroing out all rows and columns of it that correspond to fixed DOF and setting a 1 to the diagonal of those DOFs.
gabriel villalobos
on 23 Jun 2011
Sean de Wolski
on 23 Jun 2011
"gabriel villalobos about 3 hours ago
The boundary conditions are given in the form of the activeDof vector. This is, activeDof only has the number of the DOF of the system which are free to move"
Thus extracting only that parts that are free to move leave you system not stable.
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!