A comprehensive application for structural engineers that combines traditional beam analysis with AI-powered optimization capabilities. Available in both desktop GUI and web-based Streamlit versions.
- Features
- System Requirements
- Installation
- Usage
- File Format
- Optimization
- Project Structure
- Examples
- Limitations
- License
- Support
- Load beam data from CSV or Excel files
- Calculate shear forces and bending moments
- Visualize results with interactive diagrams
- Evaluate multiple material and cross-section options
- Genetic algorithm-based design optimization
- Multiple optimization objectives:
- Cost minimization
- Weight reduction
- Deflection control
- Safety factor maximization
- Customizable constraints:
- Maximum allowable deflection
- Minimum required safety factor
Preloaded with common engineering materials:
- A36 Steel
- Aluminum 6061
- Concrete
- Titanium Grade 5 (Streamlit version)
Material properties including:
- Young's Modulus
- Yield Strength
- Cost factors
- Recommended safety factors
- Density
Supported cross-sections:
- Rectangular
- I-beam
- Circular
- Hollow Circular (Streamlit version)
Automatic calculation of:
- Area
- Moment of Inertia
- Section Modulus
- Generate PDF reports with:
- Analysis results
- Diagrams
- Design recommendations
- Export functionality for sharing results
- Python: 3.7 or higher
- OS: Windows, macOS, or Linux
- Recommended:
- 4GB RAM
- 2GHz processor
-
Clone or download the project:
git clone <repository-url> cd beam_analyzer_project
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
The project provides two interfaces:
Run the desktop application with:
python run_gui.pyFeatures:
- Traditional desktop interface using Tkinter
- AI-powered optimization with genetic algorithms
- Interactive plotting with matplotlib
- PDF report generation
Run the web application with:
python run_streamlit.pyOr directly with Streamlit:
streamlit run beam_analyzer_gui_03.pyFeatures:
- Modern web interface
- Enhanced visualization
- Better user experience
- Responsive design
- Load Data: Upload a CSV or Excel file containing beam analysis data
- Select Material: Choose from the predefined material library
- Choose Cross-Section: Select the beam cross-section type and enter dimensions
- Run Analysis: Calculate stresses and safety factors
- View Results: Review analysis results and diagrams
- Optimize Design (GUI only): Use AI optimization to find the best design
- Export Report: Generate PDF reports for documentation
Your beam data file should contain three columns:
| Column Name | Description | Units |
|---|---|---|
| Distance (m) | Position along the beam | meters |
| SF (kN) | Shear force at each point | kilonewtons |
| BM (kN-m) | Bending moment at each point | kilonewton-meters |
Example CSV format:
Distance (m),SF (kN),BM (kN-m)
0.0,25.0,0.0
0.5,25.0,12.5
1.0,25.0,25.0
1.5,25.0,37.5
2.0,25.0,50.0
The AI optimization feature (available in the GUI version) uses genetic algorithms to find optimal beam designs based on:
- Objectives: Cost, Weight, Deflection, or Safety Factor
- Constraints: Maximum deflection and minimum safety factor
- Variables: Material type, cross-section type, and dimensions
The optimization process typically takes 1-3 minutes depending on the complexity.
beam_analyzer_project/
├── beam_analyzer_ai.py # Desktop GUI application
├── beam_analyzer_gui_03.py # Streamlit web application
├── run_gui.py # GUI launcher script
├── run_streamlit.py # Streamlit launcher script
├── requirements.txt # Python dependencies
├── README.md # This file
├── data/ # Sample data files
│ ├── sample_beam_data.csv
│ └── simply_supported_beam.csv
├── docs/ # Documentation (future)
├── samples/ # Additional examples (future)
└── venv/ # Virtual environment
Sample data files are provided in the data/ directory:
sample_beam_data.csv: Example beam with varying loadssimply_supported_beam.csv: Simply supported beam with point load
To test the applications:
- Start either the GUI or Streamlit app
- Load one of the sample files
- Select a material (e.g., A36 Steel)
- Choose a cross-section (e.g., Rectangular)
- Enter reasonable dimensions (e.g., 100mm width, 200mm height)
- Run the analysis
- Optimization is only available in the desktop GUI version
- Some advanced features may vary between versions
- Large datasets may require more processing time
- Genetic algorithm optimization may take several minutes
This project is licensed under the MIT License - see the LICENSE file for details.
For issues, questions, or contributions:
- Check the documentation
- Review sample data files
- Test with provided examples
- Create an issue for bugs or feature requests