InĀ [1]:
import sys
import os
parent_dir = os.path.abspath("../../libraries/earthquake_resilience")
sys.path.insert(0, parent_dir)

import warnings
warnings.filterwarnings("ignore", category=RuntimeWarning)
warnings.filterwarnings("ignore", category=FutureWarning)
InĀ [2]:
import eq_resilience_library
import pandas as pd
InĀ [3]:
latitude = 43.7874
longitude = 11.2499

soil_category = 'A'
nominal_life = 50
topographic_category = 'T1'
importance_class = 'I'

file_path = "../../demo/data/EQ_resilience/PORdata_Machiavelli2P_api_new_format.xls.xlsx"
file = pd.ExcelFile(file_path)
InĀ [4]:
ParaTR, city, country = eq_resilience_library.get_Parameters(latitude, longitude)
print("{}, {}".format(city, country))
if ParaTR is None:
    print("Earthquake hazard calculation is not supported in the selected region. Please add Italian coordinates or upload the return period parameters in a CSV file below.")
Loading formatted geocoded file...
Florence, IT
InĀ [5]:
f = eq_resilience_library.get_map(latitude, longitude, city, country)
f
Out[5]:
InĀ [6]:
ParaTR
Out[6]:
Return Period ag Fo Tc*
0 30.0 0.047018 2.551014 0.252808
1 50.0 0.056464 2.586081 0.267521
2 72.0 0.064100 2.593636 0.276378
3 101.0 0.072345 2.590411 0.281871
4 140.0 0.080685 2.597692 0.287275
5 201.0 0.093504 2.531818 0.293817
6 475.0 0.131090 2.420610 0.301819
7 975.0 0.167652 2.390029 0.310319
8 2475.0 0.221719 2.411010 0.318801

Layout

InĀ [7]:
n_floors, n_walls_per_floor, dimensions, center_coordinates, alpha  = eq_resilience_library.get_data_for_2d_layout(file)
figures = eq_resilience_library.plot_wall_resistance(center_coordinates, dimensions, alpha, n_floors)
No description has been provided for this image
No description has been provided for this image

Linear analysis calculation

InĀ [8]:
behaviour_factor_q = 1.5

IR_fess_X, IR_fess_Y, IR_pf_X, IR_pf_Y, IR_pf_ort_X, IR_pf_ort_Y = eq_resilience_library.linear_static_analysis(file, ParaTR, soil_category, topographic_category, nominal_life, importance_class, behaviour_factor_q)

Linear analysis layout

InĀ [9]:
direction = 'Y'
chosen_floor = 1

linear_dataframes = eq_resilience_library.get_linear_dataframes(direction, IR_fess_X, IR_fess_Y, IR_pf_X, IR_pf_Y, IR_pf_ort_X, IR_pf_ort_Y, chosen_floor=chosen_floor)
linear_dataframes
Out[9]:
Direction Y, floor 1 Wall ID Shear Bending in plane Bending out of plane
0 21.0 1.20 1.00 2.17
1 22.0 0.93 0.52 1.34
2 23.0 0.95 0.55 1.41
3 24.0 0.95 0.56 1.42
4 25.0 0.93 0.53 1.36
... ... ... ... ...
65 147.0 0.97 0.27 0.93
66 148.0 1.02 0.38 0.97
67 149.0 2.29 6.33 0.50
68 150.0 1.92 2.62 0.45
69 151.0 1.92 2.62 0.45

70 rows Ɨ 4 columns

InĀ [10]:
linear_analysis_figures = eq_resilience_library.choose_linear_analysis_plot(file, direction, IR_fess_X, IR_fess_Y, IR_pf_X, IR_pf_Y, IR_pf_ort_X, IR_pf_ort_Y, chosen_floor=chosen_floor)
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image

Pushover analysis calculation

InĀ [11]:
check_type = 'Ductility check'

vr_ult_TOT, Hult_TOT, x_coordinates, y_coordinates, ADRS, Sda, Saa, delta_ult_eq, S_eq, dxstar_t, Tr, IR, ADRS_TR, Sda_TR, Saa_TR, ag_Tr, L = eq_resilience_library.pushover_analysis_calculation(file, ParaTR, soil_category, topographic_category, nominal_life, importance_class, check_type)
pushover_dataframe = eq_resilience_library.get_pushover_dataframe(x_coordinates, dxstar_t, Tr, ag_Tr, IR)
pushover_dataframe
Out[11]:
Direction Safety Index PGA_C TR Ī“ d* (t)
0 X 1.47 0.17 1020.0 16.29 13.39
1 Y 1.18 0.14 526.0 14.99 15.48

Pushover analysis plots

InĀ [12]:
figures = eq_resilience_library.global_pushover_plot(vr_ult_TOT, Hult_TOT, ADRS, Sda, Saa, delta_ult_eq, S_eq, dxstar_t, Tr, IR, ADRS_TR, Sda_TR, Saa_TR)
No description has been provided for this image
No description has been provided for this image
InĀ [13]:
direction = 'Y'

figures = eq_resilience_library.plot_wall_failures(file, direction, L)
No description has been provided for this image
No description has been provided for this image