Finite element code - how to set up array and loop to a solution
Show older comments
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.
If anyone knows of a text or other resource that would be great, unfortunately I am starting from scratch on FEA so I don't have any code to share as of yet.
Thank you, Ron
Answers (1)
KSSV
on 14 Sep 2018
0 votes
You may refer the following book:
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!