Problem
As a final project in my Mechanical Computation and Design class, I solved the following problem: determine the linear deformation of an eggshell microstructure (two-dimensional truss composed of hundreds of connected elements) given input forces and boundary displacement conditions.
Method
I used this project to strengthen my Python skills. I employed the finite element method using matrices to calculate and display the deformation of the network. The two input files required to generate the mesh consisted of a list of cartesian coordinates per node and a list of node-to-node connections. I generated a connections matrix with a global material applied to all the members. The displacement of the leftmost nodes was constrained to zero, and the force (input by user) was applied to the rightmost nodes in the positive x direction (right).
Result
Given the input file, the code outputs a visual depiction of the displacement, as shown in Figure 4 below, and states the numerical displacement in the desired units. The program also outputs a chart of deviations by element, and a strain distribution chart which are shown below.
An improvement on this project I would prioritize in future iterations is the flexibility of the visual output. I used the matplotlib library to produce the graphs, but this method has issues with window resizing, live updating, and render times. In the future I would use something like Plotly or Chaco.
Python Files: https://github.com/nohbie/FEA_meshes
Lessons Learned
> File inputs and outputs in Python
> Applying the finite element method in code
> Matrix math in Python
> Working independently on a larger coding project