Handling Large Stiffness Matrix
Handling Large Stiffness Matrix
(OP)
Does any know how to handle very large arrays or matrices in VB6.0. I get a memory error when using arrays that are of several thousand terms. (ie 3000x3000). This is for math calculations for stiffness matrix of steel structures.
I have seen suggestions to use an array of arrays. In other words each row of the matrix would have an array. This seems to be a good idea, but I don't know how to create additional arrays at runtime since the actual size of the matrix is unknown at design time.
Any ideas appreciated.
I have seen suggestions to use an array of arrays. In other words each row of the matrix would have an array. This seems to be a good idea, but I don't know how to create additional arrays at runtime since the actual size of the matrix is unknown at design time.
Any ideas appreciated.






RE: Handling Large Stiffness Matrix
I use Delphi, and it's pretty easy to create an array of arrays, and I used to do it in VB4... before I migrated... shouldn't be too difficult in VB, though.
RE: Handling Large Stiffness Matrix
RE: Handling Large Stiffness Matrix
I believe you can find this also in VB.
Good luck.
RE: Handling Large Stiffness Matrix
If you are programming an FE program, using a frontal solver might help you to avoid large matrices problem since you do not need to forma a global stffness matrix- see Hinton and Owen Finite Element Programming for example.
RE: Handling Large Stiffness Matrix
I'd recommend that you don't try to code an "array of arrays". If VB won't let you do the array size you need, then... VB is not the language you should be using. As others have already suggested... it is highly likely that you don't actually need a matrix that large. You really don't want to store and solve ALL elements of your matrix if the overwhelming majority of your elements are zero. Of course... the techniques for solving these matrix equations is well beyond the scope of this forum. Frontal solvers are great!!! However... implementing them is anything but simple. Look for information on Band and Skyline and Envelope storage and solver methods.
Last... but last... If you DO have to solve equations with so many terms... I HIGHLY suggest you use something other than VB. Even if you can get VB to solve your equations... you will be waiting forever plus some. Even for simple string manipulation algorithms ( where VB is supposed to be worthy ), I've found that simple Fortran code will run considerably faster. For numerical computations... the timings will be incredibly different. I personally recommend Fortran. Of course... C and C++ would be other common choices.
If you're using VB for it's GUI capabilities... that's fine. Write a VB front and back end with a Fortran DLL to do your actual number crunching. Of course... before you do any of these things... I suggest you do a little research to see if you actually need to work with such large matrices. ( hint: if you are inverting your matrices... you are doing way too much work ).
Dan
www.dtware.com
RE: Handling Large Stiffness Matrix
I agree with most of the comments above, especially regarding solving ALL 3000 equations. I am only using the top half of the matrix, and plan to implement the Skyline method and solve by Cholesky factorization. Also, since it will be parametric, I can optimize the node order any way I like without much difficulty. However, most of the Skyline examples I have seen use LU factorization.
Is Cholesky OK or should I stick with LU? Everything seems to indicate that Cholesky is fastest.
RE: Handling Large Stiffness Matrix
Good Luck,
Dan
www.dtware.com