Finite element in MATLAB

  • Computational
  • Thread starter rppearso
  • Start date
  • #1
204
3
Does anyone know of a great text that shows how to set up FEA in MATLAB in detail. I have wrote out the sort of pre pseudo code from John Andersons - Computational Fluid Dynamics now I just need to build it out in code. I am old school with the hand sketches, hopefully this does not get me a down vote.

40457590_1882933911773922_8490047946346201088_o.jpg

40403655_1882935495107097_1975171256596561920_o.jpg
 

Attachments

Answers and Replies

  • #3
bigfooted
Gold Member
609
122
You can also do FEA in matlab in 50 lines:
https://www.math.hu-berlin.de/~cc/cc_homepage/download/1999-AJ_CC_FS-50_Lines_of_Matlab.pdf

I thought Anderson also gives some numerical methods in his book?
I would start with a finite difference method if this is your first attempt to write a CFD solver (but matlab is fine, at least you don't have to worry about implementing solvers for sparse matrices).
I don't know a good book on finite element methods, although I have a couple of them on my shelf.
 
  • #4
204
3
You can also do FEA in matlab in 50 lines:
https://www.math.hu-berlin.de/~cc/cc_homepage/download/1999-AJ_CC_FS-50_Lines_of_Matlab.pdf

I thought Anderson also gives some numerical methods in his book?
I would start with a finite difference method if this is your first attempt to write a CFD solver (but matlab is fine, at least you don't have to worry about implementing solvers for sparse matrices).
I don't know a good book on finite element methods, although I have a couple of them on my shelf.
Thank you for the reference. Anderson does not provide raw code, although I did find his email address and asked him (but he has not yet responded). His book does a marvelous job of breaking the PDE's into algebraic problems which is what is required for finite element (PDE -> algebra) and then looped in an array.

Basically I just need to figure out how to define/build out an array and then loop each element of the array in time (allowing each array element to pull values from each other either from adjacent array cells or values from previous time steps in the same array or other arrays.

So the initial array will be pre-populated with values (initial and boundary conditions, the boundary conditions are no longer "neumann" they are simply algebra) and then the calculations will solve and a new array will be created. There will now be 2 arrays with values, the initial conditions (t=0) and the new conditions (t=1), then to get t=2 the calculations will be ran again using the new values from t=1. These new t=2 array values can either replace the initial conditions or just keep creating more arrays (with computing power what it is today and the fact this is a simple pseudo one dimensional problem I don't think there will be issues just to save them but only display the latest values in the plot. I then want to display the values as colors in the shape that I have drawn and have that shape change as I manually change the area factor A(x). This will go on until the new t=x value is negligibly different from t=x-1 (that acceptable difference, steady state, will be set by the user).

I don't think this is super hard to do in matlab but I have never done it so need a little help/reference. I have only done a loop in an "array" with a single box so an array didn't really need to be set up, I simply set up a do until loop to converge on a value.
 
  • #5
204
3

Related Threads on Finite element in MATLAB

  • Last Post
Replies
1
Views
2K
Replies
1
Views
664
Replies
15
Views
1K
Replies
9
Views
27K
  • Poll
  • Last Post
Replies
3
Views
3K
Replies
2
Views
5K
Replies
1
Views
5K
  • Last Post
Replies
10
Views
6K
Replies
5
Views
1K
Replies
3
Views
1K
Top