Non-Linear Time History Analysis (NLTHA) for Single Degree of Freedom (SDOF) Oscillators

In this method, a single degree of freedom (SDOF) model of each structure is subjected to non-linear time history analysis (NLTHA) using a suite of ground motion records. The displacements of the SDOF due to each ground motion record are used as input to determine the distribution of buildings in each damage state for each level of ground motion intensity. A regression algorithm is then applied to derive the fragility model.

The figure below illustrates a fragility model developed using this method.

Note: To run the code in a cell:

  1. Click on the cell to select it.
  2. Press SHIFT+ENTER on your keyboard or press the play button () in the toolbar above.

In [27]:
import NLTHA_on_SDOF
from rmtk.vulnerability.common import utils
%matplotlib inline

Load capacity curves

In order to use this methodology, it is necessary to provide one (or a group) of capacity curves, defined according to the format described in the RMTK manual.

Please provide the location of the file containing the capacity curves using the parameter capacity_curves_file.


In [34]:
capacity_curves_file = "../../../../../rmtk_data/capacity_curves_Sa-Sd.csv"
#sdof_hysteresis = "Default"
sdof_hysteresis = "../../../../../rmtk_data/pinching_parameters.csv"

In [35]:
from read_pinching_parameters import read_parameters

capacity_curves = utils.read_capacity_curves(capacity_curves_file)
capacity_curves = utils.check_SDOF_curves(capacity_curves)
utils.plot_capacity_curves(capacity_curves)
hysteresis = read_parameters(sdof_hysteresis)


Load ground motion records

Please indicate the path to the folder containing the ground motion records to be used in the analysis through the parameter gmrs_folder.

Note: Each accelerogram needs to be in a separate CSV file as described in the RMTK manual.

The parameters minT and maxT are used to define the period bounds when plotting the spectra for the provided ground motion fields.


In [36]:
gmrs_folder = "../../../../../rmtk_data/GMRs"
minT, maxT = 0.1, 2.0

gmrs = utils.read_gmrs(gmrs_folder)
utils.plot_response_spectra(gmrs, minT, maxT)


Load damage state thresholds

Please provide the path to your damage model file using the parameter damage_model_file in the cell below.

The damage types currently supported are: capacity curve dependent, spectral displacement and interstorey drift. If the damage model type is interstorey drift the user can provide the pushover curve in terms of Vb-dfloor to be able to convert interstorey drift limit states to roof displacements and spectral displacements, otherwise a linear relationship is assumed.


In [37]:
damage_model_file = "../../../../../rmtk_data/damage_model_ISD.csv"
damage_model = utils.read_damage_model(damage_model_file)

Obtain the damage probability matrix

The following parameters need to be defined in the cell below in order to calculate the damage probability matrix:

  1. damping_ratio: This parameter defines the damping ratio for the structure.
  2. degradation: This boolean parameter should be set to True or False to specify whether structural degradation should be considered in the analysis or not.

In [38]:
damping_ratio = 0.05
degradation = False

In [39]:
PDM, Sds = NLTHA_on_SDOF.calculate_fragility(capacity_curves, hysteresis, gmrs, damage_model, damping_ratio, degradation)


5%
10%
15%
20%
25%
30%
35%
40%
45%
50%
55%
60%
65%
70%
75%
80%
85%
90%
95%
100%

Fit lognormal CDF fragility curves

The following parameters need to be defined in the cell below in order to fit lognormal CDF fragility curves to the damage probability matrix obtained above:

  1. IMT: This parameter specifies the intensity measure type to be used. Currently supported options are "PGA", "Sa" and "Sd".
  2. T: This parameter defines the time period of the fundamental mode of vibration of the structure.
  3. regression_method: This parameter defines the regression method to be used for estimating the parameters of the fragility functions. The valid options are "least squares" and "max likelihood".

In [9]:
IMT = "Sa"
T = 1.5
regression_method = "max likelihood"

In [10]:
fragility_model = utils.calculate_mean_fragility(gmrs, PDM, T, damping_ratio, 
                                                 IMT, damage_model, regression_method)


Optimization terminated successfully.
         Current function value: -0.000000
         Iterations: 22
         Function evaluations: 62
Optimization terminated successfully.
         Current function value: -0.000000
         Iterations: 22
         Function evaluations: 62
Optimization terminated successfully.
         Current function value: -0.000000
         Iterations: 22
         Function evaluations: 62
Optimization terminated successfully.
         Current function value: -0.000000
         Iterations: 22
         Function evaluations: 62
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/stats/distributions.py:7184: RuntimeWarning: invalid value encountered in greater_equal
  return (n >= 0) & (p >= 0) & (p <= 1)
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/stats/distributions.py:7184: RuntimeWarning: invalid value encountered in less_equal
  return (n >= 0) & (p >= 0) & (p <= 1)

Plot fragility functions

The following parameters need to be defined in the cell below in order to plot the lognormal CDF fragility curves obtained above:

  • minIML and maxIML: These parameters define the limits of the intensity measure level for plotting the functions

In [11]:
minIML, maxIML = 0.01, 3.00

In [12]:
utils.plot_fragility_model(fragility_model, minIML, maxIML)


Save fragility functions

The derived parametric fragility functions can be saved to a file in either CSV format or in the NRML format that is used by all OpenQuake input models. The following parameters need to be defined in the cell below in order to save the lognormal CDF fragility curves obtained above:

  1. taxonomy: This parameter specifies a taxonomy string for the the fragility functions.
  2. minIML and maxIML: These parameters define the bounds of applicability of the functions.
  3. output_type: This parameter specifies the file format to be used for saving the functions. Currently, the formats supported are "csv" and "nrml".

In [18]:
taxonomy = "RC"
minIML, maxIML = 0.01, 2.00
output_type = "csv"
output_path = "../../../../../rmtk_data/output/"

In [19]:
utils.save_mean_fragility(taxonomy, fragility_model, minIML, maxIML, output_type, output_path)

Obtain vulnerability function

A vulnerability model can be derived by combining the set of fragility functions obtained above with a consequence model. In this process, the fractions of buildings in each damage state are multiplied by the associated damage ratio from the consequence model, in order to obtain a distribution of loss ratio for each intensity measure level.

The following parameters need to be defined in the cell below in order to calculate vulnerability functions using the above derived fragility functions:

  1. cons_model_file: This parameter specifies the path of the consequence model file.
  2. imls: This parameter specifies a list of intensity measure levels in increasing order at which the distribution of loss ratios are required to be calculated.
  3. distribution_type: This parameter specifies the type of distribution to be used for calculating the vulnerability function. The distribution types currently supported are "lognormal", "beta", and "PMF".

In [20]:
cons_model_file = "../../../../../rmtk_data/cons_model.csv"
imls = [0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 
        0.60, 0.70, 0.80, 0.90, 1.00, 1.20, 1.40, 1.60, 1.80, 2.00, 
        2.20, 2.40, 2.60, 2.80, 3.00, 3.20, 3.40, 3.60, 3.80, 4.00]
distribution_type = "lognormal"

In [21]:
cons_model = utils.read_consequence_model(cons_model_file)
vulnerability_model = utils.convert_fragility_vulnerability(fragility_model, cons_model, 
                                                            imls, distribution_type)

Plot vulnerability function


In [22]:
utils.plot_vulnerability_model(vulnerability_model)


Save vulnerability function

The derived parametric or nonparametric vulnerability function can be saved to a file in either CSV format or in the NRML format that is used by all OpenQuake input models. The following parameters need to be defined in the cell below in order to save the lognormal CDF fragility curves obtained above:

  1. taxonomy: This parameter specifies a taxonomy string for the the fragility functions.
  2. output_type: This parameter specifies the file format to be used for saving the functions. Currently, the formats supported are "csv" and "nrml".

In [23]:
taxonomy = "RC"
output_type = "csv"
output_path = "../../../../../rmtk_data/output/"

In [24]:
utils.save_vulnerability(taxonomy, vulnerability_model, output_type, output_path)

In [ ]: