A production-ready, object-oriented 2D Finite Element Analysis (FEA) engine developed in Python. This project elevates foundational structural mechanics into a commercial-grade software architecture, featuring intuitive Excel-based data imports, advanced static condensation algorithms, and a fully automated Quality Assurance (QA) testing suite.
Eliminates the need for hardcoded data entry. The engine utilizes pandas to read standard .xlsx templates.
- Includes a
tkintergraphical file dialog for easy model selection. - Automatically parses Nodes, Elements, Connectivity, Nodal Loads, Boundary Conditions, and Member/Span Loads.
- Static Condensation: Mathematically eliminates rotational degrees of freedom to accurately model internal hinges (Moment Releases: START, END, BOTH) without expanding the global matrix size.
- Span Load Processing: Automatically converts member-applied Point Loads and Uniformly Distributed Loads (UDL) into equivalent Fixed-End Forces (FEF) for global assembly.
- Hybrid Systems: Perfectly handles combinations of rigid Frame elements and pure Truss members in the same global topology.
Built with robust exception handling (StructuralStabilityError, ModelingError, DataFormatError). The engine intercepts and reports critical physical errors, such as singular matrices caused by floating structures (missing supports) or unstable mechanisms (too many hinges).
Reliability is critical in structural engineering. This repository includes a dedicated unittest QA suite (Assignment3_Q2_AutomatedQA.py) that strictly verifies:
- Element-level mathematics (Lengths, Transformation Matrices, FEF calculations).
- Global matrix superposition and active DOF equation numbering.
- End-to-end regression tests comparing the software's output against exact analytical solutions for Pure Trusses, Pure Frames, and Hybrid Systems.
The core solver utilizes the Direct Stiffness Method:
- Generates local stiffness matrices [k] and [FEF].
- Applies Static Condensation for member releases.
- Transforms to global coordinates: k_global = T^T * k_local * T.
- Assembles the Global Stiffness Matrix [K] and Force Vector {F}.
- Solves the system [K]{D} = {F} using highly optimized
numpy.linalg.solve. - Back-substitutes to extract precise Nodal Displacements, Support Reactions, and Member End Forces (Axial, Shear, Moment).
Install the required data science libraries:
pip install numpy pandas openpyxl- Define your structure in the provided
Structural Analysis Program Input Format.xlsxtemplate. - Run the main engine:
python Assignment3_Q1_StructuralAnalysisProgram.py- A file dialog will appear. Select your Excel model.
- The engine will parse the data, solve the system, and print a formatted, commercial-grade engineering report to the console.
To verify the mathematical integrity of the engine, run the automated test suite:
python Assignment3_Q2_TestEngine.pyMuratcan Kılıçtepe
Developed for CE 4011 - Structural Analysis Software Development.
Delivering scalable software architecture backed by rigorous mathematical verification.