Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to perform Gaussian elimination with back substitution for 6DOF model 1

Status
Not open for further replies.

LRJ

Civil/Environmental
Feb 28, 2016
269
I was wondering whether anyone had an existing VBA subroutine/function which can perform Gaussian elimination with back-substitution for a 6DOF model (i.e. contains a 6 x 6 stiffness matrix)?
 
Replies continue below

Recommended for you

Thanks, Doug. I suspected you might have something. The Frame4 link appears to be broken, though I have downloaded 3DFrame okay.

There are a lot of subs in 3DFrame. What is the specific sub/function name that performs this elimination/back-substitution?
 
LRJ - The Frame4 download worked OK for me. Could you re-try and if it still doesn't work let me know error messages?

The matrix solver routines are the same in both though (I think). in 3DFrame:

Go to the P44 sub in mFrameP44.
Scroll down to the comment --------equation solution---------
There are three solvers called there with a Select Case statement:
Case 1: ALLinCGSSolveSparse2; a c# sparse solver using the Alglib library
Case 2: p44BanRed; an Alglib dense solver
Case 3: BanRed; a VBA routine

Banred is in the mFrameP44 module, the other two are in AL_dllSolve.

The stiffness matrix for Banred is passed as a vector, kv. The code for generating that is under ---global stiffness matrix assembly---:
For each element:
Generate the element stiffness matrix using rigid_jointed3 or spring_jointed3
Copy to the kv vector with formkv

The code is all based on Fortran code in Programming the Finite Element Method by Smith and Griffiths. In my copy their program P44 was the basis of the code (hence the name), but the numbering has changed in more recent editions.

Also note that on the Misc sheet you can enter an element number in the cell named kmbeam (N8) and the code will write the km matrix for that element in the range below when you run the solver.


Doug Jenkins
Interactive Design Services
 
Hi Doug,

The link still didn't work for me. It stated that 'Frame4.zip might have been moved or deleted'.

Thanks for the explanation on the solver. Am I right in thinking that BanRed will, for all intents and purposes, work for any given number of degrees of freedom since 'n' (which indicates nDOF) is an input? That would mean that if I wanted to have a 2DOF, 4DOF, 6DOF, ?DOF model I could just use that script?
 
Thanks for the explanation on the solver. Am I right in thinking that BanRed will, for all intents and purposes, work for any given number of degrees of freedom since 'n' (which indicates nDOF) is an input? That would mean that if I wanted to have a 2DOF, 4DOF, 6DOF, ?DOF model I could just use that script?

Yes, as long as the kv vector is in the right format it will work for a matrix of any size. The only restrictions are the available memory and time. The VBA code is very slow for large matrices, and the compiled versions are much quicker. For a small frame they are all near instantaneous though, and the VBA is much easier for debugging as you can step through the code.

I'm not sure what is happening with the Frame4 download. I'll check it out again.

Doug Jenkins
Interactive Design Services
 
Thanks, Doug. I imagine a 6x6 matrix should be manageable with the VBA code, but I'll bear the others in mind if I ever get something bigger.

Also, I downloaded Frame4 fine. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor