SlideShare a Scribd company logo
Seismic Hazard Assessment Software in Python
by Prof. Dr. Costas Sachpazis, May 2024
Overview
This simple Python software is designed to assist Civil and Geotechnical
Engineers in performing site-specific seismic hazard assessments. The
program calculates the seismic response spectrum based on user-provided
geotechnical and seismic parameters, generating a comprehensive technical
report that includes the response spectrum data and figures. The analysis
adheres to Eurocode 8 and the Greek Annex, ensuring compliance with
international standards for earthquake-resistant design.
Note: “dejavu-sans” Fonts must be installed in your PC
Functions and Usage
1. get_user_inputs()
o Description: This function prompts the user to input site-
specific parameters necessary for the seismic hazard
assessment.
o Parameters Collected:
 Site Class: The soil classification at the site (A, B, C, D, E).
 Seismic Zone Factor (ag): The reference peak ground
acceleration for the seismic zone.
 Importance Factor (γI): The importance factor of the
structure.
o Usage: The user runs the program and inputs the requested
parameters when prompted.
2. get_site_amplification_factor(site_class)
o Description: This function determines the site amplification
factor (S) based on the site class provided by the user.
o Parameters:
 site_class: The soil classification at the site.
o Returns: The site amplification factor (S).
o Usage: Automatically called by the main program to obtain the
amplification factor for the given site class.
3. generate_response_spectrum(ag, S, gamma_I)
o Description: This function generates the response spectrum
data based on the input parameters.
o Parameters:
 ag: The seismic zone factor (reference peak ground
acceleration).
 S: The site amplification factor.
 gamma_I: The importance factor of the structure.
o Returns: Arrays of periods (T) and spectral accelerations (Sa).
o Usage: Automatically called by the main program to compute
the response spectrum.
4. create_technical_report(site_class, ag, gamma_I, T, Sa, fig_path)
o Description: This function generates the technical report in PDF
format, including the response spectrum data and figures.
o Parameters:
 site_class: The soil classification at the site.
 ag: The seismic zone factor.
 gamma_I: The importance factor of the structure.
 T: Array of periods.
 Sa: Array of spectral accelerations.
 fig_path: File path to the saved response spectrum figure.
o Usage: Automatically called by the main program to generate
and save the PDF report.
5. main()
o Description: This is the main function that orchestrates the
program execution. It calls the other functions to collect inputs,
compute the response spectrum, and generate the technical
report.
o Usage: Run the program to start the process. The user will be
prompted to enter the required parameters, and the program
will handle the rest.
Usage for Civil Engineers
Civil Engineers can use this software to perform detailed seismic hazard
assessments for their projects. By inputting site-specific geotechnical and
seismic parameters, the software calculates the seismic response spectrum,
which is crucial for designing earthquake-resistant structures. The generated
technical report includes comprehensive data and visualizations, aiding in
the analysis and decision-making process.
Compliance with Eurocode 8
This software performs its analysis in accordance with Eurocode 8: Design of
structures for earthquake resistance and the Greek National Annex to
Eurocode 8. These standards provide guidelines and specifications for
assessing seismic hazards and designing structures to withstand seismic
events. By adhering to these codes, the software ensures that the analysis
meets international standards for safety and reliability.
Example of Usage
1. Run the Program: Execute the Python script in your Python
environment.
2. Input Parameters: When prompted, enter the site class, seismic zone
factor, and importance factor.
3. Generate Report: The program calculates the seismic response
spectrum and generates a PDF report containing the analysis results
and figures.
4. Review Report: Open and review the generated PDF report to
understand the seismic hazard assessment for your site.
Summary
This Seismic Hazard Assessment Software developed by Prof. Dr. Costas
Sachpazis is a powerful tool for Civil Engineers, providing a streamlined
process for performing site-specific seismic hazard assessments. By following
Eurocode 8 and the Greek Annex, the software ensures that the analysis is
accurate and compliant with international standards, facilitating the design
of earthquake-resistant structures.
Should you need any clarifications and/or explanations, please contact me at
costas@sachpazis.info
Dr. Costas Sachpazis
Python Script/Code:
********************** START
import matplotlib.pyplot as plt
import numpy as np
from fpdf import FPDF, XPos, YPos
# Define a custom PDF class to use a Unicode font
class PDF(FPDF):
def header(self):
self.set_font("DejaVu-Bold", size=16)
self.cell(200, 10, text="Seismic Hazard Assessment Report",
new_x=XPos.LMARGIN, new_y=YPos.NEXT)
self.ln(10)
self.set_font("DejaVu-Bold", size=12)
self.cell(200, 10, text="Python Program/Code written by Professor Dr.
Costas Sachpazis, Civil Engineer", new_x=XPos.LMARGIN,
new_y=YPos.NEXT)
self.ln(20)
# Function to get user inputs
def get_user_inputs():
site_class = input("Enter site class (A, B, C, D, E): ").strip().upper()
seismic_zone = float(input("Enter seismic zone factor (ag): "))
importance_factor = float(input("Enter importance factor (γI): "))
return site_class, seismic_zone, importance_factor
# Function to determine site amplification factor S
def get_site_amplification_factor(site_class):
site_factors = {
'A': 1.0,
'B': 1.2,
'C': 1.15,
'D': 1.35,
'E': 1.4
}
return site_factors.get(site_class, 1.0)
# Function to generate the response spectrum
def generate_response_spectrum(ag, S, gamma_I):
TB = 0.15
TC = 0.5
TD = 2.0
T = np.linspace(0, 3, 300)
S_eff = ag * S * gamma_I
Sa = np.piecewise(T,
[T < TB, (T >= TB) & (T < TC), (T >= TC) & (T < TD), T >= TD],
[lambda T: S_eff * (1 + T / TB),
lambda T: S_eff,
lambda T: S_eff * TC / T,
lambda T: S_eff * TC * TD / (T ** 2)])
return T, Sa
# Function to create the technical report
def create_technical_report(site_class, ag, gamma_I, T, Sa, fig_path):
pdf = PDF()
# Add the Unicode font
pdf.add_font("DejaVu", "", "DejaVuSans.ttf")
pdf.add_font("DejaVu-Bold", "", "DejaVuSans-Bold.ttf")
pdf.set_font("DejaVu", size=12)
pdf.add_page()
pdf.cell(200, 10, text=f"Site Class: {site_class}", new_x=XPos.LMARGIN,
new_y=YPos.NEXT)
pdf.cell(200, 10, text=f"Seismic Zone Factor (ag): {ag}",
new_x=XPos.LMARGIN, new_y=YPos.NEXT)
pdf.cell(200, 10, text=f"Importance Factor (γI): {gamma_I}",
new_x=XPos.LMARGIN, new_y=YPos.NEXT)
pdf.ln(10)
pdf.cell(200, 10, text="Response Spectrum Data:", new_x=XPos.LMARGIN,
new_y=YPos.NEXT)
pdf.ln(10)
for t, sa in zip(T, Sa):
pdf.cell(200, 10, text=f"T = {t:.2f}, Sa = {sa:.4f}", new_x=XPos.LMARGIN,
new_y=YPos.NEXT)
pdf.add_page()
pdf.cell(200, 10, text="Response Spectrum Figure:",
new_x=XPos.LMARGIN, new_y=YPos.NEXT)
pdf.ln(10)
pdf.image(fig_path, x=10, y=None, w=190) # Adjust x, y, w as needed
pdf.output("Seismic_Hazard_Assessment_Report.pdf")
# Main program
def main():
site_class, ag, gamma_I = get_user_inputs()
S = get_site_amplification_factor(site_class)
T, Sa = generate_response_spectrum(ag, S, gamma_I)
# Plot the response spectrum
plt.figure()
plt.plot(T, Sa, label='Response Spectrum')
plt.xlabel('Period (T)')
plt.ylabel('Spectral Acceleration (Sa)')
plt.title('Elastic Response Spectrum')
plt.legend()
plt.grid(True)
fig_path = "response_spectrum.png"
plt.savefig(fig_path)
plt.show()
# Generate the technical report
create_technical_report(site_class, ag, gamma_I, T, Sa, fig_path)
print("Seismic Hazard Assessment Report generated successfully.")
if __name__ == "__main__":
main()
********************** END
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis

More Related Content

Similar to Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis

dsp.pdf
dsp.pdfdsp.pdf
dsp.pdf
Naol Worku
 
Mobile CDS LTE Simulation Demo
Mobile CDS LTE Simulation Demo Mobile CDS LTE Simulation Demo
Mobile CDS LTE Simulation Demo
Dr. Edwin Hernandez
 
M.G.Goman et al (1994) - PII package: Brief description
M.G.Goman et al (1994) - PII package: Brief descriptionM.G.Goman et al (1994) - PII package: Brief description
M.G.Goman et al (1994) - PII package: Brief description
Project KRIT
 
LMmanual.pdf
LMmanual.pdfLMmanual.pdf
LMmanual.pdf
NarutoUzumaki413489
 
Qe Reference
Qe ReferenceQe Reference
Qe Reference
Susan Gold
 
source code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniquessource code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniques
Siva Priya
 
Functions
FunctionsFunctions
Functions
Swarup Boro
 
IRJET- Development of Generalize Software to Estimate Cooling Load for Air Co...
IRJET- Development of Generalize Software to Estimate Cooling Load for Air Co...IRJET- Development of Generalize Software to Estimate Cooling Load for Air Co...
IRJET- Development of Generalize Software to Estimate Cooling Load for Air Co...
IRJET Journal
 
IRJET- Monument Informatica Application using AR
IRJET-  	  Monument Informatica Application using ARIRJET-  	  Monument Informatica Application using AR
IRJET- Monument Informatica Application using AR
IRJET Journal
 
C programming
C programmingC programming
C programming
Shahariar limon
 
Development of Software for Estimation of Structural Dynamic Characteristics ...
Development of Software for Estimation of Structural Dynamic Characteristics ...Development of Software for Estimation of Structural Dynamic Characteristics ...
Development of Software for Estimation of Structural Dynamic Characteristics ...
IRJET Journal
 
Final Design Project - Memo (with GUI)
Final Design Project - Memo (with GUI)Final Design Project - Memo (with GUI)
Final Design Project - Memo (with GUI)
Alex Larcheveque
 
Detecting soft errors by a purely software approach
Detecting soft errors by a purely software approachDetecting soft errors by a purely software approach
Detecting soft errors by a purely software approach
Md. Hasibur Rashid
 
Detecting soft errors by a purely software approach
Detecting soft errors by a purely software approachDetecting soft errors by a purely software approach
Detecting soft errors by a purely software approach
Md. Hasibur Rashid
 
How to Make Hand Detector on Native Activity with OpenCV
How to Make Hand Detector on Native Activity with OpenCVHow to Make Hand Detector on Native Activity with OpenCV
How to Make Hand Detector on Native Activity with OpenCV
Industrial Technology Research Institute (ITRI)(工業技術研究院, 工研院)
 
C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17
manjurkts
 
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17 CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
manjurkts
 
ELE2303 Assign 1 Page 1 ELE2303 Embedded Systems Design.docx
ELE2303 Assign 1  Page  1 ELE2303 Embedded Systems Design.docxELE2303 Assign 1  Page  1 ELE2303 Embedded Systems Design.docx
ELE2303 Assign 1 Page 1 ELE2303 Embedded Systems Design.docx
jack60216
 
EC6612 VLSI Design Lab Manual
EC6612 VLSI Design Lab ManualEC6612 VLSI Design Lab Manual
EC6612 VLSI Design Lab Manual
tamil arasan
 
SOFTWARE BASED CALCULATION OF CAPACITY OUTAGE OF GENERATING UNITS
SOFTWARE BASED CALCULATION OF CAPACITY OUTAGE OF GENERATING UNITSSOFTWARE BASED CALCULATION OF CAPACITY OUTAGE OF GENERATING UNITS
SOFTWARE BASED CALCULATION OF CAPACITY OUTAGE OF GENERATING UNITS
vivatechijri
 

Similar to Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis (20)

dsp.pdf
dsp.pdfdsp.pdf
dsp.pdf
 
Mobile CDS LTE Simulation Demo
Mobile CDS LTE Simulation Demo Mobile CDS LTE Simulation Demo
Mobile CDS LTE Simulation Demo
 
M.G.Goman et al (1994) - PII package: Brief description
M.G.Goman et al (1994) - PII package: Brief descriptionM.G.Goman et al (1994) - PII package: Brief description
M.G.Goman et al (1994) - PII package: Brief description
 
LMmanual.pdf
LMmanual.pdfLMmanual.pdf
LMmanual.pdf
 
Qe Reference
Qe ReferenceQe Reference
Qe Reference
 
source code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniquessource code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniques
 
Functions
FunctionsFunctions
Functions
 
IRJET- Development of Generalize Software to Estimate Cooling Load for Air Co...
IRJET- Development of Generalize Software to Estimate Cooling Load for Air Co...IRJET- Development of Generalize Software to Estimate Cooling Load for Air Co...
IRJET- Development of Generalize Software to Estimate Cooling Load for Air Co...
 
IRJET- Monument Informatica Application using AR
IRJET-  	  Monument Informatica Application using ARIRJET-  	  Monument Informatica Application using AR
IRJET- Monument Informatica Application using AR
 
C programming
C programmingC programming
C programming
 
Development of Software for Estimation of Structural Dynamic Characteristics ...
Development of Software for Estimation of Structural Dynamic Characteristics ...Development of Software for Estimation of Structural Dynamic Characteristics ...
Development of Software for Estimation of Structural Dynamic Characteristics ...
 
Final Design Project - Memo (with GUI)
Final Design Project - Memo (with GUI)Final Design Project - Memo (with GUI)
Final Design Project - Memo (with GUI)
 
Detecting soft errors by a purely software approach
Detecting soft errors by a purely software approachDetecting soft errors by a purely software approach
Detecting soft errors by a purely software approach
 
Detecting soft errors by a purely software approach
Detecting soft errors by a purely software approachDetecting soft errors by a purely software approach
Detecting soft errors by a purely software approach
 
How to Make Hand Detector on Native Activity with OpenCV
How to Make Hand Detector on Native Activity with OpenCVHow to Make Hand Detector on Native Activity with OpenCV
How to Make Hand Detector on Native Activity with OpenCV
 
C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17
 
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17 CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
 
ELE2303 Assign 1 Page 1 ELE2303 Embedded Systems Design.docx
ELE2303 Assign 1  Page  1 ELE2303 Embedded Systems Design.docxELE2303 Assign 1  Page  1 ELE2303 Embedded Systems Design.docx
ELE2303 Assign 1 Page 1 ELE2303 Embedded Systems Design.docx
 
EC6612 VLSI Design Lab Manual
EC6612 VLSI Design Lab ManualEC6612 VLSI Design Lab Manual
EC6612 VLSI Design Lab Manual
 
SOFTWARE BASED CALCULATION OF CAPACITY OUTAGE OF GENERATING UNITS
SOFTWARE BASED CALCULATION OF CAPACITY OUTAGE OF GENERATING UNITSSOFTWARE BASED CALCULATION OF CAPACITY OUTAGE OF GENERATING UNITS
SOFTWARE BASED CALCULATION OF CAPACITY OUTAGE OF GENERATING UNITS
 

More from Dr.Costas Sachpazis

Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...
Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...
Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...
Dr.Costas Sachpazis
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Dr.Costas Sachpazis
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Dr.Costas Sachpazis
 
Sachpazis: Steel member fire resistance design to Eurocode 3 / Σαχπάζης: Σχεδ...
Sachpazis: Steel member fire resistance design to Eurocode 3 / Σαχπάζης: Σχεδ...Sachpazis: Steel member fire resistance design to Eurocode 3 / Σαχπάζης: Σχεδ...
Sachpazis: Steel member fire resistance design to Eurocode 3 / Σαχπάζης: Σχεδ...
Dr.Costas Sachpazis
 
Sachpazis_Retaining Structures-Ground Anchors and Anchored Systems_C_Sachpazi...
Sachpazis_Retaining Structures-Ground Anchors and Anchored Systems_C_Sachpazi...Sachpazis_Retaining Structures-Ground Anchors and Anchored Systems_C_Sachpazi...
Sachpazis_Retaining Structures-Ground Anchors and Anchored Systems_C_Sachpazi...
Dr.Costas Sachpazis
 
Chapter9Lec16Jan03.ppt
Chapter9Lec16Jan03.pptChapter9Lec16Jan03.ppt
Chapter9Lec16Jan03.ppt
Dr.Costas Sachpazis
 
ΓΕΩΛΟΓΙΚΟΙ ΧΑΡΤΕΣ IntroToMaps_v2_PART1.ppt
ΓΕΩΛΟΓΙΚΟΙ ΧΑΡΤΕΣ IntroToMaps_v2_PART1.pptΓΕΩΛΟΓΙΚΟΙ ΧΑΡΤΕΣ IntroToMaps_v2_PART1.ppt
ΓΕΩΛΟΓΙΚΟΙ ΧΑΡΤΕΣ IntroToMaps_v2_PART1.ppt
Dr.Costas Sachpazis
 
