So this semester, I'm taking a Finite Element Method course at my graduate school. We started out making codes for 1D bars and came all the way to 8 node solid elements. However, I seem to have run into a wall, as I have made my code and combed through it for the past week, making sure all the shape functions and mathematics were correct. In the end, everything looks correct. However, while I am supposed to get deflections in the z direction around the ballpark of 0.3 m, I keep getting deflections in the magnitude of E-04. I am very much at my wit's end. Also, because I genuinely don't know which StackExchange community to post this question to, I have tried Mathematics and Overflow. I would like to emphasize that I'm not trying to just spam my question. If you kindly explain to me why my question doesn't belong here, I will delete it quickly. But I have done my research and I have made my own code, so I'm not trying to something out of nothing. Any and all help is appreciated. I will detail the problem below:There is a bar that is fully clamped at one end. It is 1[m] long in    the x-dir and 0.1[m] long in the y-dir andz-dir. A point force of 100[kN] is applied in an upward direction at    thefree end of the bar. The number of elements in the y-dir and z-dir isto always be 1 element only, but the I'm supposed to increase thenumber of x-dir elements to show that the displacement valuesconverge. Currently, not only do they not converge, but the valuesare much too small.Once again, thank you for any and all help.https://drive.google.com/drive/folders/0BzaeyQa0ePwvU2lLTmZQSUZFLTg?usp=sharing
3D Solid 8 Node FEM Matlab Code
finite element;matlab
After some investigation, I believe your FE code is correct. Congratulations!From beam theory, deflection of a cantilever beam with a point load at the tip is$$u_{tip} = PL^3/(3EI)$$For the parameters of your model, $u_{tip}=.03333m$.With a single element, your code gives $u_{tip}=8.4697 \times 10^{-4}m$. For 30 elements,$u_{tip}=0.027862m$So why isn't the FE solution closer to the beam solution?These fully-integrated eight-node hex elements (as well as the corresponding2D, four-node quadrilateral) are notoriously bad when modeling bending behavior.Remedies for this problem have been studied for more than 30 years. Onecrude solution is to simply under-integrate the terms when forming thestiffness matrix (e.g. a single gauss point). But this causes new problems.A better approach is to use a more sophisticated approach than thesimple displacement formulation. You can find a wealth of information ifyou search for shear locking in finite elements.