-
Notifications
You must be signed in to change notification settings - Fork 1
/
drift.py
30 lines (23 loc) · 931 Bytes
/
drift.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import numpy as np
import numpy.linalg as la
import matplotlib.pyplot as plt
import pandas as pd
import Dynas as dyn
### ENTRADA DE DADOS ###
t = np.linspace(0,39.98,num=2000)
u_a = pd.read_excel('deslocamentos_artificial.xlsx').to_numpy()
u_r = pd.read_excel('deslocamentos_real.xlsx').to_numpy()
### MODELANDO O DRIFT PARA SISMO ARTIFICIAL ###
drift_u_a = np.zeros((8,2000))
drift_u_a[0,:] = u_a[138,:]
for i in range (0,2000):
for k in range (0,7):
drift_u_a[k+1,i] = u_a[(138+144*(k+1)),i] - u_a[(138+144*k),i]
for i in range (0,8):
plt.figure(i,figsize=(12,4))
plt.plot(t,100*drift_u_a[i,:],'b')
plt.xlabel('Tempo (s)'); plt.ylabel('Deslocamento relativo entre pavimentos (cm)')
plt.xlim(0,max(t)); plt.ylim(-0.2,0.2)
plt.title(f'Deslocamento relativo entre o {i}º e o {i+1}º pavimentos na direção 0 DEG')
plt.grid(True)
plt.show()