MBA-EMarketing-Lecture.pptx
MBA-EMarketing-Lecture.pptxMBA-EMarketing-Lecture.pptx
MBA-EMarketing-Lecture.pptx
Dr.Costas Sachpazis
 
Marketing.ppt
Marketing.pptMarketing.ppt
Marketing.ppt
Dr.Costas Sachpazis
 
Sachpazis σαχπάζης φορέας αμφιέρειστης πλάκας
Sachpazis σαχπάζης φορέας αμφιέρειστης πλάκαςSachpazis σαχπάζης φορέας αμφιέρειστης πλάκας
Sachpazis σαχπάζης φορέας αμφιέρειστης πλάκας
Dr.Costas Sachpazis
 
Single pile analysis &amp; design, l=18,00m d=1,10m, by C.Sachpazis
Single pile analysis &amp; design, l=18,00m d=1,10m, by C.SachpazisSingle pile analysis &amp; design, l=18,00m d=1,10m, by C.Sachpazis
Single pile analysis &amp; design, l=18,00m d=1,10m, by C.Sachpazis
Dr.Costas Sachpazis
 
Pile configuration optimization on the design of combined piled raft foundations
Pile configuration optimization on the design of combined piled raft foundationsPile configuration optimization on the design of combined piled raft foundations
Pile configuration optimization on the design of combined piled raft foundations
Dr.Costas Sachpazis
 
Σαχπάζης Πλεονεκτήματα και Προκλήσεις της Αιολικής Ενέργειας
Σαχπάζης Πλεονεκτήματα και Προκλήσεις της Αιολικής ΕνέργειαςΣαχπάζης Πλεονεκτήματα και Προκλήσεις της Αιολικής Ενέργειας
Σαχπάζης Πλεονεκτήματα και Προκλήσεις της Αιολικής Ενέργειας
Dr.Costas Sachpazis
 
Sachpazis: Raft Foundation Analysis and Design for a two Storey House Project...
Sachpazis: Raft Foundation Analysis and Design for a two Storey House Project...Sachpazis: Raft Foundation Analysis and Design for a two Storey House Project...
Sachpazis: Raft Foundation Analysis and Design for a two Storey House Project...
Dr.Costas Sachpazis
 
Sachpazis_Pile Analysis and Design for Acropolis Project According to EN 1997...
Sachpazis_Pile Analysis and Design for Acropolis Project According to EN 1997...Sachpazis_Pile Analysis and Design for Acropolis Project According to EN 1997...
Sachpazis_Pile Analysis and Design for Acropolis Project According to EN 1997...
Dr.Costas Sachpazis
 
Sachpazis truss analysis and design example_28-02-2021
Sachpazis truss analysis and design example_28-02-2021Sachpazis truss analysis and design example_28-02-2021
Sachpazis truss analysis and design example_28-02-2021
Dr.Costas Sachpazis
 
Sachpazis" Analysis of Geogrid Reinforced Earth Slope Stability & Capacity
Sachpazis" Analysis of Geogrid Reinforced Earth Slope Stability & CapacitySachpazis" Analysis of Geogrid Reinforced Earth Slope Stability & Capacity
Sachpazis" Analysis of Geogrid Reinforced Earth Slope Stability & Capacity
Dr.Costas Sachpazis
 
Sachpazis what is differential settlement 4654
Sachpazis what is differential settlement 4654Sachpazis what is differential settlement 4654
Sachpazis what is differential settlement 4654
Dr.Costas Sachpazis
 

More from Dr.Costas Sachpazis (20)

Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...
Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...
Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Sachpazis: Steel member fire resistance design to Eurocode 3 / Σαχπάζης: Σχεδ...
Sachpazis: Steel member fire resistance design to Eurocode 3 / Σαχπάζης: Σχεδ...Sachpazis: Steel member fire resistance design to Eurocode 3 / Σαχπάζης: Σχεδ...
Sachpazis: Steel member fire resistance design to Eurocode 3 / Σαχπάζης: Σχεδ...
 
Sachpazis_Retaining Structures-Ground Anchors and Anchored Systems_C_Sachpazi...
Sachpazis_Retaining Structures-Ground Anchors and Anchored Systems_C_Sachpazi...Sachpazis_Retaining Structures-Ground Anchors and Anchored Systems_C_Sachpazi...
Sachpazis_Retaining Structures-Ground Anchors and Anchored Systems_C_Sachpazi...
 
