Summary
In this lecture, we'll cover:
- How to extract the structure stiffness matrix from the primary stiffness matrix
- How to identify restrained degrees of freedom and convert them to matrix indices
- How to remove the corresponding rows and columns using NumPy’s
deletefunction - Why we recast the resulting array as a NumPy matrix to enable matrix operations such as inversion
In this lecture, we focus on reducing the primary stiffness matrix to obtain the structure stiffness matrix. We begin by identifying the restrained degrees of freedom and converting these into zero-based indices suitable for Python, using a list comprehension to subtract one from each restrained degree of freedom. Once we confirm the indices are correct, we proceed to remove the associated rows and columns from the primary stiffness matrix, thereby extracting the reduced structure stiffness matrix.
We use NumPy’s delete function to eliminate the rows (axis 0) and then the columns (axis 1) corresponding to the restrained degrees of freedom. After performing this reduction, we recast the resulting array as a NumPy matrix so that we can access matrix-specific operations such as inversion. By the end of the lecture, we have successfully reduced the full primary stiffness matrix to the smaller 8×8 structure stiffness matrix, ready for the next stage of analysis.
Next up:
In the next lecture, we solve for nodal displacements and reactions, and address practical coding issues such as vector manipulation and index management.
Tags
Please log in or enroll to continue
If you've already enrolled, please log in to continue.
The Direct Stiffness Method for Truss Analysis with Python
Build your own finite element truss analysis software using Python and tackle large scale structures.
After completing this course...
- You’ll understand how to use the Direct Stiffness Method to build complete structural models that can be solved using Python.
- You’ll have your own analysis programme to identify displacements, reactions and internal member forces for any truss.
- You’ll understand how common models of elastic behaviour such as plane stress and plane strain apply to real-world structures.