I dont recall how long ago i worked on FEM methods but found this basic program of stiffness matrix calculation in one of my older hard drive. So why go it to waste here is a brief blog on how FEM, a numerical technique can be approached. This technique breaks down a complex structure into smaller, simpler pieces called "finite elements." By analyzing these small elements and then reassembling them, we can understand the behavior of the entire structure.
One of the most fundamental concepts in FEM is the stiffness matrix. This matrix represents the relationship between the forces applied to a structure's nodes and the resulting displacement of those nodes. In a simple truss, which is a structure made of straight members connected at joints (like a bicycle frame), we can build a stiffness matrix to understand its behavior.
Let's take a look at a Python script that calculates the global stiffness matrix for a simple plane truss with three members.