Chapter9Lec16Jan03.ppt
Chapter9Lec16Jan03.pptChapter9Lec16Jan03.ppt
Chapter9Lec16Jan03.ppt
 
ΓΕΩΛΟΓΙΚΟΙ ΧΑΡΤΕΣ IntroToMaps_v2_PART1.ppt
ΓΕΩΛΟΓΙΚΟΙ ΧΑΡΤΕΣ IntroToMaps_v2_PART1.pptΓΕΩΛΟΓΙΚΟΙ ΧΑΡΤΕΣ IntroToMaps_v2_PART1.ppt
ΓΕΩΛΟΓΙΚΟΙ ΧΑΡΤΕΣ IntroToMaps_v2_PART1.ppt
 
MBA-EMarketing-Lecture.pptx
MBA-EMarketing-Lecture.pptxMBA-EMarketing-Lecture.pptx
MBA-EMarketing-Lecture.pptx
 
Marketing.ppt
Marketing.pptMarketing.ppt
Marketing.ppt
 
Sachpazis σαχπάζης φορέας αμφιέρειστης πλάκας
Sachpazis σαχπάζης φορέας αμφιέρειστης πλάκαςSachpazis σαχπάζης φορέας αμφιέρειστης πλάκας
Sachpazis σαχπάζης φορέας αμφιέρειστης πλάκας
 
Single pile analysis &amp; design, l=18,00m d=1,10m, by C.Sachpazis
Single pile analysis &amp; design, l=18,00m d=1,10m, by C.SachpazisSingle pile analysis &amp; design, l=18,00m d=1,10m, by C.Sachpazis
Single pile analysis &amp; design, l=18,00m d=1,10m, by C.Sachpazis
 
Pile configuration optimization on the design of combined piled raft foundations
Pile configuration optimization on the design of combined piled raft foundationsPile configuration optimization on the design of combined piled raft foundations
Pile configuration optimization on the design of combined piled raft foundations
 
Σαχπάζης Πλεονεκτήματα και Προκλήσεις της Αιολικής Ενέργειας
Σαχπάζης Πλεονεκτήματα και Προκλήσεις της Αιολικής ΕνέργειαςΣαχπάζης Πλεονεκτήματα και Προκλήσεις της Αιολικής Ενέργειας
Σαχπάζης Πλεονεκτήματα και Προκλήσεις της Αιολικής Ενέργειας
 
Sachpazis: Raft Foundation Analysis and Design for a two Storey House Project...
Sachpazis: Raft Foundation Analysis and Design for a two Storey House Project...Sachpazis: Raft Foundation Analysis and Design for a two Storey House Project...
Sachpazis: Raft Foundation Analysis and Design for a two Storey House Project...
 
Sachpazis_Pile Analysis and Design for Acropolis Project According to EN 1997...
Sachpazis_Pile Analysis and Design for Acropolis Project According to EN 1997...Sachpazis_Pile Analysis and Design for Acropolis Project According to EN 1997...
Sachpazis_Pile Analysis and Design for Acropolis Project According to EN 1997...
 
Sachpazis truss analysis and design example_28-02-2021
Sachpazis truss analysis and design example_28-02-2021Sachpazis truss analysis and design example_28-02-2021
Sachpazis truss analysis and design example_28-02-2021
 
Sachpazis" Analysis of Geogrid Reinforced Earth Slope Stability & Capacity
Sachpazis" Analysis of Geogrid Reinforced Earth Slope Stability & CapacitySachpazis" Analysis of Geogrid Reinforced Earth Slope Stability & Capacity
Sachpazis" Analysis of Geogrid Reinforced Earth Slope Stability & Capacity
 
Sachpazis what is differential settlement 4654
Sachpazis what is differential settlement 4654Sachpazis what is differential settlement 4654
Sachpazis what is differential settlement 4654
 

Recently uploaded

Supermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdfSupermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdf
Kamal Acharya
 
Presentation on Food Delivery Systems
Presentation on Food Delivery SystemsPresentation on Food Delivery Systems
Presentation on Food Delivery Systems
Abdullah Al Noman
 
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdfAsymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
felixwold
 
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls ChennaiCall Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
paraasingh12 #V08
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
Atif Razi
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
VANDANAMOHANGOUDA
 
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptxEV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
nikshimanasa
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
Divyanshu
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
nedcocy
 
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
OKORIE1
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
Paris Salesforce Developer Group
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Transcat
 
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdfSELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
Pallavi Sharma
 
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
sydezfe
 
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
DharmaBanothu
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
harshapolam10
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
MadhavJungKarki
 
