Excel Limits for FE analysis
Excel Limits for FE analysis
(OP)
Has anyone tried using excel for a Finite Element Analysis? I've done it with a small structural frame when I was in school but I'm wondering if excel is able to invert a large 1000x1000 matrix. I know the minverse function can only handle up to about n=256 so I'm wondering if there is a way to compile and invert the matrix on the VBA side of excel. Thanks.





RE: Excel Limits for FE analysis
Whether it solves in a reasonable time is a whole separate issue.
Cheers
Greg Locock
SIG:Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips.
RE: Excel Limits for FE analysis
RE: Excel Limits for FE analysis
Excel will be slow though as the code isn't compiled. I've written a Boundary Element code in excel before with a square matrix of typically 100 x 100. The solve time of milliseconds is too slow for some these days.
corus
RE: Excel Limits for FE analysis
Try a freeware C or Fortran compiler - that´s the most straightforward route to fast home-made FE. Expect VBA in Excel to be horribly slow for your application. I was shocked when I wrote a small dof radiation solver recently.
RE: Excel Limits for FE analysis
Cheers
Greg Locock
SIG:Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips.
RE: Excel Limits for FE analysis
RE: Excel Limits for FE analysis
Yes, you can link VBA to C codes. A colleague of mine just presented in a group meeting a few months ago the way to do it. I just remember that it is not very straight forward, nothing else.
If you code in Matlab, you can link to C and Fortran also. But again it is not very straightforward. You'll need to write gateway functions to pass parameters back and forth. But actually, Matlab linear solver is not too bad. It can handle, say, 10,000 dofs pretty fast.
Have a good time coding!
RE: Excel Limits for FE analysis
http://ne
h
htt
http://
I found it considerably easier to get Fortran routines linked to Excel than C, but that may be because I'm not that familiar with C. Either should work well, once you gety the system sorted out.
Also whilst VBA is undoubtedly much slower that Fortran or C, for many applications it will be more than fast enough.
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: Excel Limits for FE analysis
Cheers
Greg Locock
SIG:Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips.
RE: Excel Limits for FE analysis
VBA is slower than a compiled program, but it shouldn't be that slow. Two of the main things that can be done to speed things up is to make sure that all the data is transferred into VBA at once, as arrays rather than cell by cell, and avoid using worksheetfunction in the VBA code. This applies particularly in Excel 2007.
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: Excel Limits for FE analysis
Cheers
Greg Locock
SIG:Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips.
RE: Excel Limits for FE analysis
Excel 2007 will invert a 1000 x 1000 matrix using the minverse() function, and takes about the same time as the VBA.
If you do use VBA the way to read the numbers into a VBA array is:
1: create a variant variable
2: Read the data into this variable:
vbaarray = range("datarange").value2
3: This will create an array of variants. For less maths intensive applications it is usually best to leave it at that, but in this case it is worth creating a new array of type double, and reading the contents of the variant array into the double array. As far as I know, the only way to do that is:
Redim vba_double_array(1 to numrows, 1 to numcols)
for i = 1 to numrows
for j = 1 to numcols
vba_double_array(i,j) = vbaarray(i,j)
next j
next i
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: Excel Limits for FE analysis
Cheers
Greg Locock
SIG:Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips.