matlab - Programming Finite Element Method -
i trying teach myself how finite element methods.
all of code adapted following link pages 16-20 http://homepages.cae.wisc.edu/~suresh/me964website/m964notes/notes/introfem.pdf
i programming along in matlab perform finite element analysis on single 8 node cube element. have defined xi,eta,zeta local axes (we can think x, y, z now), following shape functions:
%%shape functions zeta = 0:.01:1; eta = 0:.01:1; xi = 0:.01:1; n1 = 1/8*(1-xi).*(1-eta).*(1-zeta); n2 = 1/8*(1+xi).*(1-eta).*(1-zeta); n3 = 1/8*(1+xi).*(1+eta).*(1-zeta); n4 = 1/8*(1-xi).*(1+eta).*(1-zeta); n5 = 1/8*(1-xi).*(1-eta).*(1+zeta); n6 = 1/8*(1+xi).*(1-eta).*(1+zeta); n7 = 1/8*(1+xi).*(1+eta).*(1+zeta); n8 = 1/8*(1-xi).*(1+eta).*(1+zeta); the [n] matrix arranged according text reading:
%n matrix n= [n1 0 0 n2 0 0 n3 0 0 n4 0 0 n5 0 0 n6 0 0 n7 0 0 n8 0 0; 0 n1 0 0 n2 0 0 n3 0 0 n4 0 0 n5 0 0 n6 0 0 n7 0 0 n8 0; 0 0 n1 0 0 n2 0 0 n3 0 0 n4 0 0 n5 0 0 n6 0 0 n7 0 0 n8]; to find [b] matrix have use following [d] matrix:
%%del matrix node %[ d/dx 0 0 % 0 d/dy 0 % 0 0 d/dz . . . % d/dy d/dx 0 % 0 d/dz d/dy % d/dz 0 d/dx ] which operator go on [n]. (b=dn)
later on, text shows, making calculations involving integrals of [b] matrix on volume of element.
so, question is, how can store these polynomial shape functions in matrix, operate on them differentiation, , integrate them numerically. can tell way have set right now, wont work because have defined functions vector on interval [0,1] , storing these vectors in [n] matrix. using diff() function differentiate appropriately find [b] matrix. since matrix elements of [b] vectors on interval [0,1] think going cause problems. how guys go these calculations described in textbook posted above?
you should check page 24 how mapping parametric domain ([0,1]^) physical domain.
Comments
Post a Comment