A Python-based framework for optimizing Buckling Restrained Brace (BRB) placement in building structures using genetic algorithms. This project leverages OpenSeesPy for structural analysis and implements comprehensive seismic analysis capabilities including modal analysis, static analysis, and time history analysis.
This project provides a computational framework to optimize the placement of Buckling Restrained Braces in multi-story building frames. The optimization uses a genetic algorithm approach where each individual (genome) represents a specific brace configuration. The framework evaluates each configuration through rigorous structural analysis to determine optimal brace placement strategies.
- Genetic Algorithm-Based Optimization: Genome representation of brace configurations (0=no brace, 1=left-right, 2=right-left, 3=both directions)
- Comprehensive Structural Analysis:
- Modal analysis for natural frequencies and mode shapes
- Static gravity load analysis
- Time history analysis for seismic response
- Ground Motion Scaling: Tools for scaling seismic records to match target design spectra (ASCE 7-22)
- Bulk Analysis Capabilities: Process multiple ground motion records simultaneously
- OpenSeesPy Integration: Full integration with OpenSees for finite element analysis
- Visualization: Built-in plotting capabilities for model visualization and response analysis
- Python 3.7+
- OpenSeesPy
- NumPy
- Matplotlib
- opsvis (for OpenSees visualization)
- eqsig (for response spectrum generation)
- SciPy
- Clone the repository:
git clone https://github.com/yourusername/brb-optimization-using-genetic-algorithms.git
cd brb-optimization-using-genetic-algorithms- Install required dependencies:
pip install openseespy opsvis numpy matplotlib scipy eqsigbrb-optimization-using-genetic-algorithms/
│
├── __main__.py # Main execution script
├── model_class_builder.py # BuildingModel class for structural analysis
├── geom_and_load_props.py # Geometric and loading properties
├── units.py # Unit conversion utilities
├── read_peer_at2.py # PEER database ground motion reader
├── response.spectra.py # Response spectrum calculations
├── config/
│ └── tag_builders.py # Tag management for OpenSees elements
│
├── ground_motion_scaling/
│ ├── Seismic_Records/ # Original PEER ground motion records
│ ├── Scaled_Seismic_Records/ # Scaled ground motion records
│ └── target spectrum/ # Target design spectra files
│
├── ETABS Validation/ # ETABS model validation files
├── Reports/ # Analysis reports
└── gm_scaling.ipynb # Ground motion scaling notebook
from __main__ import run_analysis
import random
# Set random seed for reproducibility
random.seed(10)
# Define genome (brace configuration)
# Each value represents a brace port: 0=no brace, 1=left-right, 2=right-left, 3=both
genome = [random.choice([0,1,2,3]) for each in range(numPorts)]
# Run single time history analysis
run_analysis(
genome,
type="single_THA",
file_path=r"ground_motion_scaling\Scaled_Seismic_Records\Matched_RSN959_.txt"
)# Run analysis for multiple ground motion records
run_analysis(
genome,
type="Bulk_THA",
folder_path=r"ground_motion_scaling\Scaled_Seismic_Records"
)The building model parameters are defined in geom_and_load_props.py:
- Geometry: Number of bays, bay width, number of floors, story height
- Material Properties: Elastic modulus, Poisson's ratio
- Section Properties: Beam and column dimensions
- Loads: Super dead load and live load values
The genome is a list where each element represents a brace port configuration:
0: No brace1: Left-to-right brace2: Right-to-left brace3: Both directions (X-bracing)
- Calculates natural frequencies and mode shapes
- Supports multiple modes (default: 5 modes)
- Modal damping: 2%
- Gravity load analysis
- Distributed mass calculation
- Leaning column support for P-Delta effects
- Newmark integration method
- Uniform ground excitation
- Response recording at roof level
- Support for scaled and unscaled ground motions
The gm_scaling.ipynb notebook provides tools for:
- Reading PEER database ground motion records (.AT2 format)
- Generating target design spectra (ASCE 7-22)
- Scaling ground motions to match target spectra
- Visualizing response spectra comparisons
- 2D frame model with beams and columns
- Elastic beam-column elements
- Leaning columns for stability
- Steel4 material model for brace core
- Truss elements for axial behavior
- Two-node link elements for additional restraints
- Dowelled connections with Pinching4 material model
- Top dowelled connections (full strength)
- Bottom dowelled connections (half strength)
- Rotational pin connections
Bulk_THA_Output.json: Bulk time history analysis resultsBulk_THA_Output_Scaled.json: Scaled ground motion analysis resultsModal_Output: Modal analysis resultsaccel.out: Acceleration response time historydisp.out: Displacement response time history
Key parameters can be modified in geom_and_load_props.py:
numBay = 2 # Number of bays
bayWidth = 4.57*m # Bay width
numFloor = 3 # Number of floors
storyHeight = 3.35*m # Story height
E_mod = 10000.0 * MPa # Elastic modulusThe framework includes built-in visualization capabilities:
- Model geometry plots
- Mode shape visualization
- Deformed shape plots
- Time history response plots
- Response spectrum comparisons
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available for educational and research purposes.
- OpenSeesPy community for the structural analysis framework
- PEER database for ground motion records
- ASCE 7-22 for design spectrum guidelines
For questions or issues, please open an issue on the GitHub repository.
Note: This project is designed for research and educational purposes. Always verify results with professional engineering judgment and appropriate validation studies.