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: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
 
Sachpazis: Retaining Walls - Know How Basics_
Sachpazis: Retaining Walls - Know How Basics_Sachpazis: Retaining Walls - Know How Basics_
Sachpazis: Retaining Walls - Know How Basics_
Dr.Costas Sachpazis
 

More from Dr.Costas Sachpazis (20)

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
 
Sachpazis: Retaining Walls - Know How Basics_
Sachpazis: Retaining Walls - Know How Basics_Sachpazis: Retaining Walls - Know How Basics_
Sachpazis: Retaining Walls - Know How Basics_
 

Recently uploaded

一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
zwunae
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
Exception Handling notes in java exception
Exception Handling notes in java exceptionException Handling notes in java exception
Exception Handling notes in java exception
Ratnakar Mikkili
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
iemerc2024
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
ssuser36d3051
 
introduction to solar energy for engineering.pdf
introduction to solar energy for engineering.pdfintroduction to solar energy for engineering.pdf
introduction to solar energy for engineering.pdf
ravindarpurohit26
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
drwaing
 
This is my Environmental physics presentation
This is my Environmental physics presentationThis is my Environmental physics presentation
This is my Environmental physics presentation
ZainabHashmi17
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
Divyam548318
 
Adaptive synchronous sliding control for a robot manipulator based on neural ...
Adaptive synchronous sliding control for a robot manipulator based on neural ...Adaptive synchronous sliding control for a robot manipulator based on neural ...
Adaptive synchronous sliding control for a robot manipulator based on neural ...
IJECEIAES
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
ihlasbinance2003
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
ChristineTorrepenida1
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理
一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理
一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理
skuxot
 

Recently uploaded (20)

一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
Exception Handling notes in java exception
Exception Handling notes in java exceptionException Handling notes in java exception
Exception Handling notes in java exception
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
 
introduction to solar energy for engineering.pdf
introduction to solar energy for engineering.pdfintroduction to solar energy for engineering.pdf
introduction to solar energy for engineering.pdf
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
 
This is my Environmental physics presentation
This is my Environmental physics presentationThis is my Environmental physics presentation
This is my Environmental physics presentation
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
 
Adaptive synchronous sliding control for a robot manipulator based on neural ...
Adaptive synchronous sliding control for a robot manipulator based on neural ...Adaptive synchronous sliding control for a robot manipulator based on neural ...
Adaptive synchronous sliding control for a robot manipulator based on neural ...
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理
一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理
一比一原版(UC Berkeley毕业证)加利福尼亚大学|伯克利分校毕业证成绩单专业办理
 

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