RMTK batch facility

The risk Modellers toolkit Batch Facility allows users to derive fragility models for a set of building classes sequenteally. This way, it is not necessary to run each building class at the time, but simply to provide the location of the folder containing the necessary ground motion records and capacity curves.

In the following figure, a set of fragility models calculated using the N2 method and the batch facility are presented:

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 established on the RMTK manual. Please provide the location of the folder containing this input using the parameter input_folder.


In [ ]:
from rmtk.vulnerability.common import utils
from rmtk.vulnerability.derivation_fragility.hybrid_methods.N2 import N2Method

%matplotlib inline 
files_folder = '../../../../rmtk_data/portfolio_Italy'
models = utils.read_set_models(files_folder)

Load ground motion records

The demand in this methodology is input by a set of ground motion records, which should follow the format established in the RMTK manual. Please provide the location of this folder using the parameter gmrs_folder. It is also possible to plot the corresponding response spectra (displacement, pseudo-acceleration, and Sa-Sd), for which the minimum and maximum periods of interest (minT and maxT) should also be provided.


In [ ]:
gmrs_folder = '../../../../rmtk_data/accelerograms'
gmrs = utils.read_gmrs(gmrs_folder)
minT = 0.1
maxT = 2
utils.plot_response_spectra(gmrs,minT,maxT)

In [ ]:
damage_model = utils.read_damage_model('../../../../../rmtk_data/damage_model.csv')
damping = 0.05
T = 2.0

for imodel in range(len(models['name'])):
    print models['name'][imodel]
    capacity_curves = utils.read_capacity_curves(models['location'][imodel])
    utils.plot_capacity_curves(capacity_curves)    
    PDM, Sds = N2Method.calculate_fragility(capacity_curves,gmrs,damage_model,damping)
    fragility_model = utils.calculate_mean_fragility(gmrs,PDM,T,damping,'Sa',damage_model)
    utils.plot_fragility_model(fragility_model,0.01,2)

In [ ]: