Skip to main content

Modified Acceleration-Displacement Response Spectrum (MADRS) seismic analysis method

Project description

MADRS — Modified Acceleration-Displacement Response Spectrum

A Python package implementing the MADRS method of FEMA 440 for seismic performance-point calculation using pushover curves and response spectra.


Installation

From PyPI (once published)

pip install madrs

Directly from GitHub

pip install git+https://github.com/YOUR_USERNAME/MADRS.git

Local development install (editable)

git clone https://github.com/YOUR_USERNAME/MADRS.git
cd MADRS
pip install -e .

Quick Start

import numpy as np
from madrs import MADRS_Method

# --- Pushover curve: columns = [displacement (m), base shear (kN)] ---
PO = np.loadtxt("pushover.csv", delimiter=",")

# --- Demand curve: columns = [period (s), Sa (g)] ---
DC = np.loadtxt("spectrum.csv", delimiter=",")

# --- Modal / structural parameters ---
pf1       = 1.30    # Modal participation factor (1st mode)
alpha1    = 0.85    # Modal mass coefficient (1st mode)
wt        = 5000.0  # Seismic weight (kN)
phi_roof1 = 1.0     # 1st-mode shape at roof

tol  = 1e-4   # Area-balance tolerance for bilinear fitting
CP1  = 0.5    # Lower ay search bound (fraction of api)
CP2  = 0.95   # Upper ay search bound (fraction of api)
CP3 = 0.5     # Controls initial stiffness of the bi-linear curve (ranges from 0 to 1, preferred 0.5)

results = MADRS_Method(PO, DC, pf1, alpha1, wt, phi_roof1, tol, CP1, CP2, CP3)

dpi, api, dy, ay, roof_disp, flag, *_ = results

if flag:
    print(f"Performance point — Sd: {dpi:.4f} m  |  Sa: {api:.4f} g")
    print(f"Roof displacement : {roof_disp:.4f} m")
else:
    print("No performance point found — adjust CP1, CP2, or tol.")

API Reference

MADRS_Method

MADRS_Method(PO, DC, pf1, alpha1, wt, phi_roof1, tol, CP1, CP2,
             show_intermediate_plots=True)
Parameter Type Description
PO ndarray (N, 2) Pushover curve — [displacement (m), base shear (kN)]
DC ndarray (M, 2) Demand/response spectrum — [period (s), Sa (g)]
pf1 float Modal participation factor (1st mode)
alpha1 float Modal mass coefficient (1st mode)
wt float Seismic weight (kN)
phi_roof1 float 1st-mode shape value at roof
tol float Tolerance for bilinear area balance
CP1 float Lower multiplier for ay search
CP2 float Upper multiplier for ay search
CP3 float Controls initial stiffness of the bi-linear curve (ranges from 0 to 1, preferred 0.5)
show_intermediate_plots bool Show 6-panel diagnostic figure (default True)

Returns (dpi, api, dy, ay, roof_disp, flag, Sd_spectra, Sa_Spectranew, Sd, Sa, x_bilinear, y_bilinear)

Helper functions

from madrs import curve_intersections, closest_point_on_curve, area_between_curves
  • curve_intersections(x1, y1, x2, y2) — find intersection points between two polylines
  • closest_point_on_curve(P, x_curve, y_curve) — nearest point on a polyline to point P
  • area_between_curves(x, y1, y2) — signed area between two curves via Simpson's rule

Requirements

  • Python ≥ 3.9
  • numpy ≥ 1.24
  • scipy ≥ 1.10
  • matplotlib ≥ 3.7

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

madrs-0.1.3.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

madrs-0.1.3-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file madrs-0.1.3.tar.gz.

File metadata

  • Download URL: madrs-0.1.3.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for madrs-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a6c7bb01a27c7dd6708c36c01d71232b4a6a9dd33e395c92274c65879a51ffbf
MD5 fe1a9dcce0ca932598e2f5f4044d6f35
BLAKE2b-256 030d687fbb9884a2a9899df13be3a646f0c0e82a4a0ad68382d71850581dd276

See more details on using hashes here.

File details

Details for the file madrs-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: madrs-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for madrs-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d7d5b6ff17416acd0b007ad6439859f26bd4ad74a6b4bb7c160033eaf9cd4f57
MD5 9f6344ece0f05c3d9ec7d08b221f6e04
BLAKE2b-256 e2d0afb176ba8481330a941b58622c994ff7671c21fa0aebbbbc7f8729875c45

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page