Generating Fragility Curves for Seismic Risk Assessment

In the field of performance-based earthquake engineering, fragility curves are indispensable tools. These probabilistic functions describe the likelihood that a structure or component will exceed a certain damage state when subjected to varying levels of seismic intensity—typically measured using Spectral Acceleration (Sa) or Peak Ground Acceleration (PGA).

At QuakeLogic, we help researchers, engineers, and emergency planners develop and automate fragility analysis as part of seismic resilience studies. This blog post introduces a fully open-source Python script developed by our team that reads structural response data and generates fragility curves for multiple damage states.

What Are Fragility Curves?

A fragility curve is a cumulative distribution function (CDF) that defines the conditional probability:

P(Damage ≥ State | Intensity Measure)

This means that, for a given level of shaking (e.g., 0.3g Sa), the curve tells you the probability that a structure will exceed a limit-state such as Moderate or Complete damage.

We typically use lognormal distributions to model fragility because they capture the exponential rise in damage probability with increasing shaking intensity.

Engineering Demand Parameters (EDPs) and Intensity Measures (IMs)

In seismic fragility analysis, the relationship is between:

  • EDP (Engineering Demand Parameter): A measurable response of the structure.
  • IM (Intensity Measure): A scalar value representing the strength of ground shaking.

Common EDPs:

  • Maximum interstory drift ratio (MIDR) – most widely used for buildings
  • Peak floor acceleration
  • Residual drift
  • Relative displacement
  • Roof displacement
  • Member strains or rotations (for local component fragility)

Common IMs:

  • PGA (Peak Ground Acceleration)
  • Sa(T1) – Spectral acceleration at fundamental period (T1)
  • PGV (Peak Ground Velocity)
  • Arias Intensity
  • CAV (Cumulative Absolute Velocity)

Choosing the right IM and EDP depends on the structure type, the available data, and the analysis objective.

Understanding the Fragility Curve Plot

The plot generated by the code shows the fragility curves for multiple damage states. Here’s how to read it:

  • X-axis: Intensity Measure (IM)
    In our example, this is Sa(T1) (spectral acceleration), but it can be PGA, PGV, or any other meaningful measure of shaking intensity.
  • Y-axis: Probability of Exceedance
    This is the probability that the structure’s response (EDP) will exceed the defined threshold for each damage state.

Interpretation:

A steeper curve implies a rapid transition from low to high damage probability — common for brittle systems or clearly defined performance thresholds.Methodology Overview

As the intensity of shaking (IM) increases, the probability of damage naturally increases.

Fragility curves slope upwards — from 0 to 1 — showing this increasing probability.

Robust structures have curves that shift rightward, indicating a lower probability of damage at a given IM.

  1. Input Data: Simulated or observed structural responses (e.g., drift ratios) vs. seismic intensities.
  2. Damage States: Thresholds for damage classification (e.g., 1%, 3%, 4%, 5% drift).
  3. Binning: The Sa values are grouped and used to calculate the fraction of samples exceeding each damage threshold.
  4. Curve Fitting: We fit a lognormal CDF to the exceedance probabilities using non-linear regression.
  5. Visualization: Fragility curves are plotted for each damage state.

Example Output

Input Format (input.txt)

A simple tab-separated file with the following columns:

Sa_T1_g    MaxDrift_ratio
0.1        0.0043
0.15       0.0098
...        ...

You can download an example file here.

Python Code: Fragility Curve Generator

################################################################################
# Fragility Curve Generator for Seismic Risk Analysis
#
# This script calculates and visualizes fragility curves for structural
# components or systems based on nonlinear response data from a suite of
# ground motions.
#
# Fragility curves represent the conditional probability that a structure
# will exceed a predefined damage state for a given ground motion intensity
# measure (IM), typically spectral acceleration (Sa). These curves are
# essential tools for probabilistic seismic risk assessment and
# performance-based earthquake engineering.
#
# The script uses a lognormal cumulative distribution function (CDF) to fit
# observed probabilities of exceedance derived from drift thresholds and
# structural response data. Drift ratios are compared against damage state
# thresholds to calculate these probabilities at various IM bins.
#
# Generated by: QuakeLogic Inc.
# Contact: support@quakelogic.net
################################################################################

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.stats import lognorm
from scipy.optimize import curve_fit

def run():
    try:
        df = pd.read_csv("input.txt", sep='\t')
    except FileNotFoundError:
        print("❌ input.txt not found. Please ensure it exists in the working directory.")
        return

    IMs = df['Sa_T1_g'].values
    EDPs = df['MaxDrift_ratio'].values

    damage_states = {
        'Slight': 0.01,
        'Moderate': 0.03,
        'Extensive': 0.04,
        'Complete': 0.05
    }

    fragility_results = {}
    unique_IMs = np.linspace(min(IMs), max(IMs), 20)
    tolerance = 0.05

    for ds, threshold in damage_states.items():
        prob_exceed = []
        for im in unique_IMs:
            edp_subset = EDPs[np.abs(IMs - im) < tolerance]
            if len(edp_subset) > 0:
                prob = np.mean(edp_subset >= threshold)
            else:
                prob = 0
            prob_exceed.append(prob)

        def lognorm_cdf(x, mu, sigma):
            return lognorm.cdf(x, s=sigma, scale=np.exp(mu))

        prob_array = np.array(prob_exceed)
        if np.all(prob_array == 0) or np.all(prob_array == 1):
            print(f"⚠️ Skipping '{ds}' — flat probability distribution (all 0s or all 1s)")
            fragility_results[ds] = (np.nan, np.nan)
            continue

        try:
            popt, _ = curve_fit(lognorm_cdf, unique_IMs, prob_exceed, p0=[np.log(np.mean(unique_IMs)), 0.5])
            mu, sigma = popt
            fragility_results[ds] = (mu, sigma)
            print(f"✔️ Fitted '{ds}': mu = {mu:.3f}, sigma = {sigma:.3f}")
        except Exception as e:
            print(f"❌ Failed to fit for '{ds}': {e}")
            fragility_results[ds] = (np.nan, np.nan)

    plt.figure(figsize=(10, 6))
    x_vals = np.linspace(min(IMs), max(IMs), 300)
    for ds, (mu, sigma) in fragility_results.items():
        if np.isnan(mu): continue
        plt.plot(x_vals, lognorm.cdf(x_vals, s=sigma, scale=np.exp(mu)), label=ds)

    plt.ylim(0, 1)
    plt.xlabel("Spectral Acceleration Sa(T1) [g]", fontsize=12)
    plt.ylabel("Probability of Exceedance", fontsize=12)
    plt.title("Seismic Fragility Curves by Damage State", fontsize=14)
    plt.grid(True, linestyle='--', alpha=0.7)
    plt.legend(title="Damage State")
    plt.tight_layout()
    plt.savefig("fragility_curves_combined.png", dpi=300)
    plt.show()
    print("📈 Fragility plot saved as 'fragility_curves_combined.png'")

if __name__ == '__main__':
    run()

Summary

This fragility analysis tool allows engineers and researchers to:

  • Automate fragility curve generation from drift or response data
  • Visualize performance thresholds for multiple damage states
  • Incorporate results into risk models or decision-making tools

Need Help?

QuakeLogic Inc. provides advanced tools and consulting for:

  • Earthquake early warning systems
  • Structural health monitoring (SHM)
  • Fragility model development
  • Shake table testing and seismic instrumentation

📧 Reach out to us anytime: support@quakelogic.net

Understanding Linearity, Repeatability, and Phase Lag in Digital Sensors

QL-mini-shm sensor

Digital sensors are the backbone of effective real-time monitoring systems, especially in fields where accuracy and responsiveness are crucial, such as seismic monitoring, structural health assessment, and environmental monitoring. Key performance characteristics—linearity, repeatability, and phase lag—define a sensor’s accuracy, consistency, and responsiveness. Understanding these factors and how they are measured can help ensure the reliability of monitoring systems and the quality of data collected.

Linearity: What It Is and How to Measure It

Definition: Linearity indicates how accurately a sensor’s output follows a straight line relative to the input. Ideally, a sensor should have a direct, proportional relationship between input and output across its full range, meaning that changes in the input yield corresponding, linear changes in the output. However, sensors often deviate from this ideal, impacting their linearity.

Measurement: To measure linearity, test the sensor across its entire measurement range and compare its output to the ideal linear response. Deviations from this line can be quantified as a percentage of the full-scale output. Lower deviation percentages signify higher linearity, making the sensor more reliable for precision measurements.

Importance for Real-Time Monitoring: Linearity ensures the sensor output consistently reflects the actual value of the measured phenomenon, which is crucial in applications like seismic monitoring. Accurate linearity enables sensors to capture ground motion amplitudes precisely, providing essential data for analyzing seismic waves and predicting potential impacts.

