Git Product home page Git Product logo

earthquake-acceleration-responce-spectrum's Introduction

Earthquake-Acceleration-Responce-Spectrum

Using single degree of freedom system to analyze the influence of strong earthquake waveform to building, and also use high-pass and low-pass filter to preprocess our data, and calculate three component waveforms PSD (Maximum Relative Pseudo-Displacement), PSV (Maximum Relative Pseudo-Velocity), PSA (MaximumAbsolute Pseudo- Acceleration).

File descriptipon

pseudo_spectrum.py is the main code, including all preprocess and caculation

HWA019 Acceleration Responce Spectrum.png one of examples which is 2018 0206 Hualien earthquake record from station HWA019. The image show the three component PSA

High-pass and low-pass filter

Using Scipy the order of 4 butterworth filter

Using Tkinter to build a GUI to determine the high pass filter of cut-off frequency. As for low-pass frequency we set is 10Hz.

The example code is below:

import scipy.signal as ss

#==========進行低通濾波=========
sample_rate=200 #取樣頻率 (Hz)
order=4 #4階
lb_cutoff_freq=10  #(Hz)截至頻率
Wn=2*lb_cutoff_freq/sample_rate #Wn 是正規化的截止頻率,介於 0 和 1 之間

b, a = ss.butter(order, Wn, 'lowpass')  #scipy 的 butterworth 低通濾波器 
eq_data[f"{component}_filtered"] = ss.filtfilt(b, a, eq_data[component])

#===========進行高通濾波============
hb_cutoff_freq=filter_value[f"{component} bandpass_boundary (Hz)"]  #(Hz)截至頻率
#filter_value is the position of user click on the Tkinter GUI
Wn=2*hb_cutoff_freq/sample_rate #Wn 是正規化的截止頻率,介於 0 和 1 之間
b, a = ss.butter(order, Wn, 'highpass')  #scipy 的 butterworth 高通濾波器 
eq_data[f"{component}_filtered"] = ss.filtfilt(b, a, eq_data[f"{component}_filtered"])

PSD, PSV, PSA caculation

Using the function below to caculate PSD and follow these formula to calculation PSV and PSA.

In here damping ratio is 0.05, $\omega$ is natural frequency.

image

def Sd_calculate(w,damp_ratio,eq_data,component,filtered=False):
    if filtered==True:
        component+="_filtered"

    for i in range(len(w)):
        num=1
        den=(1,2*damp_ratio*w[i],w[i]*w[i])
        system = (num, den)
        t1, yout, xout = ss.lsim(system,eq_data[f"{component}"],eq_data["Time"])
        Sd[i]=max(abs(yout))
    return Sd

Example for 2018 02/06 Hualien earthquake, station: HWA019

image

Contact

Any problem or discusssion please contact: [email protected]

earthquake-acceleration-responce-spectrum's People

Contributors

jasonchang0320 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

elifyild

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.