Python and its use in structural engineering
| photo courtesy of PyCon Philippines |
Introduction
I actually had two speaking engagements that fell on the same day, March 21, 2026. The first one was a talk about an introduction to the application programming interface (API) and its use in structural engineering projects, which was scheduled at 10:30 am at Diamond Hotel, Manila. The second one was a talk about the use of Python in structural engineering. I will share the former in the second part of this blog, while the latter, I will share in this blog.
Although they happened on the same day, I nevertheless accepted the challenge. As a relatively new Python programmer since August 2024 (I was coding in C language for more than a decade before), I have a fascination towards Python programming as it is simple to use, easy to learn and teach, and has lots of libraries available for use. I also have a fascination towards the intersection of Python and structural engineering, and I want to share what I have learned so far to the people and, hopefully, entice them to hop into the world of Python software development.
Immediately after my first talk, I immediately went to De La Salle University, Manila to participate in PythonAsia 2026, and arrived at 11:15 am. This gave me ample time to prepare for my talk, which was slated at 1:15 pm.
| DLSU sunset really looks pretty from 5/F |
There, I interacted with the audience consisting of mostly amazing players in the fields of information technology, data science, computer science and Python programmers, among others. So, a talk about the uses of Python in structural engineering may be something of a unique topic to them.
The talk
First, I mentioned what we do as structural engineers, as well as what we usually use, and how we normally do it. From there, I mentioned some of the disadvantages of our traditional workflow, and then proceed to introducing Python as a tool to fill these gaps.
Next, I introduced the concept of application programming interface (API), which is a set of functions and commands that a user can utilize to communicate with the software without actually going to the user interface of that software. With APIs, the user can model super complex structures (especially when interfaced with parametric modeling software such as Blender or Rhino Grasshopper), automate many of the functionalities of the software (and even add features th
at are not present in the software), and even do optimization of structures automatically, without the need to waste hours of clicking the same buttons multiple times.
In my talk, I discussed the APIs in three major structural engineering software, how the code using it is generally structured using Python, and then some example uses from mine and my colleagues in structural engineering.
Then, I gave the audience a quick introduction to the finite element method (FEM) concept, which is something all structural engineering analysis and design software uses. FEM usually starts with a differential or a partial differential equation called the strong form, which is then converted to its weak form via weighted integral formulations, to derive certain formulas which will be used to come up with a matrix form called element stiffness matrix equation for that element. The structure under analysis will then be divided into several elements, from which their stiffness matrix equations will be combined to build a single large structure stiffness matrix equation. Now, constraints will be applied to this equation, and the remaining part will be solved using matrix operations to get the unknowns (usually structure displacements). Finally other quantities such as deformations, stresses and forces are calculated from displacements.
I then showed an example of how the Python libraries numpy and matplotlib can be used to do FEM analysis of a bridge truss and how to visualize the structure and the results.
Finally, I mentioned some of the open source Python libraries available to do FEM analysis of structures, such as
- openseespy for general purpose analysis, including nonlinear, geotechnical and earthquake simulations,
- pyniteFEA for simple elastic analysis of structures,
- concreteproperties for calculating cracked and uncracked properties of reinforced concrete, as well as section stresses, and
- sectionproperties for calculating section properties of members (usually steel), as well as section stresses.
Finally, I showed more examples of Python programs using these libraries.
Resources
In case you are interested about this talk,
- here is the copy of my presentation slides,
- here is my Python code example for modeling, analyzing, designing, and optimizing a steel roof truss structure based on NSCP 2015 provisions using Midas Gen NX 2026, and
- here is my Python code example for modeling and analyzing bridge trusses using just numpy and matplotlib
Acknowledgments
I would like to thank the following entities for making my presentation possible.

Comments
Post a Comment