Repeatability: What It Is and How to Measure It

Definition: Repeatability is the sensor’s ability to produce the same output under identical conditions over multiple measurements. High repeatability signifies consistent, reliable data collection, which is vital for any monitoring application.

Measurement: To assess repeatability, the sensor is exposed to the same input several times while recording each output. The variations in these measurements are quantified, often using standard deviation. Smaller variations indicate higher repeatability, demonstrating the sensor’s ability to provide consistent results under similar conditions.

Importance for Real-Time Monitoring: High repeatability ensures consistent data, vital in real-time monitoring applications like earthquake early warning systems or structural health monitoring. Reliable, repeatable data builds confidence in the monitoring system’s accuracy, supporting timely and well-informed decision-making.

Phase Lag: What It Is and How to Measure It

Definition: Phase lag, or phase delay, is the time delay between a sensor’s output and the occurrence of the measured event. A low phase lag indicates that the sensor can quickly respond to changes, an essential trait for systems monitoring dynamic or rapidly shifting environments.

Measurement: Phase lag can be measured by applying a known waveform, such as a sinusoidal signal, to the sensor and recording the output’s response time. The phase difference between the input and output is quantified in degrees or time units. A smaller phase lag value indicates a faster response, ensuring the sensor’s output stays in sync with real-time changes.

Importance for Real-Time Monitoring: For critical monitoring applications, phase lag can compromise the reliability of data. In seismic monitoring, a delay in sensor response can affect wave propagation analysis, making low phase lag essential to real-time applications. When phase lag is minimized, data more accurately reflects real-world events, supporting rapid response actions during emergencies.


QuakeLogic’s New QL-MINI and QL-MINI-SHM Sensors

At QuakeLogic, we are excited to introduce our latest additions to our seismic and structural health monitoring (SHM) product line: the QL-MINI and QL-MINI-SHM sensors. These compact, high-performance digital sensors are engineered to offer unmatched precision in real-time monitoring applications, making them ideal for infrastructure, geotechnical, and environmental monitoring.

QL-MINI: Designed for versatility and efficiency, the QL-MINI combines compactness with high accuracy, making it ideal for a range of monitoring applications. With its exceptional linearity and repeatability, the QL-MINI provides consistent data and minimal phase lag, ensuring precise, real-time insights for critical applications.

QL-MINI-SHM: Tailored specifically for structural health monitoring, the QL-MINI-SHM sensor provides advanced data fidelity with ultra-low phase lag and superior repeatability. It’s ideal for monitoring structural integrity, ensuring safety and resilience in buildings, bridges, and other critical infrastructure.

QL-mini-shm sensor

Both QL-MINI and QL-MINI-SHM models are designed to meet the rigorous demands of real-time monitoring, providing the highest levels of accuracy, consistency, and responsiveness. By choosing QuakeLogic’s sensors, you’re investing in state-of-the-art technology that supports proactive maintenance and risk mitigation, offering peace of mind through high-quality, reliable data.


About QuakeLogic

QuakeLogic is a leading provider of advanced seismic monitoring solutions, offering a range of products and services designed to enhance the accuracy and efficiency of seismic data acquisition and analysis. Our innovative technologies and expert support help organizations worldwide to better understand and mitigate the impacts of seismic events.

Contact Information
Email: sales@quakelogic.net
Phone: +1-916-899-0391
WhatsApp: +1-650-353-8627
Website: www.quakelogic.net

For more information about our products and services, please visit our website or contact our sales team. We are here to help you with all your seismic monitoring needs.

Thank you for choosing QuakeLogic. We look forward to assisting you with your seismic monitoring projects.

The Doppler Effect: A Powerful Tool for Structural Health Monitoring

At QuakeLogic, we are constantly exploring advanced technologies to enhance the safety and integrity of critical infrastructure. One such innovative approach involves leveraging the Doppler Effect for Structural Health Monitoring (SHM).

What is the Doppler Effect?

The Doppler Effect refers to the change in frequency or wavelength of a wave as observed by someone moving relative to the source of the wave. You’ve probably experienced this when a car speeds by—its sound shifts from high pitch to low as it moves past. This change occurs because, as the car approaches, the sound waves are compressed (increasing frequency), and as it moves away, the waves are stretched (decreasing frequency).

In SHM, the Doppler Effect can be applied to monitor the structural vibrations and dynamic behaviors of buildings, bridges, wind turbines, and other infrastructure. By tracking these vibrations, engineers can assess the health of structures in real time, ensuring their safety and identifying issues before they lead to failure.

Doppler-Based SHM Applications

The Doppler Effect has found significant applications in SHM, offering non-contact, precise, and real-time monitoring capabilities. Here are some of the primary methods in which it’s used:

  1. Radar-Based Structural Monitoring
    Doppler radar systems are widely used in monitoring the vibrations of structures. By detecting shifts in reflected waves, radar can measure the velocity and displacement of structural elements. For example, radar systems are used to monitor the vibrations of bridges and buildings, providing critical insights into their integrity. Any abnormal shifts in vibration frequencies could indicate the onset of structural damage or degradation.
  2. Laser Doppler Vibrometry (LDV)
    LDVs are highly accurate, non-contact sensors that measure vibration velocity and displacement by detecting the Doppler shift in laser beams reflected off a vibrating surface. This technique is particularly effective for detecting minute vibrations that could signal early-stage damage. LDV is ideal for seismic testing, offering unparalleled precision in monitoring the dynamic response of a structure under load.
  3. Ultrasound Doppler Techniques
    Ultrasonic waves are commonly used in SHM to detect flaws such as cracks or voids within materials. When a material undergoes stress, the Doppler shift in ultrasonic waves can be used to measure the motion of defects, helping engineers assess the severity of the damage and predict how it will evolve. This is especially useful for materials prone to fatigue, such as those in high-stress environments like bridges and aircraft.
  4. Wireless Sensor Networks
    Advances in wireless sensor technology have allowed for the deployment of Doppler-based systems in large-scale infrastructure monitoring. These networks use Doppler sensors to detect changes in vibrational patterns and send real-time data to a central system. This type of remote monitoring enables engineers to identify potential structural issues without the need for manual inspection, which can be both costly and dangerous.

Why Use the Doppler Effect in Structural Health Monitoring?

  • Non-Invasive Monitoring: Doppler-based systems are non-contact, meaning that structures can be monitored continuously and safely, even in difficult-to-access locations.
  • High Sensitivity: Doppler sensors can detect even the smallest changes in vibration or displacement, providing early detection of potential issues before they become major problems.
  • Real-Time Data: Continuous data collection allows for real-time analysis, giving engineers the ability to make informed decisions quickly—especially critical in the aftermath of natural disasters such as earthquakes or high winds.

Real-World Applications

  • Bridge Monitoring: QuakeLogic is using Doppler-based systems to monitor the vibration and movement of bridges. By analyzing the Doppler shifts, engineers can detect structural issues caused by traffic loads or environmental stressors and ensure the bridge remains safe for use.
  • Wind Turbine Health: Doppler sensors are also used to monitor the structural health of wind turbine blades, detecting cracks or material fatigue before they lead to critical failure.
  • Building Safety: After seismic events, Doppler technologies can assess the condition of buildings by measuring their response to vibrations, ensuring their structural integrity remains intact.

At QuakeLogic, we believe that the Doppler Effect has tremendous potential to revolutionize structural health monitoring. By applying this technology to infrastructure, we can help ensure the long-term safety and stability of critical structures, from bridges to wind turbines to high-rise buildings.

Conclusion

As infrastructure ages and natural disasters become more frequent, the need for innovative SHM technologies grows. Doppler-based systems provide a non-invasive, precise, and real-time solution for detecting structural issues early, enabling preventative maintenance and ensuring public safety. At QuakeLogic, we are committed to integrating cutting-edge technologies like the Doppler Effect into our monitoring systems to protect infrastructure and prevent failures before they happen.

Seeing is Believing. To learn more about our advanced structural health monitoring solutions, get in touch with QuakeLogic today!

About QuakeLogic

QuakeLogic is a leading provider of advanced seismic monitoring solutions, offering a range of products and services designed to enhance the accuracy and efficiency of seismic data acquisition and analysis. Our innovative technologies and expert support help organizations worldwide to better understand and mitigate the impacts of seismic events.

Contact Information

  • Email: sales@quakelogic.net
  • Phone: +1-916-899-0391
  • WhatsApp: +1-650-353-8627
  • Website: www.quakelogic.net

For more information about our products and services, please visit our website or contact our sales team. We are here to help you with all your seismic monitoring needs.