Skip to content

Repository files navigation

🏢 Professional 2D Structural Analysis Engine (FEA)

Python NumPy Pandas Testing

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.

🚀 Key Features & Engineering Innovations

📊 1. Seamless Excel Integration (UX)

Eliminates the need for hardcoded data entry. The engine utilizes pandas to read standard .xlsx templates.

  • Includes a tkinter graphical file dialog for easy model selection.
  • Automatically parses Nodes, Elements, Connectivity, Nodal Loads, Boundary Conditions, and Member/Span Loads.

🔗 2. Advanced Structural Physics

  • 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.

🛡️ 3. Defensive Programming & Stability Filters

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).

🧪 4. Automated Quality Assurance (Unit Testing)

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.

🛠️ Mathematical Workflow

The core solver utilizes the Direct Stiffness Method:

  1. Generates local stiffness matrices [k] and [FEF].
  2. Applies Static Condensation for member releases.
  3. Transforms to global coordinates: k_global = T^T * k_local * T.
  4. Assembles the Global Stiffness Matrix [K] and Force Vector {F}.
  5. Solves the system [K]{D} = {F} using highly optimized numpy.linalg.solve.
  6. Back-substitutes to extract precise Nodal Displacements, Support Reactions, and Member End Forces (Axial, Shear, Moment).

💻 Installation & Usage

Prerequisites

Install the required data science libraries:

pip install numpy pandas openpyxl

Running an Analysis

  1. Define your structure in the provided Structural Analysis Program Input Format.xlsx template.
  2. Run the main engine:
python Assignment3_Q1_StructuralAnalysisProgram.py
  1. A file dialog will appear. Select your Excel model.
  2. The engine will parse the data, solve the system, and print a formatted, commercial-grade engineering report to the console.

Running the QA Tests

To verify the mathematical integrity of the engine, run the automated test suite:

python Assignment3_Q2_TestEngine.py

👨‍💻 Author

Muratcan Kılıçtepe
Developed for CE 4011 - Structural Analysis Software Development.

Delivering scalable software architecture backed by rigorous mathematical verification.

About

A production-ready 2D Finite Element Analysis (FEA) engine in Python. Features an OOP architecture, Excel-based model import, static condensation for internal hinges, and automated QA unit testing.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages