Skip to content

ashishthapaweb/brb-optimization-using-genetic-algorithms

Repository files navigation

BRB Optimization Using Genetic Algorithms

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.

🏗️ Overview

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.

Key Features

  • 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

📋 Prerequisites

  • Python 3.7+
  • OpenSeesPy
  • NumPy
  • Matplotlib
  • opsvis (for OpenSees visualization)
  • eqsig (for response spectrum generation)
  • SciPy

🚀 Installation

  1. Clone the repository:
git clone https://github.com/yourusername/brb-optimization-using-genetic-algorithms.git
cd brb-optimization-using-genetic-algorithms
  1. Install required dependencies:
pip install openseespy opsvis numpy matplotlib scipy eqsig

📁 Project Structure

brb-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

💻 Usage

Basic Single Time History Analysis

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

Bulk Time History Analysis

# Run analysis for multiple ground motion records
run_analysis(
    genome,
    type="Bulk_THA",
    folder_path=r"ground_motion_scaling\Scaled_Seismic_Records"
)

Building Model Configuration

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

Genome Representation

The genome is a list where each element represents a brace port configuration:

  • 0: No brace
  • 1: Left-to-right brace
  • 2: Right-to-left brace
  • 3: Both directions (X-bracing)

🔬 Analysis Capabilities

1. Modal Analysis

  • Calculates natural frequencies and mode shapes
  • Supports multiple modes (default: 5 modes)
  • Modal damping: 2%

2. Static Analysis

  • Gravity load analysis
  • Distributed mass calculation
  • Leaning column support for P-Delta effects

3. Time History Analysis

  • Newmark integration method
  • Uniform ground excitation
  • Response recording at roof level
  • Support for scaled and unscaled ground motions

4. Ground Motion Scaling

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

🏛️ Structural Model Details

Building Frame

  • 2D frame model with beams and columns
  • Elastic beam-column elements
  • Leaning columns for stability

Buckling Restrained Braces

  • Steel4 material model for brace core
  • Truss elements for axial behavior
  • Two-node link elements for additional restraints
  • Dowelled connections with Pinching4 material model

Connections

  • Top dowelled connections (full strength)
  • Bottom dowelled connections (half strength)
  • Rotational pin connections

📊 Output Files

  • Bulk_THA_Output.json: Bulk time history analysis results
  • Bulk_THA_Output_Scaled.json: Scaled ground motion analysis results
  • Modal_Output: Modal analysis results
  • accel.out: Acceleration response time history
  • disp.out: Displacement response time history

🔧 Configuration

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 modulus

📈 Visualization

The framework includes built-in visualization capabilities:

  • Model geometry plots
  • Mode shape visualization
  • Deformed shape plots
  • Time history response plots
  • Response spectrum comparisons

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📝 License

This project is open source and available for educational and research purposes.

🙏 Acknowledgments

  • OpenSeesPy community for the structural analysis framework
  • PEER database for ground motion records
  • ASCE 7-22 for design spectrum guidelines

📧 Contact

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published