Height and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdfHeight and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdf
q30122000
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
PreethaV16
 
Beckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview PresentationBeckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview Presentation
VanTuDuong1
 

Recently uploaded (20)

Supermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdfSupermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdf
 
Presentation on Food Delivery Systems
Presentation on Food Delivery SystemsPresentation on Food Delivery Systems
Presentation on Food Delivery Systems
 
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdfAsymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
 
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls ChennaiCall Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
 
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptxEV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
 
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
DESIGN AND MANUFACTURE OF CEILING BOARD USING SAWDUST AND WASTE CARTON MATERI...
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
 
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdfSELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
 
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
 
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
 
Height and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdfHeight and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdf
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
 
Beckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview PresentationBeckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview Presentation
 

Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis

  • 1. Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis, May 2024 Overview This simple Python software is designed to assist Civil and Geotechnical Engineers in performing site-specific seismic hazard assessments. The program calculates the seismic response spectrum based on user-provided geotechnical and seismic parameters, generating a comprehensive technical report that includes the response spectrum data and figures. The analysis adheres to Eurocode 8 and the Greek Annex, ensuring compliance with international standards for earthquake-resistant design. Note: “dejavu-sans” Fonts must be installed in your PC
  • 2. Functions and Usage 1. get_user_inputs() o Description: This function prompts the user to input site- specific parameters necessary for the seismic hazard assessment. o Parameters Collected:  Site Class: The soil classification at the site (A, B, C, D, E).  Seismic Zone Factor (ag): The reference peak ground acceleration for the seismic zone.  Importance Factor (γI): The importance factor of the structure. o Usage: The user runs the program and inputs the requested parameters when prompted. 2. get_site_amplification_factor(site_class) o Description: This function determines the site amplification factor (S) based on the site class provided by the user. o Parameters:  site_class: The soil classification at the site. o Returns: The site amplification factor (S). o Usage: Automatically called by the main program to obtain the amplification factor for the given site class. 3. generate_response_spectrum(ag, S, gamma_I) o Description: This function generates the response spectrum data based on the input parameters. o Parameters:
  • 3.  ag: The seismic zone factor (reference peak ground acceleration).  S: The site amplification factor.  gamma_I: The importance factor of the structure. o Returns: Arrays of periods (T) and spectral accelerations (Sa). o Usage: Automatically called by the main program to compute the response spectrum. 4. create_technical_report(site_class, ag, gamma_I, T, Sa, fig_path) o Description: This function generates the technical report in PDF format, including the response spectrum data and figures. o Parameters:  site_class: The soil classification at the site.  ag: The seismic zone factor.  gamma_I: The importance factor of the structure.  T: Array of periods.  Sa: Array of spectral accelerations.  fig_path: File path to the saved response spectrum figure. o Usage: Automatically called by the main program to generate and save the PDF report. 5. main() o Description: This is the main function that orchestrates the program execution. It calls the other functions to collect inputs, compute the response spectrum, and generate the technical report.
  • 4. o Usage: Run the program to start the process. The user will be prompted to enter the required parameters, and the program will handle the rest. Usage for Civil Engineers Civil Engineers can use this software to perform detailed seismic hazard assessments for their projects. By inputting site-specific geotechnical and seismic parameters, the software calculates the seismic response spectrum, which is crucial for designing earthquake-resistant structures. The generated technical report includes comprehensive data and visualizations, aiding in the analysis and decision-making process. Compliance with Eurocode 8 This software performs its analysis in accordance with Eurocode 8: Design of structures for earthquake resistance and the Greek National Annex to Eurocode 8. These standards provide guidelines and specifications for assessing seismic hazards and designing structures to withstand seismic events. By adhering to these codes, the software ensures that the analysis meets international standards for safety and reliability. Example of Usage 1. Run the Program: Execute the Python script in your Python environment. 2. Input Parameters: When prompted, enter the site class, seismic zone factor, and importance factor. 3. Generate Report: The program calculates the seismic response spectrum and generates a PDF report containing the analysis results and figures.
  • 5. 4. Review Report: Open and review the generated PDF report to understand the seismic hazard assessment for your site. Summary This Seismic Hazard Assessment Software developed by Prof. Dr. Costas Sachpazis is a powerful tool for Civil Engineers, providing a streamlined process for performing site-specific seismic hazard assessments. By following Eurocode 8 and the Greek Annex, the software ensures that the analysis is accurate and compliant with international standards, facilitating the design of earthquake-resistant structures. Should you need any clarifications and/or explanations, please contact me at costas@sachpazis.info Dr. Costas Sachpazis
  • 6. Python Script/Code: ********************** START import matplotlib.pyplot as plt import numpy as np from fpdf import FPDF, XPos, YPos # Define a custom PDF class to use a Unicode font class PDF(FPDF): def header(self): self.set_font("DejaVu-Bold", size=16) self.cell(200, 10, text="Seismic Hazard Assessment Report", new_x=XPos.LMARGIN, new_y=YPos.NEXT) self.ln(10) self.set_font("DejaVu-Bold", size=12) self.cell(200, 10, text="Python Program/Code written by Professor Dr. Costas Sachpazis, Civil Engineer", new_x=XPos.LMARGIN, new_y=YPos.NEXT) self.ln(20) # Function to get user inputs def get_user_inputs(): site_class = input("Enter site class (A, B, C, D, E): ").strip().upper() seismic_zone = float(input("Enter seismic zone factor (ag): ")) importance_factor = float(input("Enter importance factor (γI): "))
  • 7. return site_class, seismic_zone, importance_factor # Function to determine site amplification factor S def get_site_amplification_factor(site_class): site_factors = { 'A': 1.0, 'B': 1.2, 'C': 1.15, 'D': 1.35, 'E': 1.4 } return site_factors.get(site_class, 1.0) # Function to generate the response spectrum def generate_response_spectrum(ag, S, gamma_I): TB = 0.15 TC = 0.5 TD = 2.0 T = np.linspace(0, 3, 300) S_eff = ag * S * gamma_I Sa = np.piecewise(T,
  • 8. [T < TB, (T >= TB) & (T < TC), (T >= TC) & (T < TD), T >= TD], [lambda T: S_eff * (1 + T / TB), lambda T: S_eff, lambda T: S_eff * TC / T, lambda T: S_eff * TC * TD / (T ** 2)]) return T, Sa # Function to create the technical report def create_technical_report(site_class, ag, gamma_I, T, Sa, fig_path): pdf = PDF() # Add the Unicode font pdf.add_font("DejaVu", "", "DejaVuSans.ttf") pdf.add_font("DejaVu-Bold", "", "DejaVuSans-Bold.ttf") pdf.set_font("DejaVu", size=12) pdf.add_page() pdf.cell(200, 10, text=f"Site Class: {site_class}", new_x=XPos.LMARGIN, new_y=YPos.NEXT) pdf.cell(200, 10, text=f"Seismic Zone Factor (ag): {ag}", new_x=XPos.LMARGIN, new_y=YPos.NEXT)
  • 9. pdf.cell(200, 10, text=f"Importance Factor (γI): {gamma_I}", new_x=XPos.LMARGIN, new_y=YPos.NEXT) pdf.ln(10) pdf.cell(200, 10, text="Response Spectrum Data:", new_x=XPos.LMARGIN, new_y=YPos.NEXT) pdf.ln(10) for t, sa in zip(T, Sa): pdf.cell(200, 10, text=f"T = {t:.2f}, Sa = {sa:.4f}", new_x=XPos.LMARGIN, new_y=YPos.NEXT) pdf.add_page() pdf.cell(200, 10, text="Response Spectrum Figure:", new_x=XPos.LMARGIN, new_y=YPos.NEXT) pdf.ln(10) pdf.image(fig_path, x=10, y=None, w=190) # Adjust x, y, w as needed pdf.output("Seismic_Hazard_Assessment_Report.pdf") # Main program def main(): site_class, ag, gamma_I = get_user_inputs() S = get_site_amplification_factor(site_class)
  • 10. T, Sa = generate_response_spectrum(ag, S, gamma_I) # Plot the response spectrum plt.figure() plt.plot(T, Sa, label='Response Spectrum') plt.xlabel('Period (T)') plt.ylabel('Spectral Acceleration (Sa)') plt.title('Elastic Response Spectrum') plt.legend() plt.grid(True) fig_path = "response_spectrum.png" plt.savefig(fig_path) plt.show() # Generate the technical report create_technical_report(site_class, ag, gamma_I, T, Sa, fig_path) print("Seismic Hazard Assessment Report generated successfully.") if __name__ == "__main__": main() ********************** END