What is the largest allowable size of matrices and vectors to pass to mldivide?
Mostrar comentarios más antiguos
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 comentarios
Sean de Wolski
el 14 de Jun. de 2011
What do you mean by "strange" results? Please clarify; are your results: wrong values, wrong sizes, not being attained etc?
Andrew Newell
el 14 de Jun. de 2011
It would also help to know how many nonzero elements there are.
gabriel villalobos
el 23 de Jun. de 2011
Respuesta aceptada
Más respuestas (1)
Sean de Wolski
el 23 de Jun. de 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 comentarios
gabriel villalobos
el 23 de Jun. de 2011
Sean de Wolski
el 23 de Jun. de 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
el 23 de Jun. de 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
el 23 de Jun. de 2011
Sean de Wolski
el 23 de Jun. de 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.
Categorías
Más información sobre Linear Least Squares en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!